rhtyd commented on a change in pull request #3218: [WIP DO NOT MERGE] vmware:
don't use redundant worker VM to extract volume
URL: https://github.com/apache/cloudstack/pull/3218#discussion_r286853324
##########
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:
In the current mechanism, we need a worker VM to take snapshot and export
the disk; without at least one worker VM I'm not sure how we can export
template/disk?
----------------------------------------------------------------
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