Skip to content

Commit 2210f1b

Browse files
author
Sateesh Chodapuneedi
committed
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 <sateesh@apache.org>
1 parent 9a8ddda commit 2210f1b

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

‎server/src/com/cloud/storage/StorageManagerImpl.java‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -974,19 +974,10 @@ public void createCapacityEntry(StoragePoolVO storagePool, short capacityType, l
974974
List<CapacityVO> capacities = _capacityDao.search(capacitySC, null);
975975

976976
long totalOverProvCapacity;
977-
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) {
977+
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.VMFS) {
978978
BigDecimal overProvFactor = getStorageOverProvisioningFactor(storagePool.getDataCenterId());
979-
totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();// All
980-
// this
981-
// for
982-
// the
983-
// inaccuracy
984-
// of
985-
// floats
986-
// for
987-
// big
988-
// number
989-
// multiplication.
979+
totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();
980+
// All this is for the inaccuracy of floats for big number multiplication.
990981
} else {
991982
totalOverProvCapacity = storagePool.getCapacityBytes();
992983
}
@@ -1741,7 +1732,7 @@ public boolean storagePoolHasEnoughSpace(List<Volume> volumes,
17411732
}
17421733

17431734
long totalOverProvCapacity;
1744-
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) {
1735+
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem || pool.getPoolType() == StoragePoolType.VMFS) {
17451736
totalOverProvCapacity = getStorageOverProvisioningFactor(pool.getDataCenterId()).multiply(new BigDecimal(pool.getCapacityBytes()))
17461737
.longValue();
17471738
} else {

0 commit comments

Comments
 (0)