From 9da36af711ffc1a75da5cc66b2d4c0c553556067 Mon Sep 17 00:00:00 2001 From: edison Date: Wed, 8 Jan 2014 15:25:26 -0800 Subject: [PATCH] CLOUDSTACK-5763: if vm is stopped, then don't check hypervisor support live storage migration capabilities. --- server/src/com/cloud/storage/VolumeApiServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 5ffa99b0de7..f0b74976a48 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()) {