mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Allow storage.overprovisioning.factor to be <1 which allows underprovisioning of storage pools (#6218)
By setting the value to 0.5 (example) we can underprovision a storage pool. This is useful in cases with Ceph where it reports the raw size of the cluster where the replication factor is not taken into account. Fixes: ##6205
This commit is contained in:
parent
2b1c4fbe6e
commit
68fa9a1061
@ -1128,8 +1128,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
||||
|
||||
value = value.trim();
|
||||
try {
|
||||
if (overprovisioningFactorsForValidation.contains(name) && Float.parseFloat(value) < 1f) {
|
||||
final String msg = name + " should be greater than or equal to 1";
|
||||
if (overprovisioningFactorsForValidation.contains(name) && Float.parseFloat(value) <= 0f) {
|
||||
final String msg = name + " should be greater than 0";
|
||||
s_logger.error(msg);
|
||||
throw new InvalidParameterValueException(msg);
|
||||
}
|
||||
|
||||
@ -359,7 +359,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
||||
int _storagePoolAcquisitionWaitSeconds = 1800; // 30 minutes
|
||||
int _downloadUrlCleanupInterval;
|
||||
int _downloadUrlExpirationInterval;
|
||||
// protected BigDecimal _overProvisioningFactor = new BigDecimal(1);
|
||||
private long _serverId;
|
||||
|
||||
private final Map<String, HypervisorHostListener> hostListeners = new HashMap<String, HypervisorHostListener>();
|
||||
@ -2500,8 +2499,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
||||
|
||||
totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(pool.getCapacityBytes())).longValue();
|
||||
|
||||
s_logger.debug("Found storage pool " + poolVO.getName() + " of type " + pool.getPoolType().toString() + " with over-provisioning factor " + overProvFactor.toString());
|
||||
s_logger.debug("Total over-provisioned capacity calculated is " + overProvFactor + " * " + toHumanReadableSize(pool.getCapacityBytes()));
|
||||
s_logger.debug("Found storage pool " + pool.getName() + " of type " + pool.getPoolType().toString() + " with overprovisioning factor " + overProvFactor.toString());
|
||||
s_logger.debug("Total over provisioned capacity calculated is " + overProvFactor + " * " + toHumanReadableSize(pool.getCapacityBytes()));
|
||||
} else {
|
||||
totalOverProvCapacity = pool.getCapacityBytes();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user