Bug 1981158 - Trying to assign i915-GVTg_V5_4 vgpu appears to fail due to bad regex matching
Summary: Trying to assign i915-GVTg_V5_4 vgpu appears to fail due to bad regex matching
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.4.6.8
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ovirt-4.4.8
: ---
Assignee: Arik
QA Contact: Nisim Simsolo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-11 19:01 UTC by Clint Goudie
Modified: 2021-08-19 06:22 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.4.8-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-19 06:22:56 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 115752 0 master MERGED core: add underscore to the mdev_type regex 2021-07-19 10:51:52 UTC

Description Clint Goudie 2021-07-11 19:01:07 UTC
Description of problem:
Trying to assign a vgpu for Intel i915 devices ( i915-GVTg_V5_4 and i915-GVTg_V5_8) appears to fail because regex does not allow "_"


How reproducible:
Always

Steps to Reproduce:
1. Configure i915 vgpus.
2. Open Manage vGPU for the VM in question
3. See list of vgpus. Assign one to the VM.

Actual results:
No error message is displayed however the vgpu is not assigned

Expected results:
vgpu should be assigned to the VM.

Additional info:
Watching the developer console in Chrome we see:

URL with submission as: https://<host>/ovirt-engine/api/vms/<guid>

with a submission of: {custom_properties: {custom_property: [{name: "mdev_type", value: "i915-GVTg_V5_4"}]}}

This all looks fine, however it responds with a 400 error and this payload:
{
  "detail" : "[Cannot edit VM if some of the specified custom properties have illegal values. The keys are: mdev_type]",
  "reason" : "Operation Failed"
}

Taking it a step further, if we Edit the VM, select custom properties, from the drop down select mdev_type, enter i915-GVTg_V5_4, and press OK, the UI validation shows:  the value for parameter <mdev_type> should be in the format of: <^[^,](,?[0-9A-za-z-]+)+$>

It's pretty clear that _ needs to be added to that regex match.

This prevents you from assigning i915 vgpus to vms.

Comment 1 Clint Goudie 2021-07-11 19:03:48 UTC
It appears very similar to https://bugzilla.redhat.com/show_bug.cgi?id=1829830 

/cc: @

Comment 2 Clint Goudie 2021-07-11 19:04:18 UTC
@

Comment 3 Clint Goudie 2021-07-11 19:50:32 UTC
mdev_type does not have _ as one of it's characters, as you can see in 
/usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "select option_value  from vdc_options where option_name like 'PredefinedVMProperties' and version like '4.6' ;"
                                                                                                                                                                               option_value
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 sap_agent=^(true|false)$;sndbuf=^[0-9]+$;vhost=^(([a-zA-Z0-9_-]*):(true|false))(,(([a-zA-Z0-9_-]*):(true|false)))*$;viodiskcache=^(none|writeback|writethrough)$;

mdev_type=^[^,](,?[0-9A-Za-z-]+)+$;

hugepages=^[0-9]+$;scsi_hostdev=^(scsi_generic|scsi_block|scsi_hd|virtio_blk_pci)$;nvram_template=^.*$;extra_cpu_flags=^([+-]?[a-zA-Z0-9_-]+)(,[+-]?[a-zA-Z0-9_-]+)*$
(1 row)

Comment 4 Clint Goudie 2021-07-11 19:51:01 UTC
version 4.5 and 4.4 also do not have _ in their regex for mdev_type

Comment 5 Clint Goudie 2021-07-11 20:48:33 UTC
If you follow the instructions from https://access.redhat.com/solutions/5050081 with a slight modification:
 
/usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "select fn_db_update_config_value('PredefinedVMProperties', 'sap_agent=^(true|false)$;sndbuf=^[0-9]+$;vhost=^(([a-zA-Z0-9_-]*):(true|false))(,(([a-zA-Z0-9_-]*):(true|false)))*$;viodiskcache=^(none|writeback|writethrough)$;mdev_type=^[^,](,?[0-9A-Za-z_-]+)+$;hugepages=^[0-9]+$;scsi_hostdev=^(scsi_generic|scsi_block|scsi_hd|virtio_blk_pci)$;nvram_template=^.*$;extra_cpu_flags=^([+-]?[a-zA-Z0-9_-]+)(,[+-]?[a-zA-Z0-9_-]+)*$', '4.6');

(note, the versions 4.5 and 4.4 also have incorrect settings for mdev_type, so you'll need to adjust those as well, with slightly different text I believe)

You can assign the vgpu in both the vgpu screen as well as the custom properties screen. 

Once mapped, in my VM I see 06:00.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)

Looks like it's working, just needs an update to the next db upgrade script.

Comment 6 RHEL Program Management 2021-07-13 06:10:34 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 7 Nisim Simsolo 2021-08-04 07:06:02 UTC
Verification builds:
ovirt-engine-4.4.8.2-0.11.el8ev
vdsm-4.40.80.3-1.el8ev.x86_64
libvirt-daemon-7.0.0-14.3.module+el8.4.0+11878+84e54169.x86_64
qemu-kvm-5.2.0-16.module+el8.4.0+11923+e8b883e4.4.x86_64

Verification scenario:
Verified without GVTg hardware
1. Verify it is possible to add custom property -> mdev_type: i915-GVTg_V5_4
- custom properties textbox is not marked with red frame (as in previous build)
- when clicking "ok" button in eit VM dialog, the new configuration is applied.

Comment 8 Sandro Bonazzola 2021-08-19 06:22:56 UTC
This bugzilla is included in oVirt 4.4.8 release, published on August 19th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.8 release, it has been closed with a resolution of CURRENT RELEASE.

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


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