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/09/15 09:03:13 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #4294: Create template from detached data-disks on VMWare

Pearl1594 commented on a change in pull request #4294:
URL: https://github.com/apache/cloudstack/pull/4294#discussion_r488505639



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -1234,6 +1246,15 @@ public Answer createTemplateFromVolume(CopyCommand cmd) {
 
             details = "create template from volume exception: " + VmwareHelper.getExceptionMessage(e);
             return new CopyCmdAnswer(details);
+        } finally {
+            try {
+                if (volume.getVmName() == null && workerVmMo != null) {
+                    workerVmMo.detachAllDisks();
+                    workerVmMo.destroy();
+                }
+            } catch (Throwable e) {
+                s_logger.warn("Failed to destroy worker VM created for detached volume");

Review comment:
       @shwstppr I could change it to an error log, however, I'm not sure if an exception is required as the preliminary job of creating the template is successful, and the cleanup has some issue.




----------------------------------------------------------------
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