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/9da36af7 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9da36af7 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9da36af7 Branch: refs/heads/4.4 Commit: 9da36af711ffc1a75da5cc66b2d4c0c553556067 Parents: a3edd1a Author: edison <[email protected]> Authored: Wed Jan 8 15:25:26 2014 -0800 Committer: Edison Su <[email protected]> Committed: Thu Mar 27 17:38:40 2014 -0700 ---------------------------------------------------------------------- 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/9da36af7/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 5ffa99b..f0b7497 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1535,12 +1535,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()) {
