Bug 1927746 - Preallocation is not requested if DataVolume doesn't specify it on spec while it is enabled globally
Summary: Preallocation is not requested if DataVolume doesn't specify it on spec while...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 2.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 2.6.1
Assignee: Tomasz Barański
QA Contact: Qixuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-11 13:11 UTC by Qixuan Wang
Modified: 2021-04-07 08:46 UTC (History)
6 users (show)

Fixed In Version: virt-cdi-importer v2.6.1-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-07 08:46:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 1565 0 None closed Global preallocation setting is not taken into account correctly. 2021-02-19 09:58:40 UTC
Github kubevirt containerized-data-importer pull 1595 0 None closed [release-v1.28] Preallocation global setting for 1.28 2021-03-16 10:37:00 UTC
Red Hat Product Errata RHEA-2021:1126 0 None None None 2021-04-07 08:46:14 UTC

Description Qixuan Wang 2021-02-11 13:11:36 UTC
Description of problem:
If preallocation is enabled globally, create a DataVolume without preallocation stated, the annotation of DV's PVC is cdi.kubevirt.io/storage.preallocacation.requested: "false"

Discussed with Tomasz, the correct behavior is:
DV preallocation: true -> cdi.kubevirt.io/storage.preallocacation.requested: true
DV preallocation: false -> cdi.kubevirt.io/storage.preallocacation.requested: false
DV preallocation not present
global: true -> cdi.kubevirt.io/storage.preallocacation.requested: true
global: false -> cdi.kubevirt.io/storage.preallocacation.requested: false
global not present -> cdi.kubevirt.io/storage.preallocacation.requested: false (false is the default)


Version-Release number of selected component (if applicable):
Containerized Data Importer v1.28.2


How reproducible:
100%

Steps to Reproduce:
1. Enable preallocation globally.
$ [cnv-qe-jenkins@stg05-qixuan-b59vp-executor ~]$ oc get cdi -o yaml
apiVersion: v1
items:
- apiVersion: cdi.kubevirt.io/v1beta1
  kind: CDI
  metadata:
[...]
  spec:
    config:
      featureGates:
      - HonorWaitForFirstConsumer
      filesystemOverhead:
        global: "0.055"
      preallocation: true
    infra: {}
    uninstallStrategy: BlockUninstallIfWorkloadsExist
    workload: {}
  status:
[...]

2. Create a general DataVolume 
3. Check DV's PVC annotation.

Actual results:
[cnv-qe-jenkins@stg05-qixuan-b59vp-executor ~]$ oc get pvc xxx -o yaml | grep pre
cdi.kubevirt.io/storage.preallocacation.requested: "false"


Expected results:
cdi.kubevirt.io/storage.preallocacation.requested: "true"


Additional info:

Comment 1 Adam Litke 2021-02-18 21:06:50 UTC
Tomasz please take a look at this bug and see how it's different from Bug 1915704.

Comment 2 Tomasz Barański 2021-02-19 09:58:41 UTC
Bug 1915704 was reported as a problem with strict reconciliation and the resulting change in how CDI is configured, which turned out not to be a bug but a confusion regarding the correct way to setup configuration.

However, an actual bug has been discovered with global configuration during investigation. Qi Xuan decided to verify 1915704 and open this one to track the real bug.

Comment 3 Maya Rashish 2021-03-14 16:08:48 UTC
I changed it to ON_QA assuming that the linked PR (now merged) fixes the bug, please let me know if that's wrong.

Comment 4 Qixuan Wang 2021-03-18 08:38:04 UTC
Tested with Containerized Data Importer v1.28.3-9-g1f74571, the bug has been fixed. Move it to VERIFIED, thanks.


Here is the test record.
[cnv-qe-jenkins@stg11-gcp6c-executor ~]$ oc logs -f importer-my-dv-rbd
I0318 08:25:07.239470       1 importer.go:52] Starting importer
I0318 08:25:07.239609       1 importer.go:134] begin import process
I0318 08:25:07.251269       1 data-processor.go:345] Calculating available size
I0318 08:25:07.251330       1 data-processor.go:357] Checking out file system volume size.
I0318 08:25:07.251344       1 data-processor.go:365] Request image size not empty.
I0318 08:25:07.251358       1 data-processor.go:370] Target size 5179580416.
I0318 08:25:07.251530       1 util.go:37] deleting file: /data/lost+found
I0318 08:25:07.253204       1 data-processor.go:239] New phase: Convert
I0318 08:25:07.253227       1 data-processor.go:245] Validating image
I0318 08:25:07.428231       1 qemu.go:127] Added preallocation
I0318 08:25:07.435039       1 qemu.go:224] 0.00
I0318 08:25:09.975036       1 qemu.go:224] 1.00
I0318 08:25:12.621699       1 qemu.go:224] 2.00
I0318 08:25:15.269274       1 qemu.go:224] 3.01
I0318 08:25:18.192360       1 qemu.go:224] 4.01
[...]
I0318 08:29:38.005117       1 qemu.go:224] 97.50
I0318 08:29:42.047971       1 qemu.go:224] 98.50
I0318 08:29:44.883173       1 qemu.go:224] 99.50
I0318 08:29:46.693848       1 data-processor.go:239] New phase: Resize
W0318 08:29:46.719944       1 data-processor.go:331] Available space less than requested size, resizing image to available space 4894703104.
I0318 08:29:46.719972       1 data-processor.go:337] Expanding image size to: 4894703104
I0318 08:29:46.744381       1 data-processor.go:239] New phase: Preallocate
I0318 08:29:46.744425       1 qemu.go:105] Added preallocation
I0318 08:29:46.837427       1 data-processor.go:239] New phase: Complete
I0318 08:29:46.837540       1 importer.go:212] Import Complete, Preallocation applied


[cnv-qe-jenkins@stg11-gcp6c-executor ~]$ oc get pvc my-dv-rbd -o yaml | grep pre
    cdi.kubevirt.io/storage.preallocacation.requested: "true"
    cdi.kubevirt.io/storage.preallocation: "true"
          f:cdi.kubevirt.io/storage.preallocacation.requested: {}
          f:cdi.kubevirt.io/storage.preallocation: {}

Comment 9 errata-xmlrpc 2021-04-07 08:46:03 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 (CNV 2.6.1 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/RHEA-2021:1126


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