Bug 2038679

Summary: Clone with volume mode file system using Storage API fails
Product: Container Native Virtualization (CNV) Reporter: dalia <dafrank>
Component: StorageAssignee: Bartosz Rybacki <brybacki>
Status: CLOSED ERRATA QA Contact: dalia <dafrank>
Severity: high Docs Contact:
Priority: high    
Version: 4.10.0CC: alitke, brybacki, cnv-qe-bugs, mrashish, ngavrilo, pelauter
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: CNV v4.10.0-652 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2050210 (view as bug list) Environment:
Last Closed: 2022-03-16 16:06:09 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:
Bug Depends On:    
Bug Blocks: 2050210    

Description dalia 2022-01-09 13:39:55 UTC
Description of problem:
When cloning with volume mode file system, using storage API fails due to resizing.

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

How reproducible:
100%

Steps to Reproduce:
1. Create DV with file system, using storage api:

apiVersion: cdi.kubevirt.io/v1alpha1
kind: DataVolume
metadata: 
  name: <dv name>
  annotations:
    cdi.kubevirt.io/storage.bind.immediate.requested: "true"
spec: 
  storage: 
    resources: 
      requests: 
        storage: 38Gi
    storageClassName: hostpath-provisioner
  source: 
    http: 
      url: <os image>

2. Create clone

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: dest-dv
spec:
  source:
    pvc:
      name: <DV NAME>
      namespace: <DV NAMESPACE>
  storage:
    resources:
      requests:
        storage: 38Gi
    storageClassName: hostpath-provisioner
  contentType: kubevirt


Actual results:
clone fails: 
The request is invalid: spec.source.PVC: target resources requests storage size is smaller than the source


Expected results:
DV created.

Additional info:
Same clone using PVC API pass

Comment 1 Adam Litke 2022-01-10 12:36:35 UTC
Bartosz, please take a look.

Comment 2 Bartosz Rybacki 2022-01-11 13:31:16 UTC
Confirmed a problem exists, can easily recreate.

Validation webhook compares real PVC size of source volume with the requested size on spec.storage. 

Need to think how to correctly solve it, so it works for all cases (for example, when source filesystem has different overhead than target filesystem).

Comment 3 Adam Litke 2022-01-31 13:15:55 UTC
Peter, this is affecting the automatic boot source update feature.  Can you please approve blocker for it?

Comment 4 dalia 2022-02-09 15:03:50 UTC
verified on: CNV 4.10

Comment 9 errata-xmlrpc 2022-03-16 16:06:09 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 (Moderate: OpenShift Virtualization 4.10.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-2022:0947