weizhouapache commented on a change in pull request #4378:
URL: https://github.com/apache/cloudstack/pull/4378#discussion_r502628997
##########
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:
@shwstppr you are right.
I will refactor it.
----------------------------------------------------------------
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]