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
Retrieve current graphic consoles #1420
Conversation
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.
Looks ok, just a few questions before approving
src/sagas/index.js
Outdated
|
||
yield put(setVmConsoles({ vmId, consolesList: consoles, selectedConsole })) | ||
} | ||
// for headless VM (no graphics_consoles defined) - API response is `{}` |
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.
Is this saga, fetchConsoles
, necessary anymore?
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.
we can remove it
src/components/VmActions/index.js
Outdated
const hasRdp = isWindows(vm.getIn(['os', 'type'])) | ||
const defaultConsole = vm.get('defaultConsole') |
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.
Is the defaultConsole
being stored with the VM this way because you intend to make it user configurable in future?
Otherwise, it seems unnecessary to keep the system defaultConsole
stored in the VM when it can just be accessed in config
.
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.
Is the defaultConsole being stored with the VM this way because you intend to make it user configurable in future?
Yep. Per VM settings are the next step here.
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.
These changes LGTM. Hopefully the restapi patch can be progressed soon.
Question - and I didn't test this scenario - what happens if this change runs on an engine without the patch? Is the console functionality lost completely? If yes, we should probably put a more specific backend version check at login to ensure things are going to work.
Yes, there will be no consoles on the dashboard. We could use |
@sjd78 |
29a9f48
to
0dd32bd
Compare
1. use detail=current_graphics_consoles to retrieve the list of available consoles (for active VMs only) 2. remove AutoSelect 3. use ClientModeConsoleDefault to set console priorities 4. use additional `current` flag when fetching VM details to retrieve graphic consoles info from vm_dynamic. This is ~2x faster then standard `follow=graphics_consoles. 5. for backward compatibility use `follow=graphics_consoles¤t' when (shallow) fetching multiple VMs. If the new detail is supported by the server then those params will be ignored.
Changes:
|
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.
The backward compatibility works. I verified against a 4.4.5 engine.
Code LGTM
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.
@rszwajko
The changes look good and working well except the following:
- For headless Win based VMs, the RDP option is dismissed for both dashboard and VM details views.
- The
ClientModeVncDefault
config parameter is ignored for setting the default console, i.e. in caseClientModeVncDefault
is set toNoVnc
andClientModeConsoleDefault
is set tovnc
or the VM supports only vnc, then the 'VNC console browser' option should be set as a default on dashboard (this is how it behaves on webadmin as well). - For both new engine and backward compatibility for old engines:
It seems that using the vm_dynamic is faster, but we still need to be sure that using?follow=graphics_consoles¤t
or the newdetail=current_graphics_consoles
on dashboard won't re-generate bug https://bugzilla.redhat.com/show_bug.cgi?id=1795457 as was when using?follow=graphics_consoles
. This bug was the whole motivation for the original fix. When checking the code, it seems ok but I can't be sure since we don't know where the sql query:select * from getdisksvmguid
is actually generated by thefollow=graphics_consoles
call.
I suggest asking the performance QE team to verify before marking the BZ as modified. Unless we can verify that in the code.
Introduce clear separation between console protocols (VNC, Spice, RDP) and consoles visible in the UI (BrowserVnc, NativeVnc, Spice, RDP). Changes: 1. use defaultUiConsole - a read-only config value derived from defaultConsole and defaultVncMode 2. remove defaultConsole field from the VM and instead directly check the current defaultUiConsole config value
It's not a regression. This fix was introduced in 148f731
Fixed by introducing a clear separation between protocols and UI consoles available for the end user. The source of the confusion was that VNC protocol maps into 2 UI consoles.
OK. The approach seems safe to me as it is used by Web Admin (with comparable number of VMs). However we could do more research on this. |
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.
It's not a regression. This fix was introduced in 148f731
Based on webadmin and from current design aspect, we don't really support an option to disable RDP since RDP is always enabled for win vms, even headless ones.
We did miss that for older versions and added this functionality back on #1342.
So if we want to be compatible with webadmin, we need to add this.
Nevertheless since it was not supported till 1.6.8, it's ok for me to leave it as is until someone will complain. Not that important.
src/components/VmActions/index.js
Outdated
let consoles = [] | ||
|
||
consoles = vm.get('consoles').map((c) => ({ | ||
priority: 0, | ||
protocol: c.get('protocol'), | ||
uiConsole: toUiConsole(NATIVE, c.get('protocol')), |
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.
This doesn't seem correct to me. I think that in case Spice is not supported and vnc is supported then the default ui conosle type should be based on ClientModeVncDefault as well, i.e in case noVnc is supported then this should be the default.
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.
The current code provides the requested functionality.
Note that we always support both VNC flavors if VNC protocol is present:
NoVnc
is added whenvncConsole
flag is ttrue
.- The
Native
VNC is added by directly mapping the list of available protocols (that's whytoUiConsole()
is used with first parameter set toNATIVE
).
This logic was inherited from previous versions.
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.
@rszwajko the issue raised here is regarding the default console displayed for the VM card in case that the defaultConsole is not supported by that VM.
For reproducing:
set ClientModeConsoleDefault
=spice
, ClientModeVncDefault
=NoVnc
and set the VM to support only VNC
.
Expected result: the default option should be BrowserVnc
.
Actual result: the default option is VNC
.
This seems like not supported by the current code but it was supported by the previous version and by webadmin.
We did miss that for older versions and added this functionality back on #1342.
So if we want to be compatible with webadmin, we need to add this.
Nevertheless since it was not supported till 1.6.8, it's ok for me to leave it as is until someone will complain. Not that important.We can fix it under separate issue.
Sure, please open a separate issue for this
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.
@rszwajko the issue raised here is regarding the default console displayed for the VM card in case that the defaultConsole is not supported by that VM.
For reproducing:
setClientModeConsoleDefault
=spice
,ClientModeVncDefault
=NoVnc
and set the VM to support onlyVNC
.
Expected result: the default option should be BrowserVnc.
Actual result: the default option is VNC.
This seems like not supported by the current code but it was supported by the previous version and by webadmin.
OK. I understand the use case now. However I'm not sure if it applies to the current design. Previous version and Web Admin provide a single button with black-box style logic (no indication what console will be chosen by the algorithm).
In the new design it's transparent to the user:
- all available consoles are visible (the default console goes first)
- the default global console send from the server (server's default console) is displayed in Account Settings (see below - feature available soon). Due to that there is only one such default (we don't have secondary default for cases like
ClientModeConsoleDefault=spice
,ClientModeVncDefault=NoVnc
) - user can override(completely) the server's default by setting a preferred console in Account Settings (available soon). Once again it's only one value (a limitation of SelectBox UI).
- user can override the global console by setting per VM value (available in the next phase)
The goal is to have the logic here simple and transparent that's why only 2 levels are used:
- global - either server's default console or console set by the user in Account Settings
- per VM (next phase)
If the default is not supported by the given VM (for any reason) then consoles are displayed in default order (as before). Of course we could provide fallback but things will get complex i.e. imagine the case where:
ClientModeConsoleDefault=spice
,ClientModeVncDefault=NoVnc
- preferred console is RDP
- VM is Linux with VNC only
I'm not convinced if the added value justifies the complexity:)
src/constants/console.js
Outdated
export const SPICE = 'spice' | ||
export const RDP = 'rdp' | ||
|
||
// VNC modes sent from the backend (ClientConsoleMode) |
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.
ClientConsoleMode -> ClientModeVncDefault ?
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.
I was referring to VncConsoleModel.ClientConsoleMode
enum but referring to config property is better.
We can fix it under separate issue. |
@rszwajko
Not accurate. On webadmin you can currently choose the actual console type per VM ,but the default console (console button) is based on two things: the supported consoles and the global config ClientModeVncDefault value. So in case the user sets
We don't need to support a secondary default. But in a very specific case in which:
=> then the default console which appears as the first on list should be noVnc and not VNC.
in that case, the default should be NoVnc and not VNC. We can decide to neglect the default console options on web-ui dashboard and just display the consoles in a default fix order as it was up till now. But if we do support default ordering then let's do it compatible to webadmin. |
Of course we can address this specific scenario. Please check the newest commit. |
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.
The code now LGTM.
But there are performance test results that still needed to be examined before merging. They are discussed via mails.
@rszwajko please rebase |
The performance test results look ok so we can merge the PR. |
This PR depends on patch: https://gerrit.ovirt.org/c/ovirt-engine/+/114302 and fixes bug: https://bugzilla.redhat.com/1940766
available consoles (for active VMs only)
Screenshot (VNC console has the highest priority):