This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch 4.11 in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.11 by this push: new c94ee14 kvm: suspend a VM before snapshot deletion (see PR #3193) (#3194) c94ee14 is described below commit c94ee1454d3ecdf1bf371fd18c8e3ec0631d3092 Author: Vladimir Melnik <vladi...@melnik.net.ua> AuthorDate: Tue Jun 4 13:34:45 2019 +0300 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 --- .../src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java | 6 ++++++ ui/l10n/en.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java index 36be2d3..53a2278 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java @@ -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); /* diff --git a/ui/l10n/en.js b/ui/l10n/en.js index 86a8606..b9f3682 100644 --- a/ui/l10n/en.js +++ b/ui/l10n/en.js @@ -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",