Updated Branches:
  refs/heads/master 7c5b48425 -> 13a9b9419

CLOUDSTACK-3665:Failed to create volume from snapshot.


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

Branch: refs/heads/master
Commit: 13a9b941930160a9634e27865a03cdc8aed6d6c3
Parents: 7c5b484
Author: Min Chen <[email protected]>
Authored: Wed Jul 24 14:36:29 2013 -0700
Committer: Min Chen <[email protected]>
Committed: Wed Jul 24 14:39:07 2013 -0700

----------------------------------------------------------------------
 .../allocator/ClusterScopeStoragePoolAllocator.java       | 10 +++++++---
 .../storage/allocator/LocalStoragePoolAllocator.java      |  3 ++-
 .../storage/allocator/RandomStoragePoolAllocator.java     |  2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13a9b941/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git 
a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
 
b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
index b1105ba..6b076d3 100644
--- 
a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
+++ 
b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
@@ -59,9 +59,13 @@ public class ClusterScopeStoragePoolAllocator extends 
AbstractStoragePoolAllocat
         Long podId = plan.getPodId();
         Long clusterId = plan.getClusterId();
 
-               if (clusterId == null) {
-                       return null;
-               }
+        if (podId == null) {
+            // for zone wide storage, podId should be null. We cannot check
+            // clusterId == null here because it will break ClusterWide primary
+            // storage volume operation where
+            // only podId is passed into this call.
+            return null;
+        }
         if (dskCh.getTags() != null && dskCh.getTags().length != 0) {
             s_logger.debug("Looking for pools in dc: " + dcId + "  pod:" + 
podId + "  cluster:" + clusterId
                     + " having tags:" + Arrays.toString(dskCh.getTags()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13a9b941/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git 
a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
 
b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
index 310f4a1..e0d0145 100644
--- 
a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
+++ 
b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java
@@ -96,7 +96,8 @@ public class LocalStoragePoolAllocator extends 
AbstractStoragePoolAllocator {
                 }
             }
         } else {
-            if (plan.getClusterId() == null) {
+            if (plan.getPodId() == null) {
+                // zone wide primary storage deployment
                 return null;
             }
             List<StoragePoolVO> availablePools = 
_storagePoolDao.findLocalStoragePoolsByTags(plan.getDataCenterId(),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13a9b941/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git 
a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
 
b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
index 025a969..527f070 100644
--- 
a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
+++ 
b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
@@ -47,7 +47,7 @@ public class RandomStoragePoolAllocator extends 
AbstractStoragePoolAllocator {
         Long podId = plan.getPodId();
         Long clusterId = plan.getClusterId();
 
-               if (clusterId == null) {
+               if (podId == null) {
                        return null;
                }
 

Reply via email to