jayapalu commented on a change in pull request #2121: CLOUDSTACK-9641 In KVM 
SSVM and CPVM may use the old cmdline data, if?
URL: https://github.com/apache/cloudstack/pull/2121#discussion_r117425491
 
 

 ##########
 File path: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
 ##########
 @@ -2669,12 +2673,25 @@ private void orchestrateReboot(final String vmUuid, 
final Map<VirtualMachineProf
     }
 
     public Command cleanup(final VirtualMachine vm) {
-        return new StopCommand(vm, 
getExecuteInSequence(vm.getHypervisorType()), false);
+        StopCommand cmd = new StopCommand(vm, 
getExecuteInSequence(vm.getHypervisorType()), false);
+        cmd.setControlIp(getControlNicIpForVM(vm));
+        return cmd;
     }
 
+    private String getControlNicIpForVM(VirtualMachine vm){
+        if (vm.getType()== VirtualMachine.Type.ConsoleProxy || vm.getType()== 
VirtualMachine.Type.SecondaryStorageVm){
+            NicVO nic = _nicsDao.getControlNicForVM(vm.getId());
+            return nic.getIPv4Address();
+        }
+        else if(vm.getType()== VirtualMachine.Type.DomainRouter) return 
vm.getPrivateIpAddress();
 
 Review comment:
   except If coding convention ... code LGTM
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to