M #-: Skip recovery snap for not running VMs (#889)

This commit is contained in:
Jan Orel authored and GitHub committed 2021-02-26 15:35:07 +01:00
1 parent b6f868fda1
commit 0c90f7879e
1 file changed
+6
+6
View File
@@ -49,6 +49,12 @@ if [ ! -L $DISK_PATH ]; then
exit 1
fi
# skip if VM is not running
if [ "$(virsh -c ${LIBVIRT_URI} domstate one-${VMID} >/dev/null)" != "running" ]; then
echo "VM ${VMID} is not running"
exit 1
fi
# Enumerate disks for which we don't create snapshot (all except $DISK_PATH)
DISKS=$(virsh -c ${LIBVIRT_URI} domblklist one-${VMID} | grep disk | awk '{print $2}')
OTHER_DISK_STR=""