Bug 2233049

Summary: Preferred value is not overwritten by value in VM spec
Product: Container Native Virtualization (CNV) Reporter: vsibirsk
Component: InfrastructureAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: Roni Kishner <rkishner>
Severity: high Docs Contact:
Priority: high    
Version: 4.14.0CC: gkapoor, jlejosne, lyarwood
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.14.0-379 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:06:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vsibirsk 2023-08-21 09:37:34 UTC
Description of problem:
Preferred value from VirtualMachinePreference is not overwritten by value in VirtualMachine spec

Version-Release number of selected component (if applicable):
4.14

How reproducible:
100%

Steps to Reproduce:
1.Create a VM with VMPreference in spec (for e.g. win11 vm with windows.11 preference)
2.Overwrite a preferred value in VM spec (for e.g. secureBoot: false)
3.Start VM

Actual results:
Preferred value is not overwritten by value in VM spec

Expected results:
Preferred value is overwritten by value in VM spec

Additional info:
Issue also reproduces on 4.13

Comment 1 Jed Lejosne 2023-08-21 18:07:52 UTC
I was able to reproduce this on the latest kubevirt.
Looking at the code, this seems to be an oversight, that might only affect EFI secure boot and BIOS serial.
Everything else I looked at only sets preferences if the user hasn't set the corresponding value(s) in the VM spec.

Comment 2 Lee Yarwood 2023-08-21 19:53:11 UTC
(In reply to Jed Lejosne from comment #1)
> I was able to reproduce this on the latest kubevirt.
> Looking at the code, this seems to be an oversight, that might only affect
> EFI secure boot and BIOS serial.
> Everything else I looked at only sets preferences if the user hasn't set the
> corresponding value(s) in the VM spec.

ACK yeah this is a valid bug, I've posted the following to fix this:

https://github.com/kubevirt/kubevirt/issues/10313

https://github.com/kubevirt/kubevirt/pull/10314

Comment 3 Roni Kishner 2023-09-19 10:01:09 UTC
Verified on CNV-v4.14.0.rhel9-1914

Comment 5 errata-xmlrpc 2023-11-08 14:06:16 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 (Important: OpenShift Virtualization 4.14.0 Images security and bug fix 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-2023:6817