Bug 2217910

Summary: [cnv-4.13] kubevirt should allow runtimeclass to be configured in a pod
Product: Container Native Virtualization (CNV) Reporter: Simone Tiraboschi <stirabos>
Component: InstallationAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED ERRATA QA Contact: SATHEESARAN <sasundar>
Severity: high Docs Contact:
Priority: high    
Version: 4.13.0CC: dbasunag, gveitmic, igarcia, jortialc, kbidarka, mtosatti, ngu, nunnatsa, phoracek, sasundar, sgott, stirabos, vromanso
Target Milestone: ---   
Target Release: 4.13.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v4.13.2.rhel9-66 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2203291
: 2217913 (view as bug list) Environment:
Last Closed: 2023-07-11 16:02:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2203291    
Bug Blocks: 2217913    

Comment 1 SATHEESARAN 2023-07-06 06:55:41 UTC
Tested with CNV bundle v4.13.2.rhel9-67 with the following test cases:

1. General information about 'hco.spec.defaultRuntimeClass' and 'kubevirt.spec.configuration.defaultRuntimeClass' are available with 'oc explain'
2. Created a new performance profile - 'performance-perfprofile-cpu'
<snip>
apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"performance.openshift.io/v2","kind":"PerformanceProfile","metadata":{"annotations":{},"name":"perfprofile-cpu"},"spec":{"cpu":{"balanceIsloated":false,"isolated":"1","reserved":"2"},"nodeSelector":{"node-role.kubernetes.io/worker":""}}}
  creationTimestamp: "2023-07-05T16:57:46Z"
  finalizers:
  - foreground-deletion
  generation: 1
  name: perfprofile-cpu
  resourceVersion: "618568"
  uid: 59129bc3-3fde-4cad-8fd4-dea2dce7ef1b
spec:
  cpu:
    isolated: "1"
    reserved: "2"
  nodeSelector:
    node-role.kubernetes.io/worker: ""
</snip>
Wait for mcp update to be completed on worker nodes.

3. With VMs running, set hco.spec.defaultRuntimeClass to 'performance-perfprofile-cpu'
This option is set in HCO and also got propagated to kubevirt.
$ oc get kubevirt kubevirt-kubevirt-hyperconverged -n openshift-cnv -o json | jq '.spec.configuration.defaultRuntimeClass'
"performance-perfprofile-cpu"

This never affected the running VM, but the new VM created had its virt-launcher with this option
$ oc get pod virt-launcher-fedora-7iqddg2glod87tgw-pk96d -o yaml | grep -i perf
  runtimeClassName: performance-perfprofile-cpu

4. Removing hco.spec.defaultRuntimeClass also removed it from kubevirt.spec.configuration, but
virt-launcher resets this option after a restart

With the above test cases and observations, marking this bug as VERIFIED

Comment 7 errata-xmlrpc 2023-07-11 16:02:38 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 (OpenShift Virtualization 4.13.2 Images), 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/RHEA-2023:4028