Skip to content

Commit 40a7839

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 0ec6b9a commit 40a7839

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
@@ -875,19 +875,10 @@ public void createCapacityEntry(StoragePoolVO storagePool, short capacityType, l
875875
List<CapacityVO> capacities = _capacityDao.search(capacitySC, null);
876876

877877
long totalOverProvCapacity;
878-
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) {
878+
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.VMFS) {
879879
BigDecimal overProvFactor = getStorageOverProvisioningFactor(storagePool.getDataCenterId());
880-
totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();// All
881-
// this
882-
// for
883-
// the
884-
// inaccuracy
885-
// of
886-
// floats
887-
// for
888-
// big
889-
// number
890-
// multiplication.
880+
totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();
881+
// All this is for the inaccuracy of floats for big number multiplication.
891882
} else {
892883
totalOverProvCapacity = storagePool.getCapacityBytes();
893884
}
@@ -1596,7 +1587,7 @@ public boolean storagePoolHasEnoughSpace(List<Volume> volumes,
15961587
}
15971588

15981589
long totalOverProvCapacity;
1599-
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) {
1590+
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem || pool.getPoolType() == StoragePoolType.VMFS) {
16001591
totalOverProvCapacity = getStorageOverProvisioningFactor(pool.getDataCenterId()).multiply(new BigDecimal(pool.getCapacityBytes()))
16011592
.longValue();
16021593
} else {

0 commit comments

Comments
 (0)