DaanHoogland 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_r351696566
##########
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:
So we are making the decision we are opening a console to the old VM. looks
good but may have some problems. I suspect you tested @ustcweizhou .
problems I see are:
- this is a second migrate and the old host is no longer valid.
- the migration is already successful but not administered yet.
----------------------------------------------------------------
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