This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 68fa9a1061 Allow storage.overprovisioning.factor to be <1 which allows 
underprovisioning of storage pools (#6218)
68fa9a1061 is described below

commit 68fa9a106134a643a357f15a9871e5fd3035d72f
Author: Wido den Hollander <[email protected]>
AuthorDate: Thu Apr 7 14:50:55 2022 +0200

    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
---
 .../main/java/com/cloud/configuration/ConfigurationManagerImpl.java  | 4 ++--
 server/src/main/java/com/cloud/storage/StorageManagerImpl.java       | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java 
b/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
index d308f087d0..24d64a9fca 100755
--- a/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -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);
             }
diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java 
b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
index 336565f7cd..cdf7c3b2b8 100644
--- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java
@@ -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();
 

Reply via email to