shwstppr commented on a change in pull request #4378:
URL: https://github.com/apache/cloudstack/pull/4378#discussion_r502264412



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5627,6 +5629,50 @@ public VirtualMachine migrateVirtualMachine(Long vmId, 
Host destinationHost) thr
 
         // check if migrating to same host
         long srcHostId = vm.getHostId();
+
+        DeployDestination dest = null;
+        if (destinationHost == null) {
+            vm.setLastHostId(null); // Do not check last host
+            final VirtualMachineProfile profile = new 
VirtualMachineProfileImpl(vm);
+            final Host host = _hostDao.findById(srcHostId);
+            final DataCenterDeployment plan = new 
DataCenterDeployment(host.getDataCenterId(), null, null, null, null, null);

Review comment:
       @ustcweizhou finding a suitable host anywhere within the zone might 
result in returning a host in a different pod or cluster. This might also need 
storage migration. Will that be an issue? Especially when VM is having data 
disks attached. Also, cross-cluster at present fails on VMware when storage 
pools are cluster scoped. #4385 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to