Bug 2068905 - virtctl guestfs incorrectly assumes image name
Summary: virtctl guestfs incorrectly assumes image name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.9.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.9.5
Assignee: Alex Kalenyuk
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks: 2083594
TreeView+ depends on / blocked
 
Reported: 2022-03-27 12:16 UTC by Alex Kalenyuk
Modified: 2022-06-28 16:30 UTC (History)
6 users (show)

Fixed In Version: kubevirt-virtctl-4.9.5-341, CNV v4.9.5-24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2083594 (view as bug list)
Environment:
Last Closed: 2022-06-28 16:30:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 7592 0 None Merged Handle virtctl guestfs incorrectly assuming image name, grant access to /guestfs endpoint 2022-05-12 18:56:33 UTC
Github kubevirt kubevirt pull 7719 0 None open [release-0.44] Manual backport of 7592 2022-05-12 18:57:13 UTC
Red Hat Product Errata RHEA-2022:5389 0 None None None 2022-06-28 16:30:54 UTC

Description Alex Kalenyuk 2022-03-27 12:16:27 UTC
Description of problem:
virtctl guestfs makes wrong assumption about image name and thus fails to assemble the correct guestfs pod image URL

Version-Release number of selected component (if applicable):
CNV v4.9.4

How reproducible:
100%

Steps to Reproduce:
1. Create DV
2. Attempt to create guestfs pod (`virtctl guestfs simple-dv`)

Actual results:
ErrImagePull

Expected results:
Success

Additional info:
It appears we make a wrong assumption about the image name being "libguestfs-tools" in:
https://github.com/kubevirt/kubevirt/blob/main/pkg/virtctl/guestfs/guestfs.go#L197

This results in an attempt to create a pod from a wrong URL

cnv-qe-jenkins@cnv-qe-infra-01:~/alex$ virtctl guestfs simple-dv
Use image: quay.io/openshift-cnv/libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae

while the correct URL is

cnv-qe-jenkins@cnv-qe-infra-01:~/alex$ oc get csv -n openshift-cnv -o yaml | grep guestfs
    - image: quay.io/openshift-cnv/container-native-virtualization-libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae

Manifests:
cnv-qe-jenkins@cnv-qe-infra-01:~/alex$ cat guestfs_dv.yaml 
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: simple-dv
spec:
  source:
      http:
         url: "http://.../Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
  pvc:
    storageClassName: ocs-storagecluster-ceph-rbd
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 8Gi

cnv-qe-jenkins@cnv-qe-infra-01:~/alex$ virtctl guestfs simple-dv
Use image: quay.io/openshift-cnv/libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae 
The PVC has been mounted at /disk 
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
Waiting for container libguestfs still in pending, reason: ImagePullBackOff, message: Back-off pulling image "quay.io/openshift-cnv/libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae" 
Waiting for container libguestfs still in pending, reason: ImagePullBackOff, message: Back-off pulling image "quay.io/openshift-cnv/libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae" 
Waiting for container libguestfs still in pending, reason: ImagePullBackOff, message: Back-off pulling image "quay.io/openshift-cnv/libguestfs-tools@sha256:591e6d1e817bbd42b80f24b1ff9863533acc00fa6032c8abcbc38b9bb9e964ae"

Comment 3 Gal Ben Haim 2022-03-28 12:18:10 UTC
Just a note, it may also affect a disconnected install.

Comment 6 Kevin Alon Goldblatt 2022-05-23 16:23:47 UTC
Verified with the following code:
--------------------------------------------
oc version
Client Version: 4.10.0-202201310820.p0.g7c299f1.assembly.stream-7c299f1
Server Version: 4.9.32
Kubernetes Version: v1.22.8+c02bd9d


oc get csv -n openshift-cnv
NAME                                        DISPLAY                    VERSION    REPLACES                                    PHASE
kubevirt-hyperconverged-operator.4.9.5-29   OpenShift Virtualization   4.9.5-29   kubevirt-hyperconverged-operator.4.9.5-23   Succeeded


Verified with the following scenario:
--------------------------------------------
1. Created a datavolume dv-source
2. Ran 'virtctl guestfs dv-source >>>>>
virtctl guestfs dv-source
Use image: quay.io/openshift-cnv/container-native-virtualization-libguestfs-tools@sha256:8358df78d53bcc4679de886723f43eccaf96ddd842920842172dc2f649a73937 
The PVC has been mounted at /disk 
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
Waiting for container libguestfs still in pending, reason: ContainerCreating, message:  
If you don't see a command prompt, try pressing enter.+ /bin/bash
[root@libguestfs-tools-dv-source disk]# lib
libguestfs-test-tool  libvirtd              
[root@libguestfs-tools-dv-source disk]# lib
libguestfs-test-tool  libvirtd


Moving to VERIFIED!

Comment 12 errata-xmlrpc 2022-06-28 16:30:39 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 (OpenShift Virtualization 4.9.5 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-2022:5389


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