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 8ED22101FD for ; Wed, 24 Jul 2013 04:02:23 +0000 (UTC) Received: (qmail 71984 invoked by uid 500); 24 Jul 2013 04:02:23 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 71962 invoked by uid 500); 24 Jul 2013 04:02:22 -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 71955 invoked by uid 99); 24 Jul 2013 04:02:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jul 2013 04:02:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A04808B3067; Wed, 24 Jul 2013 04:02:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sateesh@apache.org To: commits@cloudstack.apache.org Message-Id: <23fa7113f2aa4e7abe02493d7449db2f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.2 to c5131af Date: Wed, 24 Jul 2013 04:02:21 +0000 (UTC) Updated Branches: refs/heads/4.2 9ca72536c -> c5131af65 CLOUDSTACK-3758 [Vmware][ZWPS] Failed to create volume from snapshot Signed-off-by: Sateesh Chodapuneedi Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c5131af6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c5131af6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c5131af6 Branch: refs/heads/4.2 Commit: c5131af658ca70466a9ea4407c7048348ef7b931 Parents: 9ca7253 Author: Sateesh Chodapuneedi Authored: Wed Jul 24 03:48:28 2013 +0530 Committer: Sateesh Chodapuneedi Committed: Wed Jul 24 03:57:05 2013 +0530 ---------------------------------------------------------------------- .../cloud/storage/snapshot/SnapshotManagerImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c5131af6/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 4ea275d..1300f02 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -44,6 +44,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreDao; import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO; +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -78,9 +79,10 @@ import com.cloud.projects.Project.ListProjectResourcesCriteria; import com.cloud.resource.ResourceManager; import com.cloud.server.ResourceTag.TaggedResourceType; import com.cloud.storage.CreateSnapshotPayload; +import com.cloud.storage.DataStoreRole; +import com.cloud.storage.ScopeType; import com.cloud.storage.Snapshot; import com.cloud.storage.Snapshot.Type; -import com.cloud.storage.DataStoreRole; import com.cloud.storage.SnapshotPolicyVO; import com.cloud.storage.SnapshotScheduleVO; import com.cloud.storage.SnapshotVO; @@ -1145,7 +1147,14 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager, } String snapshotName = vmDisplayName + "_" + volume.getName() + "_" + timeString; - HypervisorType hypervisorType = volume.getHypervisorType(); + HypervisorType hypervisorType = HypervisorType.None; + StoragePoolVO storagePool = _storagePoolDao.findById(volume.getDataStore().getId()); + if (storagePool.getScope() == ScopeType.ZONE) { + hypervisorType = storagePool.getHypervisor(); + } else { + hypervisorType = volume.getHypervisorType(); + } + SnapshotVO snapshotVO = new SnapshotVO(volume.getDataCenterId(), volume.getAccountId(), volume.getDomainId(), volume.getId(), volume.getDiskOfferingId(), snapshotName, (short) snapshotType.ordinal(), snapshotType.name(), volume.getSize(), hypervisorType);