CLOUDSTACK-3372: CapacityManager does not count destroyed volumes when deploy VMs

This commit is contained in:
Wei Zhou 2013-07-05 09:49:56 +02:00
parent 313177a51e
commit 893eb37724
1 changed files with 2 additions and 2 deletions

View File

@ -499,8 +499,8 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
@Override
public long getAllocatedPoolCapacity(StoragePoolVO pool, VMTemplateVO templateForVmCreation){
// Get size for all the volumes
Pair<Long, Long> sizes = _volumeDao.getCountAndTotalByPool(pool.getId());
// Get size for all the non-destroyed volumes
Pair<Long, Long> sizes = _volumeDao.getNonDestroyedCountAndTotalByPool(pool.getId());
long totalAllocatedSize = sizes.second() + sizes.first() * _extraBytesPerVolume;
// Get size for VM Snapshots