Skip to content

Commit c94ee14

Browse files
Vladimir Melnikyadvr
authored andcommitted
kvm: suspend a VM before snapshot deletion (see PR apache#3193) (apache#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 apache#3193
1 parent 42501ce commit c94ee14

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,12 @@ public Answer backupSnapshot(final CopyCommand cmd) {
996996
primaryStore.getUuid());
997997
if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryStorage.isExternalSnapshot()) {
998998
final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
999+
try {
1000+
vm.suspend();
1001+
} catch(final Exception e) {
1002+
s_logger.debug("Failed to suspend the VM: " + e);
1003+
throw e;
1004+
}
9991005
snap.delete(0);
10001006

10011007
/*

ui/l10n/en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
19221922
"message.action.take.snapshot":"Please confirm that you want to take a snapshot of this volume.",
19231923
"message.action.unmanage.cluster":"Please confirm that you want to unmanage the cluster.",
19241924
"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.",
1925-
"message.action.vmsnapshot.delete":"Please confirm that you want to delete this VM snapshot.",
1925+
"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.",
19261926
"message.action.vmsnapshot.revert":"Revert VM snapshot",
19271927
"message.activate.project":"Are you sure you want to activate this project?",
19281928
"message.add.VPN.gateway":"Please confirm that you want to add a VPN Gateway",

0 commit comments

Comments
 (0)