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 0A00A100C5 for ; Thu, 8 Aug 2013 02:14:39 +0000 (UTC) Received: (qmail 74868 invoked by uid 500); 8 Aug 2013 02:14:38 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 74840 invoked by uid 500); 8 Aug 2013 02:14: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 74832 invoked by uid 99); 8 Aug 2013 02:14:38 -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, 08 Aug 2013 02:14:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A68AD83567B; Thu, 8 Aug 2013 02:14:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: edison@apache.org To: commits@cloudstack.apache.org Date: Thu, 08 Aug 2013 02:14:38 -0000 Message-Id: <284b142ba563485bb95492cabf16ad4b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/master to 9bce985 Updated Branches: refs/heads/master 82c35e52e -> 9bce985f6 CLOUDSTACK-4109: fix upload volume to s3 for vmware Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e851f4a9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e851f4a9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e851f4a9 Branch: refs/heads/master Commit: e851f4a93039afac57f0ff790791cd1bbed624cf Parents: 82c35e5 Author: Edison Su Authored: Wed Aug 7 18:25:28 2013 -0700 Committer: Edison Su Committed: Wed Aug 7 19:14:18 2013 -0700 ---------------------------------------------------------------------- .../storage/motion/AncientDataMotionStrategy.java | 2 +- .../apache/cloudstack/storage/volume/VolumeObject.java | 8 ++++++-- .../resource/VmwareStorageSubsystemCommandHandler.java | 12 ++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e851f4a9/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java ---------------------------------------------------------------------- diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java index de7900b..8537a1c 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java @@ -204,7 +204,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { } return answer; } catch (Exception e) { - s_logger.debug("copy object failed: " + e.toString()); + s_logger.debug("copy object failed: ", e); if (cacheData != null) { cacheMgr.deleteCacheObject(cacheData); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e851f4a9/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java ---------------------------------------------------------------------- diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java index 404e3b2..5058dba 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java @@ -502,7 +502,9 @@ public class VolumeObject implements VolumeInfo { this.getId()); VolumeObjectTO newVol = (VolumeObjectTO) cpyAnswer.getNewData(); volStore.setInstallPath(newVol.getPath()); - volStore.setSize(newVol.getSize()); + if (newVol.getSize() != null) { + volStore.setSize(newVol.getSize()); + } this.volumeStoreDao.update(volStore.getId(), volStore); } } @@ -595,7 +597,9 @@ public class VolumeObject implements VolumeInfo { this.getId()); VolumeObjectTO newVol = (VolumeObjectTO) cpyAnswer.getNewData(); volStore.setInstallPath(newVol.getPath()); - volStore.setSize(newVol.getSize()); + if (newVol.getSize() != null) { + volStore.setSize(newVol.getSize()); + } this.volumeStoreDao.update(volStore.getId(), volStore); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e851f4a9/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java index 1361515..7d3c888 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageSubsystemCommandHandler.java @@ -30,6 +30,7 @@ import com.cloud.storage.DataStoreRole; import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.to.SnapshotObjectTO; +import org.apache.cloudstack.storage.to.VolumeObjectTO; import java.io.File; @@ -76,6 +77,17 @@ public class VmwareStorageSubsystemCommandHandler extends StorageSubsystemComman } if (srcDataStore.getRole() == DataStoreRole.ImageCache && destDataStore.getRole() == DataStoreRole.Image) { + //need to take extra processing for vmware, such as packing to ova, before sending to S3 + if (srcData.getObjectType() == DataObjectType.VOLUME) { + NfsTO cacheStore = (NfsTO)srcDataStore; + String parentPath = storageResource.getRootDir(cacheStore.getUrl()); + VolumeObjectTO vol = (VolumeObjectTO)srcData; + String path = vol.getPath(); + int index = path.lastIndexOf(File.separator); + String name = path.substring(index + 1); + storageManager.createOva(parentPath + File.separator + path, name); + vol.setPath(path + File.separator + name + ".ova"); + } needDelegation = true; }