mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-4528 [Vmware] new mapping vmware datacenter cloudstack zone - Virtual Router host migration across cluster FAIL
Change: - Also add a check in migrateSystemVM API to check that source and destination host are in the same cluster
This commit is contained in:
parent
92eb84c3e0
commit
af175d8c65
@ -3917,6 +3917,18 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
||||
+ destinationHost.getResourceState());
|
||||
}
|
||||
|
||||
if (vm.getType() != VirtualMachine.Type.User) {
|
||||
// for System VMs check that the destination host is within the same
|
||||
// cluster
|
||||
HostVO srcHost = _hostDao.findById(srcHostId);
|
||||
if (srcHost != null && srcHost.getClusterId() != null && destinationHost.getClusterId() != null) {
|
||||
if (srcHost.getClusterId().longValue() != destinationHost.getClusterId().longValue()) {
|
||||
throw new InvalidParameterValueException(
|
||||
"Cannot migrate the VM, destination host is not in the same cluster as current host of the VM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkHostsDedication(vm, srcHostId, destinationHost.getId());
|
||||
|
||||
// call to core process
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user