Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E4811773F for ; Thu, 16 Oct 2014 13:25:49 +0000 (UTC) Received: (qmail 65354 invoked by uid 500); 16 Oct 2014 13:25:34 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 65245 invoked by uid 500); 16 Oct 2014 13:25:34 -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 64711 invoked by uid 99); 16 Oct 2014 13:25:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Oct 2014 13:25:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 40EF79ADF10; Thu, 16 Oct 2014 13:25:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Date: Thu, 16 Oct 2014 13:25:56 -0000 Message-Id: In-Reply-To: <613e1faf1a374433b2613446fb63a1e7@git.apache.org> References: <613e1faf1a374433b2613446fb63a1e7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] git commit: updated refs/heads/master to 7072d8d vmware resource code needs to honor the timeout value send (cherry picked from commit 15a2ea7c7ecde3d0ac692bbab668de2c589eb4a8) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0fd9c43e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0fd9c43e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0fd9c43e Branch: refs/heads/master Commit: 0fd9c43ea26799d952f0d4eb5cc6c00abf7ddc7b Parents: 3b65a59 Author: Edison Su Authored: Thu Oct 9 16:28:20 2014 -0700 Committer: David Nalley Committed: Mon Oct 13 00:38:10 2014 -0400 ---------------------------------------------------------------------- .../resource/VmwareStorageProcessor.java | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0fd9c43e/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java index 8a4ba08..f5d2942 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java @@ -498,7 +498,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } } - private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, String srcVolumePath, DatastoreMO dsMo, String secStorageUrl) throws Exception { + private Pair copyVolumeFromSecStorage(VmwareHypervisorHost hyperHost, String srcVolumePath, DatastoreMO dsMo, String secStorageUrl, long wait) throws Exception { String volumeFolder = null; String volumeName = null; @@ -513,7 +513,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } String newVolume = VmwareHelper.getVCenterSafeUuid(); - restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, volumeFolder, volumeName); + restoreVolumeFromSecStorage(hyperHost, dsMo, newVolume, secStorageUrl, volumeFolder, volumeName, wait); return new Pair(volumeFolder, newVolume); } @@ -558,7 +558,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } } - Pair result = copyVolumeFromSecStorage(hyperHost, srcVolume.getPath(), new DatastoreMO(context, morDatastore), srcStore.getUrl()); + Pair result = copyVolumeFromSecStorage(hyperHost, srcVolume.getPath(), new DatastoreMO(context, morDatastore), srcStore.getUrl(), cmd.getWait() * 1000); deleteVolumeDirOnSecondaryStorage(result.first(), srcStore.getUrl()); VolumeObjectTO newVolume = new VolumeObjectTO(); newVolume.setPath(result.second()); @@ -865,7 +865,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } private Ternary createTemplateFromSnapshot(String installPath, String templateUniqueName, String secStorageUrl, String snapshotPath, - Long templateId) throws Exception { + Long templateId, long wait) throws Exception { //Snapshot path is decoded in this form: /snapshots/account/volumeId/uuid/uuid String backupSSUuid; String snapshotFolder; @@ -905,7 +905,7 @@ public class VmwareStorageProcessor implements StorageProcessor { try { if (new File(snapshotFullOVAName).exists()) { - command = new Script(false, "cp", _timeout, s_logger); + command = new Script(false, "cp", wait, s_logger); command.add(snapshotFullOVAName); command.add(installFullOVAName); result = command.execute(); @@ -916,7 +916,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } // untar OVA file at template directory - command = new Script("tar", 0, s_logger); + command = new Script("tar", wait, s_logger); command.add("--no-same-owner"); command.add("-xf", installFullOVAName); command.setWorkDir(installFullPath); @@ -930,7 +930,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } else { // there is no ova file, only ovf originally; if (new File(snapshotFullOvfName).exists()) { - command = new Script(false, "cp", _timeout, s_logger); + command = new Script(false, "cp", wait, s_logger); command.add(snapshotFullOvfName); //command.add(installFullOvfName); command.add(installFullPath); @@ -960,7 +960,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } } if (snapshotFullVMDKName != null) { - command = new Script(false, "cp", _timeout, s_logger); + command = new Script(false, "cp", wait, s_logger); command.add(snapshotFullVMDKName); command.add(installFullPath); result = command.execute(); @@ -1009,7 +1009,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } NfsTO nfsSvr = (NfsTO)imageStore; - Ternary result = createTemplateFromSnapshot(template.getPath(), uniqeName, nfsSvr.getUrl(), snapshot.getPath(), template.getId()); + Ternary result = createTemplateFromSnapshot(template.getPath(), uniqeName, nfsSvr.getUrl(), snapshot.getPath(), template.getId(), cmd.getWait() * 1000); TemplateObjectTO newTemplate = new TemplateObjectTO(); newTemplate.setPath(result.first()); @@ -2079,7 +2079,7 @@ public class VmwareStorageProcessor implements StorageProcessor { } private Long restoreVolumeFromSecStorage(VmwareHypervisorHost hyperHost, DatastoreMO primaryDsMo, String newVolumeName, String secStorageUrl, String secStorageDir, - String backupName) throws Exception { + String backupName, long wait) throws Exception { String secondaryMountPoint = mountService.getMountPoint(secStorageUrl); String srcOVAFileName = null; @@ -2100,7 +2100,7 @@ public class VmwareStorageProcessor implements StorageProcessor { if (!ovfFile.exists()) { srcOVFFileName = getOVFFilePath(srcOVAFileName); if (srcOVFFileName == null && ovafile.exists()) { // volss: ova file exists; o/w can't do tar - Script command = new Script("tar", 0, s_logger); + Script command = new Script("tar", wait, s_logger); command.add("--no-same-owner"); command.add("-xf", srcOVAFileName); command.setWorkDir(secondaryMountPoint + "/" + secStorageDir + "/" + snapshotDir);