cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [03/25] git commit: refs/heads/api_entity - CLOUDSTACK-1608: enable attach a volume created on zone wide storage to a vm created on cluster or host wide storage
Date Thu, 21 Mar 2013 01:04:17 GMT
CLOUDSTACK-1608: enable attach a volume created on zone wide storage to a vm created on cluster
or host wide storage


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ba249c0e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ba249c0e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ba249c0e

Branch: refs/heads/api_entity
Commit: ba249c0e669bbdbbf26a047d0b2f1a24b9671b8d
Parents: c60ef79
Author: Edison Su <sudison@gmail.com>
Authored: Tue Mar 19 14:45:17 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Tue Mar 19 14:45:17 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/VolumeManagerImpl.java   |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ba249c0e/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index eb33bc4..a23ea32 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -1453,11 +1453,15 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
             throw new CloudRuntimeException("Can't get scope of data store: " + storeForDataVol.getId());
         }
         
+        if (storeForDataStoreScope.getScopeType() == ScopeType.ZONE) {
+            return false;
+        }
+        
         if (storeForRootStoreScope.getScopeType() != storeForDataStoreScope.getScopeType())
{
             throw new CloudRuntimeException("Can't move volume between scope: " + storeForDataStoreScope.getScopeType()
+ " and " + storeForRootStoreScope.getScopeType());
         }
        
-        return storeForRootStoreScope.isSameScope(storeForRootStoreScope);
+        return !storeForRootStoreScope.isSameScope(storeForDataStoreScope);
     }
     
     private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volume, Long deviceId)
{


Mime
View raw message