Bug 1811466 - enable-usb-autoshare is always 0 in console.vv and usb-filter option is listed two times
Summary: enable-usb-autoshare is always 0 in console.vv and usb-filter option is liste...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-web-ui
Version: 4.3.8
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ovirt-4.4.3
: ---
Assignee: Hilda Stastna
QA Contact: Pavel Novotny
URL:
Whiteboard:
: 1686844 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-08 23:25 UTC by Germano Veit Michel
Modified: 2023-10-06 19:22 UTC (History)
9 users (show)

Fixed In Version: ovirt-web-ui-1.6.5-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 13:09:21 UTC
oVirt Team: UX
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-web-ui pull 1235 0 None closed Set usb-filter and enable-usb-autoshare entries in console.vv properly 2020-10-29 15:20:49 UTC
Github oVirt ovirt-web-ui pull 1286 0 None closed Set enable-usb-autoshare in console.vv file according to SpiceUsbAutoShare engine config value 2020-10-29 15:20:34 UTC
Red Hat Product Errata RHSA-2020:5179 0 None None None 2020-11-24 13:09:46 UTC

Description Germano Veit Michel 2020-03-08 23:25:53 UTC
Description of problem:

Unable to get USB Auto-Share to work, the engine always writes enable-usb-autoshare=0 in console.vv.
If I edit console.vv and change enable-usb-autoshare to 1 before opening it in remote-viewer, everything works.

Version-Release number of selected component (if applicable):
ovirt-engine-4.3.8.2-0.5.el7.noarch
ovirt-web-ui-1.6.0-2.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Follow Documentation:
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/virtual_machine_management_guide/sect-configuring_usb_devices#Using_USB_Devices_on_a_Red_Hat_Enterprise_Linux_Client
2. Check downloaded console.vv

$ egrep 'share|filter' console.vv 
usb-filter=-1,60186,10000,256,1|-1,1118,245,-1,1|-1,1133,2245,-1,1|-1,1133,2242,5,1|8,-1,-1,-1,1|7,-1,-1,-1,1|-1,-1,-1,-1,0
enable-usb-autoshare=0
usb-filter=null

Actual results:
* Generated console.vv has USB Auto-Share always disabled
* A duplicate usb-filter entry (BZ1686844)

Expected results:
* enable-usb-autoshare=1
* single usb-filter line

Additional info:
* VM is using spice only
* VM has USB enabled (vm_static.usb_policy = 2, controller present in vm_devices)
* VM was started via VM Portal
* Console.vv was generated by VM Portal

Comment 1 Germano Veit Michel 2020-03-08 23:43:30 UTC
Forgot to add a couple things:

1. This was a fresh 4.3.8 install
2. # engine-config -g SpiceUsbAutoShare
   SpiceUsbAutoShare: true version: general

Comment 2 Sharon Gratch 2020-06-09 11:15:29 UTC
 Germano, does it work when console.vv is generated via webadmin?

Comment 3 Germano Veit Michel 2020-06-09 22:00:16 UTC
(In reply to Sharon Gratch from comment #2)
>  Germano, does it work when console.vv is generated via webadmin?

Sorry but I don't recall if I tested that. Anyway the Documentation states that this only works via VM Portal:
~~~
USB redirection is only supported when you open the virtual machine from the VM Portal. 
~~~
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/virtual_machine_management_guide/sect-configuring_usb_devices#Using_USB_Devices_on_a_Red_Hat_Enterprise_Linux_Client

So is there any point in testing via webadmin?

Comment 4 Sharon Gratch 2020-06-10 15:13:28 UTC
(In reply to Germano Veit Michel from comment #3)
> Sorry but I don't recall if I tested that. Anyway the Documentation states
> that this only works via VM Portal:
> ~~~
> USB redirection is only supported when you open the virtual machine from the
> VM Portal. 
> ~~~
> https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/
> html/virtual_machine_management_guide/sect-
> configuring_usb_devices#Using_USB_Devices_on_a_Red_Hat_Enterprise_Linux_Clien
> 
> 
> So is there any point in testing via webadmin?

AFAIK, It should work on both webadmin and vm portal - so we'll need to update the documentation as well.
Arik, can you please confirm so that we'll open a documentation bug.

Anyway, I verified that and it is working for me on webadmin, so the problem is indeed only with the VM portal.

Comment 5 Arik 2020-06-11 06:42:23 UTC
If this option is presented on the webadmin and works for you then I see no reason to limit this only to the vm portal in the documentation.

Comment 6 Sharon Gratch 2020-06-11 15:01:35 UTC
So there are 2 issues to fix for VM portal:
1. Always set enable-usb-autoshare=1 in console.vv file generated by VM Portal. VM portal is not aware of VM's console options settings, meaning that it doesn't aware if the running VM is using SPICE only and VM's USB is enabled and autoshare is checked. So for overcoming that we'll always set enable-usb-autoshare to "1" for now.

2. Remove the extra usb-filter=null line from console.vv file generated by VM Portal.

Regarding webadmin:
The console.vv generated by webadmin set the enable-usb-autoshare to 1 when required, but the usb-filter is always set to "-1,-1,-1,-1,0" so it doesn't fully work as expected. Therefore there is no need to fix the documentation.

Comment 7 Sharon Gratch 2020-06-11 15:05:53 UTC
*** Bug 1686844 has been marked as a duplicate of this bug. ***

Comment 8 Hilda Stastna 2020-06-15 20:03:25 UTC
The two issues for VM Portal mentioned above should be fixed by https://github.com/oVirt/ovirt-web-ui/pull/1235

Comment 9 Scott Dickerson 2020-06-19 21:10:05 UTC
To verify, the 'SpiceUsbAutoShare' engine config value is not to be used by VM Portal.  VM Portal will always enable the spice USB auto-share regardless of the config value.  As long as that is true, the PR fix looks good.

Comment 10 Hilda Stastna 2020-06-22 12:12:54 UTC
Just a note that after some conversation, the fix was updated to use the 'SpiceUsbAutoShare' engine config value in the VM Portal.

Comment 14 Pavel Novotny 2020-08-28 16:21:14 UTC
FailedQA in ovirt-web-ui-1.6.4-1.el8ev.noarch

The enable-usb-autoshare should reflect value of SpiceUsbAutoShare,
but in console.vv file is always 'enable-usb-autoshare=1'
even if SpiceUsbAutoShare is set to false.

Comment 15 Hilda Stastna 2020-08-28 19:01:16 UTC
Please provide the exact steps to reproduce the scenario which does not work for you.

Also please read this comment: https://github.com/oVirt/ovirt-web-ui/pull/1235#pullrequestreview-434525826
So from what I understand, it's more complicated and 'enable-usb-autoshare' value does not depend only on the value of SpiceUsbAutoShare.

Comment 16 Pavel Novotny 2020-08-28 23:40:40 UTC
Steps to reproduce:
1. On the engine machine, set USB Auto Share to False and restart engine: 'engine-config -s SpiceUsbAutoShare=false && systemctl restart ovirt-engine'
2. In VM Portal, create new VM from Blank template (OS Type Windows 10 x64 and RHEL8 x64 tried) & add a bootable disk.
3. Run the VM. Once Powering Up or Up click SPICE Concole & download the console.vv file.
4. Run 'grep enable-usb-autoshare console.vv'

Result is always:
enable-usb-autoshare=1

From comment https://github.com/oVirt/ovirt-web-ui/pull/1235#pullrequestreview-434525826 
> Since VM portal currently doesn't get the console options configuration (hopefully it will be fixed as part of user settings feature) then the only option to control the enable-usb-autoshare is via the SpiceUsbAutoShare config value. If it's set to false then the default is not sharing the usb and therefore I think we shouldn't ignore that config value.
> When I meant always set to "1", I refer to the console settings options (ignore if "Enable USB Auto-Share" is checked/unchecked).

From what I understand, for VM Portal the `enable-usb-autoshare` value depends basically on the `SpiceUsbAutoShare` value in engine-config.

Comment 17 Hilda Stastna 2020-08-31 08:46:30 UTC
Thank you very much, Pavel, for the provided info. Could you, please, add if usb support was disabled/enabled (vm->console tab) in the Admin portal?

One more question: is the problem present in the 1.6.5-0 version of the VM Portal, too? Thanks.

Comment 25 Sharon Gratch 2020-09-02 12:37:04 UTC
Postponed this bug to 4.4.3 for fixing the issue mentioned on comment 16. It's too late to fix that for 4.4.2

Comment 26 Hilda Stastna 2020-09-02 18:13:11 UTC
Fix: https://github.com/oVirt/ovirt-web-ui/pull/1286

Comment 28 Pavel Novotny 2020-11-01 21:21:00 UTC
Verified in ovirt-web-ui-1.6.5-1.el8ev.noarch

Verified according to steps in comment 16.
If engine-config SpiceUsbAutoShare=true, then console.vv contains enable-usb-autoshare=1.
If engine-config SpiceUsbAutoShare=false, then console.vv contains enable-usb-autoshare=0.

Comment 32 errata-xmlrpc 2020-11-24 13:09:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: Red Hat Virtualization security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5179


Note You need to log in before you can comment on or make changes to this bug.