From commits-return-87747-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Thu May 23 09:26:39 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4CD4E18062F for ; Thu, 23 May 2019 11:26:39 +0200 (CEST) Received: (qmail 63437 invoked by uid 500); 23 May 2019 09:26:38 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 63428 invoked by uid 99); 23 May 2019 09:26:38 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 May 2019 09:26:38 +0000 From: GitBox To: commits@cloudstack.apache.org Subject: [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 Message-ID: <155860359856.29965.8212311013912506320.gitbox@gitbox.apache.org> Date: Thu, 23 May 2019 09:26:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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