kvm: suspend a VM before snapshot deletion (see PR #3193) (#3194)

To make sure that a qemu2-image won't be corrupted by the snapshot deletion procedure which is being performed after copying the snapshot to a secondary store, I'd propose to put a VM in to suspended state.

Additional reference: https://bugzilla.redhat.com/show_bug.cgi?id=920020#c5

Fixes #3193
This commit is contained in:
Vladimir Melnik 2019-06-04 13:34:45 +03:00 committed by Rohit Yadav
parent 42501ceecf
commit c94ee1454d
2 changed files with 7 additions and 1 deletions

View File

@ -996,6 +996,12 @@ public class KVMStorageProcessor implements StorageProcessor {
primaryStore.getUuid());
if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryStorage.isExternalSnapshot()) {
final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
try {
vm.suspend();
} catch(final Exception e) {
s_logger.debug("Failed to suspend the VM: " + e);
throw e;
}
snap.delete(0);
/*

View File

@ -1922,7 +1922,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
"message.action.take.snapshot":"Please confirm that you want to take a snapshot of this volume.",
"message.action.unmanage.cluster":"Please confirm that you want to unmanage the cluster.",
"message.action.vmsnapshot.create":"Please confirm that you want to take a snapshot of this instance. <br>Please notice that the instance will be paused during the snapshoting, and resumed after snapshotting, if it runs on KVM.",
"message.action.vmsnapshot.delete":"Please confirm that you want to delete this VM snapshot.",
"message.action.vmsnapshot.delete":"Please confirm that you want to delete this VM snapshot. <br>Please notice that the instance will be paused before the snapshot deletion, and resumed after deletion, if it runs on KVM.",
"message.action.vmsnapshot.revert":"Revert VM snapshot",
"message.activate.project":"Are you sure you want to activate this project?",
"message.add.VPN.gateway":"Please confirm that you want to add a VPN Gateway",