Skip to content

Commit 299c07c

Browse files
Likitha Shettywilderrodrigues
authored andcommitted
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 <wrodrigues@schubergphilis.com> This closes apache#541
1 parent f72412a commit 299c07c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public EndPoint select(DataObject object, StorageAction action) {
332332
}
333333
} else if (action == StorageAction.MIGRATEVOLUME) {
334334
VolumeInfo volume = (VolumeInfo)object;
335-
if (volume.getHypervisorType() == Hypervisor.HypervisorType.Hyperv) {
335+
if (volume.getHypervisorType() == Hypervisor.HypervisorType.Hyperv || volume.getHypervisorType() == Hypervisor.HypervisorType.VMware) {
336336
VirtualMachine vm = volume.getAttachedVM();
337337
if ((vm != null) && (vm.getState() == VirtualMachine.State.Running)) {
338338
Long hostId = vm.getHostId();

plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,7 +3081,7 @@ protected Answer execute(MigrateWithStorageCommand cmd) {
30813081
morDsAtTarget = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(tgtHyperHost, filerTo.getUuid());
30823082
morDsAtSource = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost, filerTo.getUuid());
30833083
if (morDsAtTarget == null) {
3084-
String msg = "Unable to find the mounted datastore with uuid " + morDsAtTarget + " to execute MigrateWithStorageCommand";
3084+
String msg = "Unable to find the target datastore: " + filerTo.getUuid() + " on target host: " + tgtHyperHost.getHyperHostName() + " to execute MigrateWithStorageCommand";
30853085
s_logger.error(msg);
30863086
throw new Exception(msg);
30873087
}
@@ -3283,7 +3283,7 @@ private Answer execute(MigrateVolumeCommand cmd) {
32833283
vmName = vmMo.getName();
32843284
morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost, tgtDsName);
32853285
if (morDs == null) {
3286-
String msg = "Unable to find the mounted datastore with name " + tgtDsName + " to execute MigrateVolumeCommand";
3286+
String msg = "Unable to find the mounted datastore with name: " + tgtDsName + " on source host: " + srcHyperHost.getHyperHostName() +" to execute MigrateVolumeCommand";
32873287
s_logger.error(msg);
32883288
throw new Exception(msg);
32893289
}

0 commit comments

Comments
 (0)