Changes for Bug 8997 - Fail to create volume from snapshot: NPE at "allocateToPool(FirstFitStoragePoolAllocator.java:63)

- ClusterId passed in could be null
This commit is contained in:
prachi 2011-03-15 18:40:09 -07:00
parent 63593c5057
commit 2076eec42b
4 changed files with 8 additions and 8 deletions

View File

@ -90,8 +90,8 @@ public class FirstFitAllocator implements HostAllocator {
ExcludeList avoid, int returnUpTo) {
long dcId = plan.getDataCenterId();
long podId = plan.getPodId();
long clusterId = plan.getClusterId();
Long podId = plan.getPodId();
Long clusterId = plan.getClusterId();
ServiceOffering offering = vmProfile.getServiceOffering();
VMTemplateVO template = (VMTemplateVO)vmProfile.getTemplate();

View File

@ -53,8 +53,8 @@ public class RandomAllocator implements HostAllocator {
ExcludeList avoid, int returnUpTo) {
long dcId = plan.getDataCenterId();
long podId = plan.getPodId();
long clusterId = plan.getClusterId();
Long podId = plan.getPodId();
Long clusterId = plan.getClusterId();
ServiceOffering offering = vmProfile.getServiceOffering();
List<Host> suitableHosts = new ArrayList<Host>();

View File

@ -59,8 +59,8 @@ public class FirstFitStoragePoolAllocator extends AbstractStoragePoolAllocator {
return suitablePools;
}
long dcId = plan.getDataCenterId();
long podId = plan.getPodId();
long clusterId = plan.getClusterId();
Long podId = plan.getPodId();
Long clusterId = plan.getClusterId();
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

@ -57,8 +57,8 @@ public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator {
return suitablePools;
}
long dcId = plan.getDataCenterId();
long podId = plan.getPodId();
long clusterId = plan.getClusterId();
Long podId = plan.getPodId();
Long clusterId = plan.getClusterId();
s_logger.debug("Looking for pools in dc: " + dcId + " pod:" + podId + " cluster:" + clusterId);
List<StoragePoolVO> pools = _storagePoolDao.listBy(dcId, podId, clusterId);
if (pools.size() == 0) {