Bug 1872094 - Virt-v2v should convert UEFI guest to openstack via openstack option successfully
Summary: Virt-v2v should convert UEFI guest to openstack via openstack option successf...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: virt-v2v
Version: 8.3
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: 8.3
Assignee: Richard W.M. Jones
QA Contact: mxie@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-25 03:58 UTC by mxie@redhat.com
Modified: 2021-05-25 06:43 UTC (History)
9 users (show)

Fixed In Version: virt-v2v-1.42.0-7.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 06:43:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
uefi-guest-to-openstack.log (1.91 MB, text/plain)
2020-08-25 03:58 UTC, mxie@redhat.com
no flags Details

Description mxie@redhat.com 2020-08-25 03:58:37 UTC
Created attachment 1712467 [details]
uefi-guest-to-openstack.log

Description of problem:
Virt-v2v should convert UEFI guest to openstack via openstack option successfully


Version-Release number of selected component (if applicable):
virt-v2v-1.42.0-5.module+el8.3.0+7152+ab3787c3.x86_64
libguestfs-1.42.0-2.module+el8.3.0+6798+ad6e66be.x86_64
libvirt-client-6.6.0-2.module+el8.3.0+7567+dc41c0a9.x86_64
qemu-kvm-5.1.0-3.module+el8.3.0+7708+740a1315.x86_64
python3-openstackclient-4.0.0-0.20200310193636.aa64eb6.el8ost.noarch


How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest which has installed virt-v2v on OSP16.1 environment
(overcloud) [stack@xxxx~]$ openstack server list
+--------------------------------------+-----------------------------+--------+--------------------------------------+------------------+--------+
| ID                                   | Name                        | Status | Networks                             | Image            | Flavor |
+--------------------------------------+-----------------------------+--------+--------------------------------------+------------------+--------+
| 9f868269-c8df-4e61-9095-5b2daef930ec | rhel8.3-v2v-osp16-server    | ACTIVE | private=192.168.0.247, 10.73.xx.xx   | rhel8.3-non-uefi |        |
+--------------------------------------+-----------------------------+--------+--------------------------------------+----------------------------

2.Convert a UEFI guest from VMware to openstack by virt-v2v but conversion is failed 
(overcloud) [root@localhost ~]# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib/ -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-sles15-x86_64-efi  -ip /home/passwd  -o openstack -oo server-id=rhel8.3-v2v-osp16-server 
[   1.8] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-sles15-x86_64-efi -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib/ -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   3.5] Creating an overlay to protect the source from being modified
[   4.5] Opening the overlay
[  14.8] Inspecting the overlay
[  40.3] Checking for sufficient free disk space in the guest
[  40.3] Estimating space required on target for each disk
[  40.3] Converting SUSE Linux Enterprise Server 15 to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 124.0] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda1 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[ 124.9] Closing the overlay
[ 125.3] Assigning disks to buses
[ 125.3] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: error: this guest cannot run on the target, because the target 
does not support uefi firmware (supported firmware on target: bios)

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]




Actual results:
As above description


Expected results:
Because v2v code 'openstack_image_properties.ml' already support UEFI and openstack also supports UEFI, pls see the bottom of this page 'https://docs.openstack.org/glance/pike/admin/troubleshooting.html', v2v should support converting UEFI guest to openstack via openstack option 


Additional info:
1.Virt-v2v can convert UEFI guest to openstack via glance option successfully
#  virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib/ -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-sles15-x86_64-efi  -ip /home/passwd -o glance -of qcow2
[   3.2] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-sles15-x86_64-efi -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib/ -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   5.2] Creating an overlay to protect the source from being modified
[   6.1] Opening the overlay
[  13.2] Inspecting the overlay
[  35.5] Checking for sufficient free disk space in the guest
[  35.5] Estimating space required on target for each disk
[  35.5] Converting SUSE Linux Enterprise Server 15 to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  99.9] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda1 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[ 100.6] Closing the overlay
[ 101.0] Assigning disks to buses
[ 101.0] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[ 101.0] Initializing the target -o glance
[ 101.0] Copying disk 1/1 to /var/tmp/glance.xMPjvL/sda (qcow2)
    (100.00/100%)
[ 559.3] Creating output metadata
+------------------+----------------------------------------------------------------------------------+
| Property         | Value                                                                            |
+------------------+----------------------------------------------------------------------------------+
| architecture     | x86_64                                                                           |
| checksum         | a43a166dbf42c43f083322b56af94d6d                                                 |
| container_format | bare                                                                             |
| created_at       | 2020-08-25T03:30:58Z                                                             |
| direct_url       | swift+config://ref1/glance/9eae4139-22d6-481b-aaea-76cb30d91ab2                  |
| disk_format      | qcow2                                                                            |
| hw_cpu_cores     | 1                                                                                |
| hw_cpu_sockets   | 1                                                                                |
| hw_disk_bus      | virtio                                                                           |
| hw_firmware_type | uefi                                                                             |
| hw_machine_type  | pc                                                                               |
| hw_rng_model     | virtio                                                                           |
| hw_video_model   | qxl                                                                              |
| hw_vif_model     | virtio                                                                           |
| hypervisor_type  | kvm                                                                              |
| id               | 9eae4139-22d6-481b-aaea-76cb30d91ab2                                             |
| min_disk         | 0                                                                                |
| min_ram          | 1024                                                                             |
| name             | esx6.7-sles15-x86_64-efi                                                         |
| os_distro        | sled                                                                             |
| os_hash_algo     | sha512                                                                           |
| os_hash_value    | 7804927e47393dad5dc2e09ac9789ef1ab476aeca6d7df25941c137b2cac7c5ff6961c8b096a7c84 |
|                  | b3567bb8dac1fda916131b34b3400f1d14a4d37bb7c2dc6d                                 |
| os_hidden        | False                                                                            |
| os_type          | linux                                                                            |
| os_version       | 15                                                                               |
| owner            | 3ccefcef669147dcbd6139347a5da986                                                 |
| protected        | False                                                                            |
| size             | 4018143232                                                                       |
| status           | active                                                                           |
| stores           | default_backend                                                                  |
| tags             | []                                                                               |
| updated_at       | 2020-08-25T03:31:57Z                                                             |
| virtual_size     | Not available                                                                    |
| visibility       | shared                                                                           |
| vm_mode          | hvm                                                                              |
+------------------+----------------------------------------------------------------------------------+
[ 621.9] Finishing off

Comment 1 Richard W.M. Jones 2020-08-25 07:25:11 UTC
I posted the trivial/obvious patch:
https://www.redhat.com/archives/libguestfs/2020-August/msg00296.html

I have no way to test this.  I guess we have UEFI guests that we can
try converting to OpenStack to see if this actually works?

Comment 8 mxie@redhat.com 2021-01-18 15:13:10 UTC
Verify the bug with builds:
virt-v2v-1.42.0-7.module+el8.4.0+9398+f376ac33.x86_64
libguestfs-1.44.0-1.module+el8.4.0+9398+f376ac33.x86_64
libvirt-libs-7.0.0-1.module+el8.4.0+9464+3e71831a.x86_64
qemu-kvm-5.2.0-2.module+el8.4.0+9186+ec44380f.x86_64
nbdkit-1.24.0-1.module+el8.4.0+9341+96cf2672.x86_64
python3-openstackclient-4.0.1-2.20201217180131.bff556c.el8ost.1.noarch
RHOS-16.2-RHEL-8-20210113.n.0

Steps:
Scenario1:
1.1 Prepare a guest which has installed virt-v2v on OSP16.1 environment
$ openstack server list
+--------------------------------------+--------------------------+---------+--------------------------------------+--------------------------------------+--------+
| ID                                   | Name                     | Status  | Networks                             | Image                                | Flavor |
+--------------------------------------+--------------------------+---------+--------------------------------------+--------------------------------------+--------+
| bde4cb83-001a-4657-92fd-230788799cb0 | v2v-appliance-latest     | ACTIVE  | private=192.168.0.85, 10.73.224.34   | RHEL-8.4.0-20210107.n.0-x86_64.qcow2 |  


1.2 Convert a UEFI linux guest from VMware to openstack by virt-v2v
(overcloud) [root@localhost ~]# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -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-latest  -ip /home/passwd esx7.0-rhel8.3-x86_64-efi
[   1.6] Opening the source -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 esx7.0-rhel8.3-x86_64-efi -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78
[   3.4] Creating an overlay to protect the source from being modified
[   4.8] Opening the overlay
[  25.2] Inspecting the overlay
[  48.3] Checking for sufficient free disk space in the guest
[  48.3] Estimating space required on target for each disk
[  48.3] Converting Red Hat Enterprise Linux 8.3 Beta (Ootpa) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 159.6] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda1 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[ 160.7] Closing the overlay
[ 161.1] Assigning disks to buses
[ 161.1] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[ 161.1] Initializing the target -o openstack
Failed to set volume read-only access mode flag: Invalid volume: Volume 9d36115e-085a-4f6e-ab11-68413031c2f9 status must be available to update readonly flag, but current status is: creating. (HTTP 400) (Request-ID: req-cc3a3562-62bd-4ec0-b0b4-63f305801fdb)
[ 179.8] Copying disk 1/1 to /dev/disk/by-id/virtio-9d36115e-085a-4f6e-a (raw)
    (100.00/100%)
[ 721.8] Creating output metadata
[ 728.5] Finishing off

1.3 Launch the volume as instance on OSP dashboard after v2v conversion, but found the status of volume is in-use because of bug1917262, so detach the volume from v2v appliance manually, then launch the volume as instance.

1.4 Try to check points for UEFI linux instance, but found instance can't boot into OS because of bug1873374

1.5 Upload the volume to image, edit the metadata of the image to change hw_machine_type from 'pc' to 'pc-q35-rhel8.3.0', then launch the image as instance again, find instance can boot into OS successfully

1.6 Check UEFI linux instance, checkpoints of the instance are passed except existing bug1642021 


Scenario2:
2.1 Convert a UEFI windows guest from VMware to openstack by virt-v2v
#  virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -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-win10-x86_64-efi -o openstack -oo server-id=v2v-appliance-latest
[   1.9] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-win10-x86_64-efi -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   3.8] Creating an overlay to protect the source from being modified
[   4.8] Opening the overlay
[  13.8] Inspecting the overlay
[  25.2] Checking for sufficient free disk space in the guest
[  25.2] Estimating space required on target for each disk
[  25.2] Converting Windows 10 Enterprise to run on KVM
virt-v2v: warning: /usr/share/virt-tools/pnp_wait.exe is missing.  
Firstboot scripts may conflict with PnP.
virt-v2v: warning: there is no QXL driver for this version of Windows (10.0 
x86_64).  virt-v2v looks for this driver in 
/usr/share/virtio-win/virtio-win.iso

The guest will be configured to use a basic VGA display driver.
virt-v2v: This guest has virtio drivers installed.
[  36.9] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda2 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[  38.6] Closing the overlay
[  39.0] Assigning disks to buses
[  39.0] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[  39.0] Initializing the target -o openstack
Failed to set volume read-only access mode flag: Invalid volume: Volume c3916160-9918-4dbb-8291-6b53f76b1f40 status must be available to update readonly flag, but current status is: creating. (HTTP 400) (Request-ID: req-71e087f4-e7ed-42be-a9e3-9545cfaae104)
[  56.9] Copying disk 1/1 to /dev/disk/by-id/virtio-c3916160-9918-4dbb-8 (raw)
    (100.00/100%)
[ 524.5] Creating output metadata
[ 531.3] Finishing off

2.2 Launch the volume as instance on OSP dashboard after v2v conversion, but found the status of volume is in-use because of bug1917262, so detach the volume from v2v appliance manually, then launch the volume as instance.

2.3 Try to check points for UEFI windows instance, but found instance can't boot into OS because of bug1873374

2.4 Upload the volume to image, edit the metadata of the image to change hw_machine_type from 'pc' to 'pc-q35-rhel8.2.0', then launch the image as instance again, find instance can boot into OS successfully

2.5 Check UEFI windows instance, checkpoints of the instance are passed


Result:
     Virt-v2v can convert UEFI guest to OSP via openstack option successfully, but there are some problems with the volume/instance after v2v conversion, already have bug1917262 and bug1873374 to track the problems, so move the bug from ON_QA to VERIFIED

Comment 10 errata-xmlrpc 2021-05-25 06:43:34 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:av 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-2021:2098


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