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 f37057a
Date Wed, 04 Dec 2013 14:56:40 GMT
Updated Branches:
  refs/heads/master dfff362c1 -> f37057a21


CLOUDSTACK-5172. Detaching VM volume is not allowed if there are VM snapshots because any
changes to the disk layout will break the semantics of VM-based snapshot


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

Branch: refs/heads/master
Commit: f37057a215c886369924c81352449bf4f5a27d2c
Parents: dfff362
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Mon Dec 2 15:42:25 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Wed Dec 4 20:19:17 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f37057a2/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index e60d204..fdd5db5 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1236,6 +1236,12 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             throw new InvalidParameterValueException("Please specify a VM that is either
running or stopped.");
         }
 
+        // Don't allow detach if target VM has associated VM snapshots
+        List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vmId);
+        if (vmSnapshots.size() > 0) {
+            throw new InvalidParameterValueException("Unable to detach volume, please specify
a VM that does not have VM snapshots");
+        }
+
         AsyncJobExecutionContext asyncExecutionContext = AsyncJobExecutionContext.getCurrentExecutionContext();
         if (asyncExecutionContext != null) {
             AsyncJob job = asyncExecutionContext.getJob();


Mime
View raw message