cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to eac3631
Date Tue, 06 Aug 2013 10:38:41 GMT
Updated Branches:
  refs/heads/master 323f24676 -> eac3631ab


CLOUDSTACK-4038. State of the DATA volumes remains in Allocated state if they are deleted
before using them.
If a volume is in Allocated state i.e. not present in primary or secondary mark the volume
as removed.


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

Branch: refs/heads/master
Commit: eac3631abe56b97a8b14d6b75dc4c181cfcb8b2e
Parents: 323f246
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Tue Aug 6 15:30:11 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Tue Aug 6 16:02:40 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeManagerImpl.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eac3631a/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 0d0c1c0..86e6a5a 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -1337,6 +1337,12 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
                             Volume.class.getName(), volume.getUuid());
                 }
             }
+            // Mark volume as removed if volume has not been created on primary or secondary
+            if (volume.getState() == Volume.State.Allocated) {
+                _volsDao.remove(volumeId);
+                stateTransitTo(volume, Volume.Event.DestroyRequested);
+                return true;
+            }
             // expunge volume from primary if volume is on primary
             VolumeInfo volOnPrimary = volFactory.getVolume(volume.getId(), DataStoreRole.Primary);
             if (volOnPrimary != null) {


Mime
View raw message