You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by de...@apache.org on 2013/07/01 21:48:00 UTC

git commit: updated refs/heads/4.2 to af4eb22

Updated Branches:
  refs/heads/4.2 b1a34ef33 -> af4eb22a6


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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/af4eb22a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/af4eb22a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/af4eb22a

Branch: refs/heads/4.2
Commit: af4eb22a6539b9c25f6b9df2aa110bf099283cbb
Parents: b1a34ef
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Fri Jun 28 14:32:27 2013 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Tue Jul 2 00:39:27 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/af4eb22a/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 30fb322..d90e798 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -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 {