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 2043333 - 'model='virtio-transitional' is wrongly added when converting windows guest to local by rhel9 v2v
Summary: 'model='virtio-transitional' is wrongly added when converting windows guest t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virt-v2v
Version: 9.0
Hardware: x86_64
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: mxie@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-21 03:03 UTC by mxie@redhat.com
Modified: 2022-05-17 13:43 UTC (History)
12 users (show)

Fixed In Version: virt-v2v-1.45.97-4.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 13:42:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1054905 1 unspecified CLOSED Add data on WHQL drivers 2022-08-11 05:48:02 UTC
Red Hat Bugzilla 1793925 1 None None None 2022-01-26 14:40:32 UTC
Red Hat Bugzilla 1942325 1 None None None 2023-09-09 08:55:43 UTC
Red Hat Issue Tracker RHELPLAN-109041 0 None None None 2022-01-21 03:10:39 UTC
Red Hat Product Errata RHEA-2022:2566 0 None None None 2022-05-17 13:42:19 UTC

Description mxie@redhat.com 2022-01-21 03:03:28 UTC
Description of problem:
'model='virtio-transitional' is wrongly added when converting windows guest to local by rhel9 v2v

Version-Release number of selected component (if applicable):
libosinfo-1.9.0-4.el9.x86_64
osinfo-db-20211216-1.el9.noarch
virt-v2v-1.45.97-1.el9.x86_64
libguestfs-1.46.1-2.el9.x86_64
guestfs-tools-1.46.1-6.el9.x86_64
libvirt-libs-8.0.0-1.el9.x86_64
qemu-img-6.2.0-4.el9.x86_64
virtio-win-1.9.19-5.el9_b.noarch


How reproducible:
100%

Steps to Reproduce:
1. Convet a windows guest 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.2 -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-win10-x86_64 -v -x |& tee > convert-windows-guest-to-local.log
█ 100% [****************************************]

2.Check guest libvirtxml after v2v conversion
#  virsh dumpxml esx7.0-win10-x86_64 |grep 'virtio-transitional'
    <disk type='volume' device='disk' model='virtio-transitional'>
      <model type='virtio-transitional'/>
    <memballoon model='virtio-transitional'>
    <rng model='virtio-transitional'>

Actual results:
As description

Expected results:
'model='virtio-transitional' won't be added when converting windows guest to local by rhel9 v2v

Additional info:
Can't reproduce on rhel8.6
# rpm -q libosinfo osinfo-db virt-v2v virtio-win
libosinfo-1.9.0-1.el8.x86_64
osinfo-db-20210903-1.el8.noarch
virt-v2v-1.42.0-18.module+el8.6.0+13447+4b5d0856.x86_64
virtio-win-1.9.22-2.el8_5.noarch

# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.2 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  -ip /home/passwd   esx6.7-win2022-x86_64

# virsh dumpxml esx6.7-win2022-x86_64 |grep  'virtio-transitional'
nothing

Comment 2 Laszlo Ersek 2022-01-21 15:38:58 UTC
Hi Rich,

I've determined that virtio-1.0 support level is impossible to *determine* for Windows guests.

I've spent today developing the following patch set:

     1  fa8bf7a05d72 convert/libosinfo: factor out v2v_osinfo_device_list_to_value_list()
     2  83e87ad7d3df convert/libosinfo: retrieve device list for OsinfoDeviceDriver
     3  fce3e8acc845 convert/libosinfo_utils: debug-log the devices supported by a driver
     4  07e2eb8f4f6a convert/libosinfo_utils: extract "best_driver" from "windows_virtio.ml"
     5  2f76a80b8100 convert/convert_windows: consult "best driver"'s dev list for virtio-1.0

(The purpose of this patch set would have been to reclassify the present BZ as a virt-v2v regression, from bug 1942325, and to solve the issue without touching osinfo-db.)

The first two patches extend the "osinfo_device_driver" type with the following field:

  devices : osinfo_device list

This provides the list of devices (in the usual, known format) that the driver supports.

Patch#3 is just for helping bug analysis -- it makes the debug log more verbose.

Patch#4 extracts the "best_driver" function from "copy_from_libosinfo" [convert/windows_virtio.ml]. Again, just refactoring. Here's the signature:

+val best_driver : Libosinfo.osinfo_device_driver list ->
+                  string ->
+                  Libosinfo.osinfo_device_driver
+(** [best_driver drivers arch] picks the best driver from [drivers] as follows:
+    - filters out drivers that:
+      - target a different architecture,
+      - are not pre-installable,
+      - have an invalid URL, or a non-local location;
+    - sorts the remaining drivers by priority, like libosinfo does;
+    - picks the top driver of the sorted list.
+    Raises Not_found if no driver in [drivers] survives filtering. *)

Patch#5 reworks "convert" in "convert/convert_windows.ml" as follows:
(a) don't just fetch the device list for the OS, but also fetch the driver list
(b) from the driver list, pick the "best driver", according to the above definition
(c) from the "best driver", grab the devices supported by that driver
(d) concatenate the device list from the "OS level" with the device list from the "best driver" (c), and pass this larger list to "os_support_of_osinfo_device_list", which determines Q35 and virtio-1.0 support.

Here's the shocking news (well, shocking to me). Even *before* my patch set, the *original* "copy_from_libosinfo" function does exactly nothing, because *no driver* from libosinfo survives the filtering. All drivers are removed by the criterion that says that the location (scheme) of the driver must be "file://". There is no such driver returned by libosinfo: all drivers are in the "https://" scheme (namely "https://fedorapeople.org/groups/virt/unattended/...").

Therefore, the actual virtio driver copying is performed by "copy_from_virtio_win".

Unfortunately, there is no information there that I could extract, and reuse, for determining virtio-1.0 support.

Corollary: it is impossible to determine virtio-1.0 support for Windows guests, given the current information present in the virtio-win ISO, *and* in osinfo-db. (I can't rely on any *driver-level* osinfo-db information for determining virtio-1.0 support if we then install *different* driver files from the virtio-win ISO.)

So, what I'm going to do is: submit a simple patch that simply assumes "true" for virtio-1.0 support, when a Windows guest is being converted. This field in gcaps is (intentionally) documented as follows:

  gcaps_virtio_1_0 : bool;
  (** The guest supports the virtio devices that it does at the virtio-1.0
      protocol level. *)

In other words, the field in itself does not say anything about virtio devices; it only has a meaning *IF* some other virtio-related gcaps field is "true" (such as gcaps_virtio_rng). THEN it means "yes, the OS can drive this virtio device even at the 1.0 protocol level". So, for Windows, we'll just assume that, IF we find drivers (on the virtio-win ISO) for a particular virtio device, THEN that driver is virtio-1.0 compatible.

diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml
index 1c2d17f26543..5e2b8ad58b6a 100644
--- a/convert/convert_windows.ml
+++ b/convert/convert_windows.ml
@@ -248,7 +248,7 @@ let convert (g : G.guestfs) _ inspect _ static_ips =
              (Libosinfo_utils.string_of_osinfo_device_list devices);
            let { Libosinfo_utils.q35; vio10 } =
              Libosinfo_utils.os_support_of_osinfo_device_list devices in
-           (if q35 then Q35 else I440FX), vio10
+           (if q35 then Q35 else I440FX), (vio10 || true) (* RHBZ#2043333 *)
          with
          | Not_found ->
            (* Pivot on the year 2007.  Any Windows version from earlier than

... At this point, we could even remove "copy_from_libosinfo" altogether. :/

Comment 3 Richard W.M. Jones 2022-01-25 08:55:02 UTC
> Even *before* my patch set,
> the *original* "copy_from_libosinfo" function does exactly nothing, because *no
> driver* from libosinfo survives the filtering. All drivers are removed by the
> criterion that says that the location (scheme) of the driver must be "file://".

I'm in favour of just removing code that cannot do anything, and this
may be a case of that.  However the code was added by Pino for some
reason, so I wonder why.  The conversation upstream doesn't give much
hint (https://listman.redhat.com/archives/libguestfs/2020-January/thread.html)
Maybe it's possible to customize the osinfo db with local drivers?  Is
there an updated osinfo-db on the virtio-win disk?  ... Actually - yes
there is, see /usr/share/osinfo/os/microsoft.com/win-10.d/virtio-win-pre-installable-drivers-win-10.xml with file:/// URLs in it.  Maybe an extra step is needed
to connect this to the osinfo database?  The local database has some
info about PCI device IDs.

Comment 4 Laszlo Ersek 2022-01-26 11:17:47 UTC
The approach (my patches) described at the top of comment 2 look viable after all, after Pino's explanation. There is namely, apparently, a packaging bug in Fedora's virtio-win: even though the drivers are available on the host filesystem as broken-out files, they are not advertised via /usr/share/osinfo/. The same bug does not seem to affect RHEL. My v2v dev env is Fedora 34, which is why the "best driver" logic in virt-v2v ends up with an empty set. I'll return to my patches. Thanks.

Comment 5 Laszlo Ersek 2022-01-28 16:13:55 UTC
[Libguestfs] [v2v PATCH 0/7] Fix "virtio-transitional" regression for Windows guests
https://listman.redhat.com/archives/libguestfs/2022-January/msg00200.html
Message-Id: <20220128161218.14293-1-lersek>

Comment 6 Laszlo Ersek 2022-01-28 16:34:27 UTC
(In reply to Laszlo Ersek from comment #5)
> [Libguestfs] [v2v PATCH 0/7] Fix "virtio-transitional" regression for Windows guests
> https://listman.redhat.com/archives/libguestfs/2022-January/msg00200.html
> Message-Id: <20220128161218.14293-1-lersek>

Sigh, I put the same bug in patch#7 that I fixed in patch#1. :/ From patch#7, the following hunks must be dropped:

 tests/test-v2v-cdrom.expected  |  2 +-
 tests/test-v2v-floppy.expected |  2 +-
 tests/test-v2v-i-ova.xml       |  8 ++++----

That's because the related test cases all contain

  export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"

and so the "virtio-win-1.9.24-4.el8.noarch.rpm" package I have installed should be *ignored*.

I might have to sink the VIRTIO_WIN env var check in patch#1 into "copy_from_libosinfo", and then carry that check over to "best_driver" in patch #6.

Comment 8 Richard W.M. Jones 2022-01-31 16:17:23 UTC
For the record I ACKed most of the patches and (in a private email)
soft-ACKed the rest, but raised some concerns about whether we should
be using the libosinfo database for this.  However I'll let Laszlo
decide what we do.

Comment 9 Laszlo Ersek 2022-02-01 12:32:56 UTC
[v2v PATCH v2 0/7] Fix "virtio-transitional" regression for Windows guests
Message-Id: <20220201123219.9317-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-February/msg00004.html

Comment 10 Laszlo Ersek 2022-02-01 14:16:02 UTC
(In reply to Laszlo Ersek from comment #9)
> [v2v PATCH v2 0/7] Fix "virtio-transitional" regression for Windows guests
> Message-Id: <20220201123219.9317-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-February/msg00004.html

Merged upstream as commit range 8abc07a8589a..cacedec64072.

Comment 12 Laszlo Ersek 2022-02-02 14:06:41 UTC
Hi Ming Xie,

can you please grant qa_ack+? Thanks!
Laszlo

Comment 13 tingting zheng 2022-02-07 02:18:38 UTC
(In reply to Laszlo Ersek from comment #12)
> Hi Ming Xie,
> 
> can you please grant qa_ack+? Thanks!
> Laszlo

Done.

Comment 17 mxie@redhat.com 2022-02-09 15:25:40 UTC
Verify the bug with below builds:
virt-v2v-1.45.97-4.el9.x86_64
libguestfs-1.46.1-2.el9.x86_64
guestfs-tools-1.46.1-6.el9.x86_64
libvirt-libs-8.0.0-3.el9.x86_64
qemu-img-6.2.0-7.el9.x86_64
nbdkit-1.28.5-1.el9.x86_64
libnbd-1.10.4-1.el9.x86_64


Steps:
1.Convert some windows guests 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.2 -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 $windows_guest

2.Check the libvirtxml of guests after conversion, there is no 'virtio-transitional' in xml
# virsh dumpxml esx7.0-win11-x86_64  |grep 'virtio-transitional'
noting
# virsh dumpxml esx7.0-win2012-x86_64  |grep 'virtio-transitional'
noting
# virsh dumpxml esx7.0-win2012r2-x86_64  |grep 'virtio-transitional'
noting
# virsh dumpxml esx7.0-win8.1-x86_64  |grep 'virtio-transitional'
noting
# virsh dumpxml esx7.0-win2022-x86_64  |grep 'virtio-transitional'
noting
# virsh dumpxml esx7.0-win8.1-i386 |grep 'virtio-transitional'
nothing

3.Check guests, checkpoints of esx7.0-win2022-x86_64, esx7.0-win11-x86_64, esx7.0-win8.1-i386 and esx7.0-win8.1-x86_64 guest are passed, esx7.0-win2012-x86_64 guest has bug1963032, esx7.0-win2012r2-x86_64 has bug1820152

Result:
  The bug has been fixed

Comment 20 mxie@redhat.com 2022-02-11 10:02:32 UTC
Verify the bug with below builds
virt-v2v-1.45.98-1.el9.x86_64
libguestfs-1.46.1-2.el9.x86_64
guestfs-tools-1.46.1-6.el9.x86_64
libvirt-libs-8.0.0-4.el9.x86_64
qemu-img-6.2.0-7.el9.x86_64
virtio-win-1.9.19-5.el9_b.noarch

1.Convert a windows guests from VMware to json format 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.2 -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-win2022-x86_64-uefi -o json -os /home

2.Check if there is 'virtio-transitional' in json file after conversion
#cat /home/esx6.7-win2022-x86_64-uefi.json |grep 'virtio-transitional'
nothing

3.Convert a windows guests from VMware to local libvirt by v2v 
# virt-v2v -i vmx -it ssh ssh://root.196.89/vmfs/volumes/esx6.5-matrix/esx6.5-win11-x86_64/esx6.5-win11-x86_64.vmx -ip /home/esxpw 

4.Check if there is 'virtio-transitional' in guest libvirtxml after conversion
# virsh dumpxml esx6.5-win11-x86_64 |grep  'virtio-transitional'
nothing

Result:
  No problem found, move the bug from ON_QA to VERIFIED

Comment 22 errata-xmlrpc 2022-05-17 13:42:09 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 (new packages: virt-v2v), 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:2566


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