mirror of
https://github.com/OpenNebula/one.git
synced 2025-04-01 06:50:25 +03:00
F OpenNebula/one#5793: add check to wake up vm in pmsuspended state (#2696)
Signed-off-by: Neal Hansen <nhansen@opennebula.io>
This commit is contained in:
parent
c14869eb84
commit
820e559042
@ -57,6 +57,20 @@ DS_LOCATION=$(dirname $(dirname $(dirname $FILE)))
|
||||
DS_LOCATION_NON_DOUBLE_SLASH=$(echo "$DS_LOCATION" | sed 's|//|/|g')
|
||||
VM_DIR=$(dirname $FILE)
|
||||
|
||||
# Check if the domain is just Power Management suspended
|
||||
VIRSH_STATE=$(virsh --connect $LIBVIRT_URI --readonly dominfo one-$VM_ID |
|
||||
grep State | tr -d ' ' | cut -d ':' -f 2)
|
||||
|
||||
if [ "$VIRSH_STATE" = "pmsuspended" ]; then
|
||||
exec_and_log "virsh --connect $LIBVIRT_URI dompmwakeup one-$VM_ID" \
|
||||
"Could not wake up VM from suspended state"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
RECALCULATE_CMD=$(cat <<EOF
|
||||
set -e -o pipefail
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user