Bug 2089391 - Import gzipped raw file causes image to be downloaded and uncompressed to TMPDIR
Summary: Import gzipped raw file causes image to be downloaded and uncompressed to TMPDIR
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.11.1
Assignee: Michael Henriksen
QA Contact: Fuhui Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-23 14:53 UTC by Michael Henriksen
Modified: 2022-12-01 21:10 UTC (History)
4 users (show)

Fixed In Version: v4.11.1-20
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-01 21:10:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2351 0 None Merged Don't use nbdkit for xz or gz 2022-09-28 11:16:08 UTC
Github kubevirt containerized-data-importer pull 2403 0 None Merged [release-v1.49] Cherry pick 2351 take2 2022-09-20 21:47:47 UTC
Red Hat Issue Tracker CNV-18536 0 None None None 2022-11-01 05:32:51 UTC

Description Michael Henriksen 2022-05-23 14:53:50 UTC
Description of problem:

When importing a gzipped raw image, nbdkid is started with the following args:

I0523 14:20:31.215028       1 nbdkit.go:238] Start nbdkit with: ['--foreground' '--readonly' '--exit-with-parent' '-U' '/var/run/nbdkit.sock' '--pidfile' '/var/run/nbdkit.pid' '--filter=gzip' '-r' 'curl' 'url=http://cdi-file-host.cdi/tinyCore.iso.gz']

The gzip plugin is specified.  Internally, the gzip plugin downloads/uncompresses the target file to a temporary dir when it is initially accessed.  See [1].  Unfortunately, that temp dir is on the container filesystem, not a PVC.  This is obviously problematic for large images.


[1] https://github.com/libguestfs/nbdkit/blob/v1.31.7/filters/gzip/gzip.c#L126-L250


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


How reproducible:  100%


Steps to Reproduce:
1.  make cluster-up cluster-sync


2.  Create this DataVolume

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: dv1
  annotations:
    "cdi.kubevirt.io/storage.pod.retainAfterCompletion": "true"
spec:
  source:
      http:
         url: "http://cdi-file-host.cdi/tinyCore.iso.gz"
  pvc:
    volumeMode: Filesystem
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi

3.  Check pod log to confirm that gzip plugin is used

Actual results:

Image is downloaded/uncompressed to container filesystem


Expected results:

It should be possible for the image to be downloaded/uncompressed directly to the target PVC with no temporary space


Additional info:

Comment 10 errata-xmlrpc 2022-12-01 21:10:21 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.11.1 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:8750


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