Bug 2089391

Summary: Import gzipped raw file causes image to be downloaded and uncompressed to TMPDIR
Product: Container Native Virtualization (CNV) Reporter: Michael Henriksen <mhenriks>
Component: StorageAssignee: Michael Henriksen <mhenriks>
Status: CLOSED ERRATA QA Contact: Fuhui Yang <fuyang>
Severity: high Docs Contact:
Priority: high    
Version: 4.10.0CC: alitke, cnv-qe-bugs, ngavrilo, yadu
Target Milestone: ---   
Target Release: 4.11.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.11.1-20 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-01 21:10:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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