weizhouapache commented on a change in pull request #3640: consoleproxy: Enable 
console for vms in Stopping/Migrating state
URL: https://github.com/apache/cloudstack/pull/3640#discussion_r351712553
 
 

 ##########
 File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
 ##########
 @@ -2392,7 +2392,12 @@ public String getConsoleAccessUrlRoot(final long vmId) {
             s_logger.trace("Trying to retrieve VNC port from agent about VM " 
+ vm.getHostName());
         }
 
-        final GetVncPortAnswer answer = 
(GetVncPortAnswer)_agentMgr.easySend(vm.getHostId(), new 
GetVncPortCommand(vm.getId(), vm.getInstanceName()));
+        GetVncPortAnswer answer = null;
+        if (vm.getState() == State.Migrating && vm.getLastHostId() != null) {
+            answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getLastHostId(), 
new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
+        } else {
 
 Review comment:
   @DaanHoogland indeed there are some problems with vm console, for example
   (1) vm is Starting state, but is not running on any server  (eg applying 
dhcp/dns entries in virtual routers)
   (2) vm is Stopping state, but is stopped on server
   (3) vm is Migrating state, when we open the console of vm (on source host), 
and migration is done, the console is invalid.
   However, I think all these problems are not real issues. When vm state is 
updated, refresh the web page and a new console will work.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to