From 1bde0f3fcc986eb8b96ee09f79461ff80a80aa48 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Tue, 2 Jul 2013 11:56:19 +0530 Subject: [PATCH] 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 --- server/src/com/cloud/storage/StorageManagerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index bb21afb2c05..dc48d3a5806 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -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 volumesInPool = _volumeDao.findByPoolId(pool.getId(), null); + for (VolumeVO volumeInPool : volumesInPool) { Long minIops = volumeInPool.getMinIops();