You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/10/09 19:22:39 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #4378: server: Optional destination host when migrate a vm

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:
users@infra.apache.org