Skip to content

Commit 45f0c73

Browse files
committed
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 Since original commit(31de58e) contained a bug, it was reverted and this commit is a revised one.
1 parent 92fea03 commit 45f0c73

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

‎engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,6 @@ protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh,
183183
Volume volume = _volumeDao.findById(dskCh.getVolumeId());
184184
List<Volume> requestVolumes = new ArrayList<Volume>();
185185
requestVolumes.add(volume);
186-
return storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool);
186+
return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool);
187187
}
188188
}

‎engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
3535
import com.cloud.hypervisor.Hypervisor.HypervisorType;
3636
import com.cloud.storage.StoragePool;
37-
import com.cloud.storage.Volume;
3837
import com.cloud.user.Account;
3938
import com.cloud.vm.DiskProfile;
4039
import com.cloud.vm.VirtualMachineProfile;
@@ -47,14 +46,6 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator {
4746
@Inject
4847
DataStoreManager dataStoreMgr;
4948

50-
@Override
51-
protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, DeploymentPlan plan) {
52-
Volume volume = _volumeDao.findById(dskCh.getVolumeId());
53-
List<Volume> requestVolumes = new ArrayList<Volume>();
54-
requestVolumes.add(volume);
55-
56-
return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool);
57-
}
5849

5950
@Override
6051
protected List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) {

0 commit comments

Comments
 (0)