mirror of https://github.com/apache/cloudstack.git
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:
parent
b1a34ef335
commit
af4eb22a65
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue