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 2019/05/23 09:26:38 UTC
[GitHub] [cloudstack] DaanHoogland commented on a change in pull request
#3218: [WIP DO NOT MERGE] vmware: don't use redundant worker VM to extract
volume
DaanHoogland 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_r286854454
##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
##########
@@ -961,16 +961,19 @@ private void exportVolumeToSecondaryStroage(VirtualMachineMO vmMo, String volume
throw new Exception(msg);
}
- // 4 MB is the minimum requirement for VM memory in VMware
- vmMo.cloneFromCurrentSnapshot(workerVmName, 0, 4, volumeDeviceInfo.second(), VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
- clonedVm = vmMo.getRunningHost().findVmOnHyperHost(workerVmName);
- if (clonedVm == null) {
- String msg = "Unable to create dummy VM to export volume. volume path: " + volumePath;
- s_logger.error(msg);
- throw new Exception(msg);
+ if (clonedWorkerVMNeeded) {
+ // 4 MB is the minimum requirement for VM memory in VMware
+ vmMo.cloneFromCurrentSnapshot(workerVmName, 0, 4, volumeDeviceInfo.second(), VmwareHelper.getDiskDeviceDatastore(volumeDeviceInfo.first()));
+ clonedVm = vmMo.getRunningHost().findVmOnHyperHost(workerVmName);
+ if (clonedVm == null) {
+ String msg = "Unable to create dummy VM to export volume. volume path: " + volumePath;
+ s_logger.error(msg);
+ throw new Exception(msg);
+ }
+ clonedVm.exportVm(exportPath, exportName, false, false); //Note: volss: not to create ova.
Review comment:
ok, as said it is a matter of style but we have that boolean to decide: clonedWorkerVMNeeded
----------------------------------------------------------------
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