bug : 6095 Show proper error when vm create fails due to insufficient capacity

This commit is contained in:
kishan 2010-09-07 13:19:14 +05:30
parent 3232479106
commit e001d7e577
2 changed files with 5 additions and 1 deletions

View File

@ -142,7 +142,7 @@ public class UserConcentratedAllocator implements PodAllocator {
}
if (availablePods.size() == 0) {
s_logger.debug("There are no pods with enough memory/CPU capacity in zone" + zone.getName());
s_logger.debug("There are no pods with enough memory/CPU capacity in zone " + zone.getName());
return null;
} else {
// Return a random pod

View File

@ -1299,6 +1299,10 @@ public class UserVmManagerImpl implements UserVmManager {
podsToAvoid.add(pod.first().getId());
}
if(pod == null){
throw new ResourceAllocationException("Create VM " + ((vm == null) ? vmId : vm.toString()) + " failed. There are no pods with enough CPU/memory");
}
if ((vm == null) || (poolid == 0)) {
throw new ResourceAllocationException("Create VM " + ((vm == null) ? vmId : vm.toString()) + " failed due to no Storage Pool is available");
}