CLOUDSTACK-3301 NPE wile deployVM in kvm Only solidfire type PS is setting/using the capacityIops, This check will fix to return the storage has enough Iops when capacityIops is set to NULL for any PS Storage provider

This commit is contained in:
Rajesh Battala 2013-07-02 11:56:19 +05:30 committed by Edison Su
parent c48c652aee
commit 1bde0f3fcc
1 changed files with 6 additions and 2 deletions

View File

@ -1490,11 +1490,15 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
if (requestedVolumes == null || requestedVolumes.isEmpty() || pool == null) {
return false;
}
// Only Solidfire type primary storage is using/setting Iops.
// This check will fix to return the storage has enough Iops when capacityIops is set to NULL for any PS Storage provider
if (pool.getCapacityIops() == null ) {
return true;
}
long currentIops = 0;
List<VolumeVO> volumesInPool = _volumeDao.findByPoolId(pool.getId(), null);
for (VolumeVO volumeInPool : volumesInPool) {
Long minIops = volumeInPool.getMinIops();