Bug 2100344 - Cloning virtual machines is failing while creating DV with error "target resources requests storage size is smaller than the source" if source PVC is extended
Summary: Cloning virtual machines is failing while creating DV with error "target reso...
Keywords:
Status: CLOSED DUPLICATE of bug 2100345
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.10.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Adam Litke
QA Contact: Natalie Gavrielov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-23 07:02 UTC by nijin ashok
Modified: 2022-06-29 12:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-29 12:46:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description nijin ashok 2022-06-23 07:02:36 UTC
Description of problem:

Created a virtual machine with the below DV spec (spec.pvc)

~~~
oc get dv rhel8-cold-landfowl -o yaml |yq -y '.spec'
pvc:   <<<<
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 30Gi <<<
  storageClassName: ocs-external-storagecluster-ceph-rbd
  volumeMode: Block
~~~

After provisioning, extended the backend PVC to 40 GB.

~~~
rhel8-cold-landfowl            Bound    pvc-634e5504-6090-42c9-8dda-8490153bd34f   40Gi       RWX            ocs-external-storagecluster-ceph-rbd   17m
~~~

Used the OpenShift console and tried to clone the virtual machine. The cloned VM gets created with 30 GB instead of 40 GB.

~~~
oc get vm rhel8-cold-landfowl-clone -o yaml |yq -y '.spec.dataVolumeTemplates'
- metadata:
    creationTimestamp: null
    name: rhel8-cold-landfowl-clone-rhel8-cold-landfowl-tksun
  spec:
    pvc:
      accessModes:
        - ReadWriteMany
      resources:
        requests:
          storage: 30Gi
      storageClassName: ocs-external-storagecluster-ceph-rbd
      volumeMode: Block
    source:
      pvc:
        name: rhel8-cold-landfowl
        namespace: nijin-cnv
~~~

Because of this, the creation of cloned DV is failing with the error below:

~~~
3s          Warning   FailedDataVolumeCreate            virtualmachine/rhel8-cold-landfowl-clone                                    Error creating DataVolume rhel8-cold-landfowl-clone-rhel8-cold-landfowl-tksun: admission webhook "datavolume-validate.cdi.kubevirt.io" denied the request:  target resources requests storage size is smaller than the source
~~~

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

OpenShift Virtualization   4.10.2
OpenShift 4.10.15

How reproducible:

100%

Steps to Reproduce:
1. Create a VM with DV template 'spec.pvc'. 
2. Extend the PVC. 
3. Clone the VM. The cloned VM is taking the source DV size instead of PVC size. So the creation of cloned DV fails with the error "target resources requests storage size is smaller than the source".
  

Actual results:

Cloning virtual machines is failing while creating DV with error "target resources requests storage size is smaller than the source"

Expected results:

Cloning should work
Additional info:

Comment 1 Yan Du 2022-06-29 12:46:56 UTC

*** This bug has been marked as a duplicate of bug 2100345 ***


Note You need to log in before you can comment on or make changes to this bug.