1
0
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:
Neal 2023-08-31 07:49:19 -06:00 committed by GitHub
parent c14869eb84
commit 820e559042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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