Repository: cloudstack
Updated Branches:
  refs/heads/master f72412a80 -> 299c07c3e


CLOUDSTACK-8597. Failed to migrate volume from zone-wide to cluster-wide 
storage. While live migrating a volume, CS chooses the endpoint to perform the 
migration by selecting any host that has the storage containing the volume 
mounted on it. Instead, if the volume is attached to a running VM, the endpoint 
chosen by CS should be the host that contains the VM.

Signed-off-by: wilderrodrigues <[email protected]>

This closes #541


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

Branch: refs/heads/master
Commit: 299c07c3e1bcafcba5ca359054c13dc655126f65
Parents: f72412a
Author: Likitha Shetty <[email protected]>
Authored: Wed Apr 8 15:24:36 2015 +0530
Committer: wilderrodrigues <[email protected]>
Committed: Wed Jul 1 12:33:26 2015 +0200

----------------------------------------------------------------------
 .../cloudstack/storage/endpoint/DefaultEndPointSelector.java     | 2 +-
 .../src/com/cloud/hypervisor/vmware/resource/VmwareResource.java | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/299c07c3/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git 
a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
 
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index 7067b8c..0778e54 100644
--- 
a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ 
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -332,7 +332,7 @@ public class DefaultEndPointSelector implements 
EndPointSelector {
             }
         } else if (action == StorageAction.MIGRATEVOLUME) {
             VolumeInfo volume = (VolumeInfo)object;
-            if (volume.getHypervisorType() == 
Hypervisor.HypervisorType.Hyperv) {
+            if (volume.getHypervisorType() == Hypervisor.HypervisorType.Hyperv 
|| volume.getHypervisorType() == Hypervisor.HypervisorType.VMware) {
                 VirtualMachine vm = volume.getAttachedVM();
                 if ((vm != null) && (vm.getState() == 
VirtualMachine.State.Running)) {
                     Long hostId = vm.getHostId();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/299c07c3/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
 
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 5701ee9..6284f86 100644
--- 
a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ 
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -3081,7 +3081,7 @@ public class VmwareResource implements 
StoragePoolResource, ServerResource, Vmwa
                 morDsAtTarget = 
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(tgtHyperHost, 
filerTo.getUuid());
                 morDsAtSource = 
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost, 
filerTo.getUuid());
                 if (morDsAtTarget == null) {
-                    String msg = "Unable to find the mounted datastore with 
uuid " + morDsAtTarget + " to execute MigrateWithStorageCommand";
+                    String msg = "Unable to find the target datastore: " + 
filerTo.getUuid() + " on target host: " + tgtHyperHost.getHyperHostName() + " 
to execute MigrateWithStorageCommand";
                     s_logger.error(msg);
                     throw new Exception(msg);
                 }
@@ -3283,7 +3283,7 @@ public class VmwareResource implements 
StoragePoolResource, ServerResource, Vmwa
             vmName = vmMo.getName();
             morDs = 
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost, 
tgtDsName);
             if (morDs == null) {
-                String msg = "Unable to find the mounted datastore with name " 
+ tgtDsName + " to execute MigrateVolumeCommand";
+                String msg = "Unable to find the mounted datastore with name: 
" + tgtDsName + " on source host: " + srcHyperHost.getHyperHostName() +" to 
execute MigrateVolumeCommand";
                 s_logger.error(msg);
                 throw new Exception(msg);
             }

Reply via email to