RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2070186 - fix virtio-vsock check (for Linux guests) in virt-v2v
Summary: fix virtio-vsock check (for Linux guests) in virt-v2v
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virt-v2v
Version: 9.1
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: mxie@redhat.com
URL:
Whiteboard:
Depends On: 2059287
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-30 14:59 UTC by mxie@redhat.com
Modified: 2022-11-15 10:23 UTC (History)
10 users (show)

Fixed In Version: virt-v2v-2.0.2-1.el9
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 09:56:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-117353 0 None None None 2022-03-30 15:07:04 UTC
Red Hat Product Errata RHSA-2022:7968 0 None None None 2022-11-15 09:56:20 UTC

Description mxie@redhat.com 2022-03-30 14:59:35 UTC
Description of problem:
[RFE]Support virtio-vsock in virt-v2v

Version-Release number of selected component (if applicable):
virt-v2v-2.0.1-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Found new feature 'Virt-v2v now generates a virtio-vsock device for guests which support it' is added in https://libguestfs.org/virt-v2v-release-notes-2.0.1.html, and v2v has added below codes

# cat create_libvirt_xml.ml |grep vsock -B 1
  if guestcaps.gcaps_virtio_socket then
    List.push_back devices (e "vsock" ["model", virtio_model] []);

# cat output_qemu.ml |grep vsock -B 1
    if guestcaps.gcaps_virtio_socket then
      arg "-device" "vhost-vsock-pci";

2. Convert a linux guest from VMware to local libvirt
#  virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -ip /home/passwd  esx7.0-rhel9.0-snapshot --mac 00:50:56:83:86:fb:network:default

3.But there is no vsock device after v2v conversion
# virsh dumpxml esx7.0-rhel9.0-snapshot |grep vsock
nothing

4.Add virtio-vsock device to guest manually, guest can boot into OS normally and
# virsh dumpxml esx7.0-rhel9.0-snapshot |grep vsock  -A 1
    <vsock model='virtio'>
      <cid auto='yes' address='4'/>
      <alias name='vsock0'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </vsock>
  </devices>

5.Check guest, found virtio-vsock driver is loaded in guest automatically

# lspci |grep socket
07:00.0 Communication controller: Red Hat, Inc. Virtio socket (rev 01)

Actual results:
As above description

Expected results:
As above description


Additional info:

Comment 1 Laszlo Ersek 2022-03-31 10:58:13 UTC
[v2v PATCH] convert/linux_kernels: fix virtio-socket check
Message-Id: <20220331105739.10682-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-March/028512.html

Comment 2 Laszlo Ersek 2022-03-31 11:01:44 UTC
... for Windows guests, the downstream virtio-win package should be modified; the osinfo-db extensions it installs should advertize the driver for virtio-socket.

Comment 3 Laszlo Ersek 2022-04-01 10:32:56 UTC
(In reply to Laszlo Ersek from comment #1)
> [v2v PATCH] convert/linux_kernels: fix virtio-socket check
> Message-Id: <20220331105739.10682-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-March/028512.html

Upstream commit 482e74bb56a6.

Comment 6 mxie@redhat.com 2022-04-12 12:40:07 UTC
Verify the bug with below builds:
virt-v2v-2.0.2-1.el9.x86_64
libguestfs-1.48.0-2.el9.x86_64
guestfs-tools-1.48.0-1.el9.x86_64
libvirt-libs-8.2.0-1.el9.x86_64
qemu-img-6.2.0-12.el9.x86_64
nbdkit-server-1.30.2-1.el9.x86_64
libnbd-1.12.2-1.el9.x86_64


Steps:
1. Convert a rhel9 guest from VMware to local libvirt
# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -ip /home/passwd  esx7.0-rhel9.0-x86_64
[   0.0] Setting up the source: -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk esx7.0-rhel9.0-x86_64
[   2.0] Opening the source
[   7.4] Inspecting the source
[  12.9] Checking for sufficient free disk space in the guest
[  12.9] Converting Red Hat Enterprise Linux 9.0 Beta (Plow) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 115.0] Mapping filesystem data to avoid copying unused and blank areas
[ 115.9] Closing the overlay
[ 116.2] Assigning disks to buses
[ 116.2] Checking if the guest needs BIOS or UEFI to boot
[ 116.2] Setting up the destination: -o libvirt
[ 119.3] Copying disk 1/1
█ 100% [****************************************]
[ 230.6] Creating output metadata
[ 230.7] Finishing off

2.Check the guest after v2v conversion

2.1 Check guest libvirtxml about vsock
# virsh dumpxml esx7.0-rhel9.0-x86_64  |grep vsock -A 2
    <vsock model='virtio'>
      <cid auto='yes'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </vsock>
  </devices>
</domain>

2.2 Power on guest, guest can boot into OS normally and virtio socket driver is loaded automatically
# lspci |grep sock
07:00.0 Communication controller: Red Hat, Inc. Virtio socket (rev 01)

3. Convert a rhel8 guest from VMware to rhv by v2v
#  virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA   -o rhv-upload -of qcow2 -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api  -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt esx6.7-rhel8.5-x86_64 -ip /home/passwd 
[   0.0] Setting up the source: -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk esx6.7-rhel8.5-x86_64
[   2.1] Opening the source
[   7.8] Inspecting the source
[  17.9] Checking for sufficient free disk space in the guest
[  17.9] Converting Red Hat Enterprise Linux 8.5 (Ootpa) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 124.0] Mapping filesystem data to avoid copying unused and blank areas
[ 125.0] Closing the overlay
[ 125.3] Assigning disks to buses
[ 125.3] Checking if the guest needs BIOS or UEFI to boot
[ 125.3] Setting up the destination: -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data
[ 145.9] Copying disk 1/1
█ 100% [****************************************]
[ 520.9] Creating output metadata
[ 532.6] Finishing off

4. Check the guest after v2v conversion

4.1 Check guest libvirtxml about vsock on rhv node, but there is no vsock device in guest xml

5.Convert a rhel7 guest to openstack by v2v
# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -o openstack -oo server-id=v2v-appliance -ip /home/passwd  esx7.0-rhel7.9-x86_64
[   0.0] Setting up the source: -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk esx7.0-rhel7.9-x86_64
[   3.8] Opening the source
[  16.4] Inspecting the source
[  31.2] Checking for sufficient free disk space in the guest
[  31.2] Converting Red Hat Enterprise Linux Server 7.9 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 277.6] Mapping filesystem data to avoid copying unused and blank areas
[ 279.3] Closing the overlay
[ 279.7] Assigning disks to buses
[ 279.7] Checking if the guest needs BIOS or UEFI to boot
[ 279.7] Setting up the destination: -o openstack -oo server-id=v2v-appliance
Failed to set volume read-only access mode flag: Invalid volume: Volume 4b7423df-4c6a-4c2c-a735-a4eeb068235b status must be available to update readonly flag, but current status is: creating. (HTTP 400) (Request-ID: req-893ddc5c-1f48-4f30-8bbe-2fa3bb38333d)
[ 301.1] Copying disk 1/1
█ 100% [****************************************]
[ 559.1] Creating output metadata
[ 565.2] Finishing off

5. Launch the volume as instance after v2v conversion and check the instance 

5.1 Check guest libvirtxml about vsock on OSP compute node, but there is no vsock device in guest xml
# virsh dumpxml instance-0000000b |grep vsock
nothing


Hi Laszlo,
    virtio-vsock device will be added to linux guest only when target is local libvirt, is it expected?

Comment 7 mxie@redhat.com 2022-04-12 12:42:36 UTC
(In reply to Laszlo Ersek from comment #2)
> ... for Windows guests, the downstream virtio-win package should be
> modified; the osinfo-db extensions it installs should advertize the driver
> for virtio-socket.

Filed bug2074536 to track this problem, thanks@

Comment 8 Laszlo Ersek 2022-04-12 14:24:26 UTC
Hi mxie, virtio-socket support is currently only mapped to the libvirt and QEMU cmdline outputs. (The JSON output used to capture virtio-socket as well, but Rich recently removed the JSON output upstream altogether -- commit 4e6b389b4e27.) As far as I can tell, the RHV* / Openstack outputs have never been extened with virtio-socket.

It even looks like these destination hypervisors don't support virtio-socket at all:

- Regarding Openstack, the documentation at <https://docs.openstack.org/glance/latest/admin/useful-image-properties.html> does not speak about virtio-socket, and the source file "nova/objects/image_meta.py" in the openstack-nova component, with master @ 449aa39a964b also does not about "socket" in this context.

- Regarding ovirt-engine -- I've looked for long, but I can't find any trace of vsock / virtio-socket support in it (in particular there seems to be no way to express it in the OVF). All "socket" occurrences relate to CPU topology.

Comment 9 mxie@redhat.com 2022-04-13 11:02:24 UTC
Thanks Laszlo, continue to verify the other linux guests with below builds:
virt-v2v-2.0.3-1.el9.x86_64
libguestfs-1.48.0-2.el9.x86_64
guestfs-tools-1.48.0-1.el9.x86_64
libvirt-libs-8.2.0-1.el9.x86_64
qemu-img-6.2.0-12.el9.x86_64
nbdkit-server-1.30.2-1.el9.x86_64
libnbd-1.12.2-1.el9.x86_64


Steps:
1.Convert a ubuntu guest from VMware to local libvirt by v2v
1.1 #  virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 esx7.0-ubuntu20.04.2-x86_64-uefi  -ip /home/passwd   

1.2 Check vsock device in guest libvirtxml
# virsh dumpxml esx7.0-ubuntu20.04.2-x86_64-uefi |grep vsock -A 2
    <vsock model='virtio'>
      <cid auto='yes'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </vsock>
  </devices>
</domain>

1.3 Power on guest and check if virtio socket driver is installed 
# lspci |grep sock
06:00.0 Communication controller: Red Hat, Inc. Device 1053 (rev 01)

2.Convert a debian guest from VMware to local libvirt by v2v
2.1 # virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  esx6.7-debian10.1.0-i386 -ip /home/passwd 

2.2 Check vsock device in guest libvirtxml
# virsh dumpxml esx6.7-debian10.1.0-i386 |grep vsock -A 2
    <vsock model='virtio'>
      <cid auto='yes'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </vsock>
  </devices>
</domain>

2.3 Power on guest and check if virtio socket driver is installed 
# lspci |grep sock
06:00.0 Communication controller: Red Hat, Inc. Device 1053 (rev 01)

3.Convert opensuse guests rom VMware to local libvirt by v2v

3.1 Convert a opensuse42.3 from VMware to local libvirt by v2v

# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 esx7.0-opensuse42.3-x86_64 -ip /home/passwd 

# virsh dumpxml esx7.0-opensuse42.3-x86_64 |grep vsock
nothing

3.2 Convert a opensuse15.2 from VMware to local libvirt by v2v
# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 esx7.0-opensuse15.2-x86_64 -ip /home/passwd   

# virsh dumpxml esx7.0-opensuse15.2-x86_64 |grep vsock -A 2
    <vsock model='virtio'>
      <cid auto='yes'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </vsock>
  </devices>
</domain>

4.Convert a SLES guest from VMware to local libvirt by v2v
4.1 # virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 esx7.0-sles15sp2-x86_64 -ip /home/passwd

4.2 Check vsock device in guest libvirtxml
# virsh dumpxml esx7.0-sles15sp2-x86_64 |grep vsock -A 2
    <vsock model='virtio'>
      <cid auto='yes'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </vsock>
  </devices>
</domain>

4.3 Power on guest and check if virtio socket driver is installed 
# lspci |grep sock
06:00.0 Communication controller: Red Hat, Inc. Device 1053 (rev 01)


Hi Laszlo,

   Please check step3.1, there is no vsock device after converting opensuse42.3 to local libvirt, details please refer to log'v2v-convert-opensuse42.3-to-libvirt'

Comment 11 Laszlo Ersek 2022-04-13 11:49:47 UTC
Hi mxie, this result seems consistent with the log you attached; it's just the case, as far as I can tell, that opensuse 42.3 does not enable support for virtio-socket. According to the log, CONFIG_VIRTIO_VSOCKETS is checked, but not found, in the kernel config, by virt-v2v; furthermore, the "vmw_vsock_virtio_transport" kernel module is not found either. Interestingly, the following modules *are* present in the guest:

"/lib/modules/4.4.76-1-default/kernel/net/vmw_vsock",
"/lib/modules/4.4.76-1-default/kernel/net/vmw_vsock/vmw_vsock_vmci_transport.ko",
"/lib/modules/4.4.76-1-default/kernel/net/vmw_vsock/vsock.ko",

however, "vmw_vsock_vmci_transport" enables vsock only on VMWare, and not on KVM! (It corresponds to the CONFIG_VMWARE_VMCI_VSOCKETS option.)

So, the results are correct. In fact, you just ended up verifying that looking specifically for the *virtio transport* for vsock is the right thing for virt-v2v to do! Thanks!

Comment 12 mxie@redhat.com 2022-04-14 07:03:39 UTC
Thanks Laszlo, move the bug from ON_QA to VERIFIED according to comment6 ~ comment11

Comment 14 errata-xmlrpc 2022-11-15 09:56:05 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 (Low: virt-v2v security, bug fix, and enhancement 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:7968


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