bug 13066 Storage over prov factor should be float rather than long which leads to wrong storage calculation

Reviewed by : Kishan.
This commit is contained in:
Nitin Mehta 2012-01-13 20:28:55 +05:30
parent be6642bf37
commit d0e18f68fd
1 changed files with 5 additions and 5 deletions

View File

@ -1854,17 +1854,17 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
capacities = _capacityDao.search(capacitySC, null);
long provFactor = 1;
float provFactor = 1;
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) {
provFactor = (long) _overProvisioningFactor;
provFactor = _overProvisioningFactor;
}
if (capacities.size() == 0) {
CapacityVO capacity = new CapacityVO(storagePool.getId(), storagePool.getDataCenterId(), storagePool.getPodId(), storagePool.getClusterId(), allocated, storagePool.getCapacityBytes()
* provFactor, capacityType);
CapacityVO capacity = new CapacityVO(storagePool.getId(), storagePool.getDataCenterId(), storagePool.getPodId(), storagePool.getClusterId(), allocated, (long)(storagePool.getCapacityBytes()
* provFactor), capacityType);
_capacityDao.persist(capacity);
} else {
CapacityVO capacity = capacities.get(0);
long currCapacity = provFactor * storagePool.getCapacityBytes();
long currCapacity = (long)(provFactor * storagePool.getCapacityBytes());
boolean update = false;
if (capacity.getTotalCapacity() != currCapacity) {
capacity.setTotalCapacity(currCapacity);