Bug 2050210

Summary: Clone with volume mode file system using Storage API fails
Product: Container Native Virtualization (CNV) Reporter: Bartosz Rybacki <brybacki>
Component: StorageAssignee: Adam Litke <alitke>
Status: CLOSED ERRATA QA Contact: dalia <dafrank>
Severity: high Docs Contact:
Priority: high    
Version: 4.9.0CC: alitke, awels, dafrank, fdeutsch, ngavrilo, pelauter, yadu
Target Milestone: ---   
Target Release: 4.9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: CNV v4.9.3-19 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2038679 Environment:
Last Closed: 2023-03-29 07:06:41 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: 2038679    
Bug Blocks:    

Description Bartosz Rybacki 2022-02-03 12:59:33 UTC
+++ This bug was initially created as a clone of Bug #2038679 +++

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-02-08 13:27:00 UTC
Bartosz, do you have a PR for this on the 4.9 branch?

Comment 2 Alexander Wels 2022-02-08 13:28:29 UTC
Just linked the PR

Comment 3 Bartosz Rybacki 2022-02-08 14:16:06 UTC
I was under impression that the bot or something will update the links. 

Thanks Alexander.

Comment 4 Yan Du 2022-02-21 02:29:30 UTC
Test on CNV4.9.0-23, clone works well, issue has been fixed.

Comment 6 Yan Du 2022-03-09 07:10:59 UTC
(In reply to Yan Du from comment #4)
> Test on CNV4.9.0-23, clone works well, issue has been fixed.

Correct the typo, verified on CNV4.9.3-23

Comment 9 Red Hat Bugzilla 2023-09-18 04:31:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days