Bug 2149863

Summary: The version of Win 11/Win 2019/Win 2022 shows incorrect on RHV after virt-v2v conversion
Product: Red Hat Enterprise Linux 9 Reporter: tingting zheng <tzheng>
Component: virt-v2vAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Vera <vwu>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.2CC: ahadas, chhu, hongzliu, juzhou, lersek, mxie, nsoffer, rjones, tgolembi, tyan, tzheng, vwu, xiaodwan
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-v2v-2.2.0-5.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:45:47 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:
Bug Depends On: 2012658    
Bug Blocks:    

Description tingting zheng 2022-12-01 08:45:06 UTC
Description of problem:
The version of Win 11/Win 2019/Win 2022 shows incorrect on RHV after virt-v2v conversion

Version-Release number of selected component (if applicable):
virt-v2v-2.0.7-6.el9.x86_64
virtio-win-1.9.30-0.el9_1.noarch
qemu-kvm-7.1.0-5.el9.x86_64
libguestfs-winsupport-9.2-1.el9.x86_64
libvirt-8.9.0-2.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Use virt-v2v to convert Win 11/Win 2019/Win 2022 to RHV.

2.After conversion, check the guest info from RHV GUI, the guest version shows incorrect,eg:Win 2022 shows as Win 2016 on RHV GUI.

3.Check the ovf file, it shows the wrong windows version:

<Info>Windows Server 2022 Standard</Info>
<Description>windows_2016x64</Description>


Actual results:
As described.

Expected results:
The version of Win 11/Win 2019/Win 2022 shows correct on RHV after virt-v2v conversion

Additional info:

Comment 2 Richard W.M. Jones 2022-12-01 11:15:01 UTC
Posted:
https://listman.redhat.com/archives/libguestfs/2022-December/030364.html

Comment 4 Vera 2022-12-07 06:24:14 UTC
Tried with the versions:
libguestfs-1.48.4-4.el9.x86_64
osinfo-db-20221130-1.el9.noarch
libosinfo-1.10.0-1.el9.x86_64
virt-v2v-2.0.7-7.el9.x86_64

Steps to Reproduce:
1.Use virt-v2v to convert Win 11/Win 2019/Win 2022 to RHV with -o rhv-upload.

2.After conversion, check the guest info from RHV GUI, the guest version shows incorrect;

For win2019: Windows 2016 x64
For win2022: Windows 2016 x64
For win11: Windows 10 x64

3.Check the log file,only win11 shows incorrect info.
      <Info>Windows Server 2019 Standard</Info>
     <Description>windows_2019x64</Description>

      <Info>Windows Server 2022 Standard</Info>
     <Description>windows_2022</Description>

      <Info>Windows 10 Enterprise</Info>
    <Description>windows_11</Description>

Please check the attachments on the screenshots and -vx debug log.

Comment 9 Richard W.M. Jones 2022-12-07 09:38:44 UTC
>       <Info>Windows 10 Enterprise</Info>
>     <Description>windows_11</Description>

Hi Vera, this is actually correct.  Microsoft put "Windows 10 ..."
in the product name field of Windows 11.  We don't know why, but
we have to assume they know what they are doing.

The <Description> field is important however.  It must be
windows_11 (as here, so correct), not anything else.  This
is because RHV uses this field to tune the VM drivers /
virtual hardware.

Comment 10 Vera 2022-12-08 10:18:28 UTC
(In reply to Richard W.M. Jones from comment #9)
> >       <Info>Windows 10 Enterprise</Info>
> >     <Description>windows_11</Description>
> 
> Hi Vera, this is actually correct.  Microsoft put "Windows 10 ..."
> in the product name field of Windows 11.  We don't know why, but
> we have to assume they know what they are doing.
> 
> The <Description> field is important however.  It must be
> windows_11 (as here, so correct), not anything else.  This
> is because RHV uses this field to tune the VM drivers /
> virtual hardware.

Hi rjones,

Can you help to confirm? 

As saying above, for all these 3 guests, the <Description> shows correct version. 
V2V has no bugs on this showing issue. Even on the step2, the versions are not correct on the GUI:
>>
2.After conversion, check the guest info from RHV GUI, the guest version shows incorrect;

For win2019: Windows 2016 x64
For win2022: Windows 2016 x64
For win11: Windows 10 x64
>>

The incorrect version is the bug of RHV. Is it right?

Comment 11 Richard W.M. Jones 2022-12-08 10:33:56 UTC
Yes I think this may be a bug in RHV (or maybe not).  But we are
passing the correct <Description> field to RHV as far as I know.
You might want to ask nsoffer or tgolembi for confirmation.

Comment 12 Vera 2022-12-08 11:35:32 UTC
(In reply to Richard W.M. Jones from comment #11)
> Yes I think this may be a bug in RHV (or maybe not).  But we are
> passing the correct <Description> field to RHV as far as I know.
> You might want to ask nsoffer or tgolembi for confirmation.

Thanks rjones.

@nsoffer @tgolembi  could you help to confirm this issue? Thanks.

Comment 13 Nir Soffer 2022-12-08 21:40:26 UTC
I think @ahadas can help with this.

Comment 14 Arik 2022-12-11 11:39:30 UTC
(In reply to Richard W.M. Jones from comment #9)
> >       <Info>Windows 10 Enterprise</Info>
> >     <Description>windows_11</Description>
> 
> Hi Vera, this is actually correct.  Microsoft put "Windows 10 ..."
> in the product name field of Windows 11.  We don't know why, but
> we have to assume they know what they are doing.
> 
> The <Description> field is important however.  It must be
> windows_11 (as here, so correct), not anything else.  This
> is because RHV uses this field to tune the VM drivers /
> virtual hardware.

That's how RHV used to determine the operating system type but since virt-v2v switched to provide the OVF as an OVA configuration [1], it's no longer the case - RHV doesn't process the Description tag but rather checks the ovirt:id attribute of the OperatingSystemSection tag and falls back to checking the ovf:id attribute if ovirt:id doesn't exist [2].

I see that in both cases of windows 2019 and 2022, ovirt:id is set to 29 which represents Windows2016x64, the values should be 31 and 37, respectively

[1] https://github.com/libguestfs/virt-v2v/blob/v2.1.11/output/rhv-upload-createvm.py#L119
[2] https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-4.5.4/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfOvaReader.java#L73-L85

Comment 15 Richard W.M. Jones 2022-12-11 12:15:10 UTC
Thanks Arik.  Vera can you open a new bug against virt-v2v and I'll
get that fixed as well (but not until January unless Laszlo can look
at it).

Comment 16 Vera 2022-12-12 03:58:40 UTC
(In reply to Richard W.M. Jones from comment #15)
> Thanks Arik.  Vera can you open a new bug against virt-v2v and I'll
> get that fixed as well (but not until January unless Laszlo can look
> at it).

File a new bug against this issue.

Bug 2152465 - v2v should set ovirt:id correctly after coverting windows11/2019/2022 guests to rhv via -o rhv-upload

Comment 20 Vera 2022-12-29 10:55:20 UTC
For the comments above, moving to Verified status and track the rhv issue on bz2152465.

Comment 23 errata-xmlrpc 2023-05-09 07:45:47 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 (virt-v2v 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/RHBA-2023:2313