DaanHoogland commented on a change in pull request #3218: vmware: don't use 
redundant worker VM to extract volume
URL: https://github.com/apache/cloudstack/pull/3218#discussion_r269082177
 
 

 ##########
 File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
 ##########
 @@ -1684,14 +1688,18 @@ public Answer createTemplateFromSnapshot(CopyCommand 
cmd) {
                 throw new Exception(msg);
             }
 
-            // 4 MB is the minimum requirement for VM memory in VMware
-            Pair<VirtualMachineMO, String[]> cloneResult =
-                    vmMo.cloneFromCurrentSnapshot(workerVmName, 0, 4, 
volumeDeviceInfo.second(), 
VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
-            clonedVm = cloneResult.first();
-            String disks[] = cloneResult.second();
-
-            clonedVm.exportVm(exportPath, exportName, false, false);
-            return new Pair<>(volumeDeviceInfo.second(), disks);
+            String diskDevice = volumeDeviceInfo.second();
+            String disks[] = 
vmMo.getCurrentSnapshotDiskChainDatastorePaths(diskDevice);
+            if (clonedWorkerVMNeeded) {
+                // 4 MB is the minimum requirement for VM memory in VMware
+                Pair<VirtualMachineMO, String[]> cloneResult =
+                        vmMo.cloneFromCurrentSnapshot(workerVmName, 0, 4, 
diskDevice, VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
+                clonedVm = cloneResult.first();
+                clonedVm.exportVm(exportPath, exportName, false, false);
 
 Review comment:
   also here, it would be nice to see just one call for doing the 'real' work.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to