CLOUDSTACK-3189: Primary storage usage is not getting decremented after deleting the DATA volumes.

When a volume is created the resource usage for it gets incremented. If it is deleted without being
attached to a volume, the decrement doesn't take place. Fixed the delete volume code to decrement
resource usage for a volume in allocated state too.
This commit is contained in:
Sanjay Tripathi 2013-06-28 14:32:27 +05:30 committed by Devdeep Singh
parent b1a34ef335
commit af4eb22a65
1 changed files with 1 additions and 1 deletions

View File

@ -1347,7 +1347,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
ResourceType.volume);
/* If volume is in primary storage, decrement primary storage count else decrement secondary
storage count (in case of upload volume). */
if (volume.getFolder() != null) {
if (volume.getFolder() != null || volume.getState() == Volume.State.Allocated) {
_resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.primary_storage,
new Long(volume.getSize()));
} else {