rafaelweingartner commented on a change in pull request #2500: Restrict the
number of managed clustered file systems per compute cluster
URL: https://github.com/apache/cloudstack/pull/2500#discussion_r214223783
##########
File path:
engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
##########
@@ -219,13 +206,21 @@ protected boolean filter(ExcludeList avoid, StoragePool
pool, DiskProfile dskCh,
return false;
}
+ if (pool.isManaged() && !managedStoragePoolCanScale(pool, plan)) {
+ return false;
+ }
+
// check capacity
- Volume volume = _volumeDao.findById(dskCh.getVolumeId());
- List<Volume> requestVolumes = new ArrayList<Volume>();
+ Volume volume = volumeDao.findById(dskCh.getVolumeId());
+ List<Volume> requestVolumes = new ArrayList<>();
requestVolumes.add(volume);
return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) &&
storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool, plan.getClusterId());
}
+ private boolean managedStoragePoolCanScale(StoragePool storagePool,
DeploymentPlan plan) {
+ return storageUtil.managedStoragePoolCanScale(storagePool,
plan.getClusterId(), plan.getHostId());
Review comment:
Why did you need to encapsulate this call into a method?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services