You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/04/16 10:19:03 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4029: Bring back vm.suspend during deleting VM snapshot

DaanHoogland commented on a change in pull request #4029: Bring back vm.suspend during deleting VM snapshot
URL: https://github.com/apache/cloudstack/pull/4029#discussion_r409445290
 
 

 ##########
 File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
 ##########
 @@ -1005,6 +1005,13 @@ public Answer backupSnapshot(final CopyCommand cmd) {
                             primaryStore.getUuid());
                     if (state == DomainInfo.DomainState.VIR_DOMAIN_RUNNING && !primaryStorage.isExternalSnapshot()) {
                         final DomainSnapshot snap = vm.snapshotLookupByName(snapshotName);
+                        try {
+                            s_logger.info(String.format("Suspending VM '%s' to delete snapshot,", vm.getName()));
+                            vm.suspend();
+                        } catch (final LibvirtException e) {
+                            s_logger.error("Failed to suspend the VM", e);
+                            throw e;
 
 Review comment:
   same comment as in #4033: first we suspend unconditionaly, and than, we just assume it need resuming without checking if it was running in the first place. Are there situations we should guard against more diligently? (cc @weizhouapache @rhtyd )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services