mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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 #541
This commit is contained in:
parent
f72412a80d
commit
299c07c3e1
@ -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();
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user