-
Notifications
You must be signed in to change notification settings - Fork 1.3k
consoleproxy: Enable console for vms in Stopping/Migrating state #3640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2392,7 +2392,12 @@ public Pair<String, Integer> getVncPort(final VirtualMachine vm) { | |
| 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 { | ||
|
Comment on lines
+2396
to
+2398
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 .
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DaanHoogland indeed there are some problems with vm console, for example
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, @weizhouapache these are not big issues. I just wanted to have mentioned them and am not 👎ing this! |
||
| answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName())); | ||
| } | ||
| if (answer != null && answer.getResult()) { | ||
| return new Pair<String, Integer>(answer.getAddress(), answer.getPort()); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) a lot of getState()s there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland not very much , only 4 :-)
will pay attention in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP, code can be such a joy.