Bug 1961227 - Block DV using new storage spec creates PVC too large
Summary: Block DV using new storage spec creates PVC too large
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.8.0
Assignee: Bartosz Rybacki
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-17 15:02 UTC by Adam Litke
Modified: 2021-07-27 14:33 UTC (History)
4 users (show)

Fixed In Version: virt-cdi-importer v4.8.0-19
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-27 14:32:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 1791 0 None open Fix: Compute fs overhead only for fs volumeMode 2021-05-18 12:54:47 UTC
Github kubevirt containerized-data-importer pull 1799 0 None closed [release-v1.34] Fix: Compute fs overhead only for fs volumeMode #1791 2021-05-20 14:37:35 UTC
Red Hat Product Errata RHSA-2021:2920 0 None None None 2021-07-27 14:33:20 UTC

Description Adam Litke 2021-05-17 15:02:54 UTC
Description of problem:
When creating a DV using the new storage spec to auto-detect volume mode and access mode, the PVC size is padded when it should not be.


Version-Release number of selected component (if applicable):
virt-cdi-operator-container-v4.8.0-17

How reproducible:
Always

Steps to Reproduce:
1. Deploy cluster with OCS
2. Create the DV indicated below

Actual results:
PVC is created with block mode and a size request larger than 1G

Expected results:
PVC is created with a size request of 1G


Additional info:

=== Example DV: ===

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: blank-dv-with-storage
spec:
  source:
    blank: {}
  storage:
    storageClassName: ocs-storagecluster-ceph-rbd
    resources:
      requests:
        storage: 1Gi

=== Resulting PVC: ===
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  annotations:
    cdi.kubevirt.io/storage.contentType: kubevirt
    cdi.kubevirt.io/storage.import.source: none
    cdi.kubevirt.io/storage.pod.phase: Succeeded
    cdi.kubevirt.io/storage.pod.restarts: '0'
    cdi.kubevirt.io/storage.preallocation.requested: 'false'
    pv.kubernetes.io/bind-completed: 'yes'
    pv.kubernetes.io/bound-by-controller: 'yes'
    volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
  resourceVersion: '3943816'
  name: blank-dv-with-storage
  uid: 2327bf70-d828-42d8-8737-f7bc0f5dce97
  creationTimestamp: '2021-05-17T14:55:01Z'
  managedFields:
    - manager: kube-controller-manager
      operation: Update
      apiVersion: v1
      time: '2021-05-17T14:55:01Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            'f:pv.kubernetes.io/bind-completed': {}
            'f:pv.kubernetes.io/bound-by-controller': {}
            'f:volume.beta.kubernetes.io/storage-provisioner': {}
        'f:spec':
          'f:volumeName': {}
        'f:status':
          'f:accessModes': {}
          'f:capacity':
            .: {}
            'f:storage': {}
          'f:phase': {}
    - manager: virt-cdi-controller
      operation: Update
      apiVersion: v1
      time: '2021-05-17T14:55:01Z'
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:cdi.kubevirt.io/storage.contentType': {}
            'f:cdi.kubevirt.io/storage.import.source': {}
            'f:cdi.kubevirt.io/storage.pod.phase': {}
            'f:cdi.kubevirt.io/storage.pod.restarts': {}
            'f:cdi.kubevirt.io/storage.preallocation.requested': {}
          'f:labels':
            .: {}
            'f:app': {}
          'f:ownerReferences':
            .: {}
            'k:{"uid":"d47965b9-22f1-4910-adb4-a6c8736dc865"}':
              .: {}
              'f:apiVersion': {}
              'f:blockOwnerDeletion': {}
              'f:controller': {}
              'f:kind': {}
              'f:name': {}
              'f:uid': {}
        'f:spec':
          'f:accessModes': {}
          'f:resources':
            'f:requests':
              .: {}
              'f:storage': {}
          'f:storageClassName': {}
          'f:volumeMode': {}
  namespace: default
  ownerReferences:
    - apiVersion: cdi.kubevirt.io/v1beta1
      kind: DataVolume
      name: blank-dv-with-storage
      uid: d47965b9-22f1-4910-adb4-a6c8736dc865
      controller: true
      blockOwnerDeletion: true
  finalizers:
    - kubernetes.io/pvc-protection
  labels:
    app: containerized-data-importer
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: '1136235008'
  volumeName: pvc-2327bf70-d828-42d8-8737-f7bc0f5dce97
  storageClassName: ocs-storagecluster-ceph-rbd
  volumeMode: Block
status:
  phase: Bound
  accessModes:
    - ReadWriteMany
  capacity:
    storage: 2Gi

Comment 1 Adam Litke 2021-05-17 15:03:40 UTC
Bartosz, please take a look.

Comment 2 Bartosz Rybacki 2021-05-18 08:57:14 UTC
I managed to recreate it, now checking what is wrong.

Comment 3 Yan Du 2021-06-02 07:22:34 UTC
Test on OCP4.8 and virt-cdi-importer-container-v4.8.0-19, issue have been fixed.


DV:
------------8<-----------------
  spec:
    source:
      blank: {}
    storage:
      resources:
        requests:
          storage: 1Gi
      storageClassName: ocs-storagecluster-ceph-rbd
------------8<-----------------
PVC:
------------8<-----------------
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: 1Gi
    storageClassName: ocs-storagecluster-ceph-rbd
    volumeMode: Block
    volumeName: pvc-0b006c8b-7b59-48d5-91d6-b5bdff3e9284
  status:
    accessModes:
    - ReadWriteMany
    capacity:
      storage: 1Gi
    phase: Bound
------------8<-----------------

Comment 6 errata-xmlrpc 2021-07-27 14:32:06 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.8.0 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/RHSA-2021:2920


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