You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2014/01/09 00:25:54 UTC

git commit: updated refs/heads/4.3 to d1c0aa1

Updated Branches:
  refs/heads/4.3 b3d4b7250 -> d1c0aa157


CLOUDSTACK-5763: if vm is stopped, then don't check hypervisor support live storage migration capabilities.


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

Branch: refs/heads/4.3
Commit: d1c0aa157a819a3a3d17df848958b773a5d48ef2
Parents: b3d4b72
Author: edison <su...@gmail.com>
Authored: Wed Jan 8 15:25:26 2014 -0800
Committer: edison <su...@gmail.com>
Committed: Wed Jan 8 15:25:26 2014 -0800

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1c0aa15/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 9210c40..c68da8e 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1543,12 +1543,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
                     liveMigrateVolume = capabilities.isStorageMotionSupported();
                 }
             }
-        }
 
-        // If the disk is not attached to any VM then it can be moved. Otherwise, it needs to be attached to a vm
-        // running on a hypervisor that supports storage motion so that it be be migrated.
-        if (instanceId != null && !liveMigrateVolume) {
-            throw new InvalidParameterValueException("Volume needs to be detached from VM");
+            // If vm is running, and hypervisor doesn't support live migration, then return error
+            if (!liveMigrateVolume) {
+                throw new InvalidParameterValueException("Volume needs to be detached from VM");
+            }
         }
 
         if (liveMigrateVolume && !cmd.isLiveMigrate()) {