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 358c6e3
Date Tue, 27 Aug 2013 12:06:07 GMT
Updated Branches:
  refs/heads/master 81938c68a -> 358c6e371


CLOUDSTACK-4471. If an instance fails to start then mark the volumes allocated as part of
VM creation as removed and set the volume state as destroyed.


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

Branch: refs/heads/master
Commit: 358c6e371d1a86cedf38452f4805f521ae0b5458
Parents: 81938c6
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Tue Aug 27 17:29:49 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Tue Aug 27 17:31:14 2013 +0530

----------------------------------------------------------------------
 .../engine/orchestration/VolumeOrchestrator.java          | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/358c6e37/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 9a262e7..0e98f48 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1103,8 +1103,14 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     @Override
     public void destroyVolume(Volume volume) {
         try {
-            volService.destroyVolume(volume.getId());
-        } catch (ConcurrentOperationException e) {
+            // Mark volume as removed if volume has not been created on primary
+            if (volume.getState() == Volume.State.Allocated) {
+                _volsDao.remove(volume.getId());
+                stateTransitTo(volume, Volume.Event.DestroyRequested);
+            } else {
+                volService.destroyVolume(volume.getId());
+            }
+        } catch (Exception e) {
             s_logger.debug("Failed to destroy volume" + volume.getId(), e);
             throw new CloudRuntimeException("Failed to destroy volume" + volume.getId(),
e);
         }


Mime
View raw message