Skip to content

Commit 13a9b94

Browse files
committed
CLOUDSTACK-3665:Failed to create volume from snapshot.
1 parent 7c5b484 commit 13a9b94

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ protected List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmPr
5959
Long podId = plan.getPodId();
6060
Long clusterId = plan.getClusterId();
6161

62-
if (clusterId == null) {
63-
return null;
64-
}
62+
if (podId == null) {
63+
// for zone wide storage, podId should be null. We cannot check
64+
// clusterId == null here because it will break ClusterWide primary
65+
// storage volume operation where
66+
// only podId is passed into this call.
67+
return null;
68+
}
6569
if (dskCh.getTags() != null && dskCh.getTags().length != 0) {
6670
s_logger.debug("Looking for pools in dc: " + dcId + " pod:" + podId + " cluster:" + clusterId
6771
+ " having tags:" + Arrays.toString(dskCh.getTags()));

engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ protected List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmPr
9696
}
9797
}
9898
} else {
99-
if (plan.getClusterId() == null) {
99+
if (plan.getPodId() == null) {
100+
// zone wide primary storage deployment
100101
return null;
101102
}
102103
List<StoragePoolVO> availablePools = _storagePoolDao.findLocalStoragePoolsByTags(plan.getDataCenterId(),

plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfi
4747
Long podId = plan.getPodId();
4848
Long clusterId = plan.getClusterId();
4949

50-
if (clusterId == null) {
50+
if (podId == null) {
5151
return null;
5252
}
5353

0 commit comments

Comments
 (0)