CLOUDSTACK-3665:Failed to create volume from snapshot.

This commit is contained in:
Min Chen 2013-07-24 14:36:29 -07:00
parent 7c5b48425f
commit 13a9b94193
3 changed files with 10 additions and 5 deletions

View File

@ -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()));

View File

@ -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(),

View File

@ -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;
}