From 31de58edab563eb1cb50c5c06437fdd3efc6a3d2 Mon Sep 17 00:00:00 2001 From: ynojima Date: Wed, 18 Jun 2014 00:01:47 -0600 Subject: [PATCH] CLOUDSTACK-6935 refactor StoragePoolAllocator#filter logic to support IOPS capacity control in a cluster wide storage pool and a local storage pool to enable hypervisor type check, storage type check for root volume and avoid list check --- .../storage/allocator/AbstractStoragePoolAllocator.java | 2 +- .../storage/allocator/ZoneWideStoragePoolAllocator.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java index ddbb5a467bf..2d958a6bf68 100755 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java @@ -183,6 +183,6 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement Volume volume = _volumeDao.findById(dskCh.getVolumeId()); List requestVolumes = new ArrayList(); requestVolumes.add(volume); - return storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); + return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java index 8fb9c8d87ac..c6299060106 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java @@ -47,14 +47,6 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { @Inject DataStoreManager dataStoreMgr; - @Override - protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, DeploymentPlan plan) { - Volume volume = _volumeDao.findById(dskCh.getVolumeId()); - List requestVolumes = new ArrayList(); - requestVolumes.add(volume); - - return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); - } @Override protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) {