Updated Branches: refs/heads/4.2 9a8dddac2 -> 2210f1b0e
CLOUDSTACK-5061 - Cloudstack doesn't consider storage overprovisioning factor when using thin Provisioning over VMWare VMFS datastores Fix is use the storage overprovisioning factor (global configuration parameter "storage.overprovisioning.factor") to calculate total provisioning capacity for storage space allocation over VMFS based storage pools as well. There are two level of thin provisioning provided in VMware, storage level and file-level (VMDK) thin provisioning. in CloudStack, all volumes are provisioned with thin VMDK format, so at hypervisor level, we ALWAYS do thin provisioning. If storage vendor has the ability to provide storage level thin provisioning in addition to VMDK thin provisioning, it is also allowed since it is transparent to Cloudstack. Signed-off-by: Sateesh Chodapuneedi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2210f1b0 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2210f1b0 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2210f1b0 Branch: refs/heads/4.2 Commit: 2210f1b0e49aaaaf15bfba4ec613546d69977003 Parents: 9a8ddda Author: Sateesh Chodapuneedi <[email protected]> Authored: Wed Nov 6 17:37:22 2013 +0530 Committer: Sateesh Chodapuneedi <[email protected]> Committed: Wed Nov 6 17:37:22 2013 +0530 ---------------------------------------------------------------------- .../src/com/cloud/storage/StorageManagerImpl.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2210f1b0/server/src/com/cloud/storage/StorageManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index f23d764..2a79b0c 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -974,19 +974,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C List<CapacityVO> capacities = _capacityDao.search(capacitySC, null); long totalOverProvCapacity; - if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) { + if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.VMFS) { BigDecimal overProvFactor = getStorageOverProvisioningFactor(storagePool.getDataCenterId()); - totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();// All - // this - // for - // the - // inaccuracy - // of - // floats - // for - // big - // number - // multiplication. + totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue(); + // All this is for the inaccuracy of floats for big number multiplication. } else { totalOverProvCapacity = storagePool.getCapacityBytes(); } @@ -1741,7 +1732,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C } long totalOverProvCapacity; - if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) { + if (pool.getPoolType() == StoragePoolType.NetworkFilesystem || pool.getPoolType() == StoragePoolType.VMFS) { totalOverProvCapacity = getStorageOverProvisioningFactor(pool.getDataCenterId()).multiply(new BigDecimal(pool.getCapacityBytes())) .longValue(); } else {
