Skip to content

Commit fcf9282

Browse files
author
Abhinandan Prateek
committed
CLOUDSTACK-8896: when the volume migrated to another pool the capacity calculations are fixed to take into account disk usage shifting from one pool to another
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
1 parent 1f355d6 commit fcf9282

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,9 @@ public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool,
17171717
if (!checkUsagedSpace(pool)) {
17181718
return false;
17191719
}
1720-
1720+
if (s_logger.isDebugEnabled()) {
1721+
s_logger.debug("Destination pool id: " + pool.getId());
1722+
}
17211723
// allocated space includes templates
17221724
StoragePoolVO poolVO = _storagePoolDao.findById(pool.getId());
17231725
long allocatedSizeWithTemplate = _capacityMgr.getAllocatedPoolCapacity(poolVO, null);
@@ -1747,7 +1749,10 @@ public boolean storagePoolHasEnoughSpace(List<Volume> volumes, StoragePool pool,
17471749
}
17481750
}
17491751

1750-
if (volumeVO.getState() != Volume.State.Ready) {
1752+
if (s_logger.isDebugEnabled()) {
1753+
s_logger.debug("pool id for the volume with id: " + volumeVO.getId() + " is: " + volumeVO.getPoolId());
1754+
}
1755+
if (volumeVO.getState() != Volume.State.Ready || volumeVO.getPoolId() != pool.getId()) {
17511756
totalAskingSize += getDataObjectSizeIncludingHypervisorSnapshotReserve(volumeVO, pool);
17521757

17531758
if (ScopeType.ZONE.equals(poolVO.getScope()) && volumeVO.getTemplateId() != null) {

0 commit comments

Comments
 (0)