Bug 2219800

Summary: PreferredStorageClassName - PVC required
Product: Container Native Virtualization (CNV) Reporter: Roni Kishner <rkishner>
Component: InfrastructureAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: Roni Kishner <rkishner>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.14.0   
Target Milestone: ---   
Target Release: 4.14.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:05:53 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 Roni Kishner 2023-07-05 12:08:12 UTC
Description of problem:
When starting a VM with preference with the PreferredStorageClassName field, we must specify dataVolumeTemplates[0].spec.pvc, this will also auto populate dataVolumeTemplates[0].spec.pvc.resource which conflict with dataVolumeTemplates[0].spec.storage.resources.requests.storage

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

How reproducible:
100%

Steps to Reproduce:
1. Create VM with preference with PreferredStorageClassName
2. Add dataVolumeTemplates[0].spec.pvc.name to the VM spec
3. 

Actual results:
The VMI fail to be created with conflict error of 2 resources fields defined

Expected results:
The VMI should be created

Additional info:
an example of the conflict fields: 
    dataVolumeTemplates:
    - apiVersion: cdi.kubevirt.io/v1beta1
      kind: DataVolume
      metadata:
        creationTimestamp: null
        name: fedora
      spec:
        pvc:
          resources: {}
          storageClassName: nfs
          volumeName: volume-for-test
        sourceRef:
          kind: DataSource
          name: fedora
          namespace: openshift-virtualization-os-images
        storage:
          resources:
            requests:
              storage: "34087042032"

Comment 1 Roni Kishner 2023-08-06 08:41:10 UTC
Verified
https://github.com/kubevirt/kubevirt/pull/10154 also fixes related issues

Comment 3 errata-xmlrpc 2023-11-08 14:05:53 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