Bug 2074801

Summary: do not pass "--non-bootable --read-write" to "volume create " in openstack output module
Product: Red Hat Enterprise Linux 9 Reporter: Laszlo Ersek <lersek>
Component: virt-v2vAssignee: Laszlo Ersek <lersek>
Status: CLOSED ERRATA QA Contact: mxie <mxie>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: apevec, jpichon, jsuchane, juzhou, kkiwi, lersek, lhh, mxie, mzhan, nlevinki, ptoscano, ramishra, rhos-maint, rjones, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-v2v-2.0.7-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1685081 Environment:
Last Closed: 2022-11-15 09:56:05 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:

Description Laszlo Ersek 2022-04-13 06:34:57 UTC
+++ This bug was initially created as a clone of Bug #1685081 +++

Refer to <https://bugzilla.redhat.com/show_bug.cgi?id=1685081#c9> for details.

The openstack output module currently passes the "--non-bootable --read-write" options to the "openstack volume create" command. There is a bug in the "openstack" utility however itself (in the "python-openstackclient" package) where it assumes that the image creation API blocks, and as soon as it completes, the readonly and bootable flags can be tweaked with the APIs that exist for those purposes. The image creation API does not block however, and when the "openstack" command line utility tries to set the readonly & bootable flags, those APIs fail because image creation is still in progress. This results in an obscure error message on the virt-v2v standard error.

Given that "--non-bootable" and "--read-write" are both defaults for VM image creation, per <https://docs.openstack.org/python-openstackclient/yoga/cli/command-objects/volume.html>, work the symptom around by simply not passing these options.

Comment 1 Laszlo Ersek 2022-04-13 07:06:16 UTC
[v2v PATCH] output_openstack: work around non-blocking bug in openstack CLI
Message-Id: <20220413070534.21285-1-lersek>
https://listman.redhat.com/archives/libguestfs/2022-April/028654.html

Comment 2 Laszlo Ersek 2022-04-14 15:12:56 UTC
(In reply to Laszlo Ersek from comment #1)
> [v2v PATCH] output_openstack: work around non-blocking bug in openstack CLI
> Message-Id: <20220413070534.21285-1-lersek>
> https://listman.redhat.com/archives/libguestfs/2022-April/028654.html

Upstream commit b3a9dd6442ea.

Comment 6 mxie@redhat.com 2022-05-09 05:15:41 UTC
Verify the bug with below builds:
virt-v2v-2.0.4-1.el9.x86_64
libguestfs-1.48.1-1.el9.x86_64
guestfs-tools-1.48.0-1.el9.x86_64
libvirt-libs-8.3.0-1.el9.x86_64
qemu-img-7.0.0-2.el9.x86_64
nbdkit-server-1.30.4-1.el9.x86_64
libnbd-1.12.2-1.el9.x86_64
python3-openstackclient-5.5.1-0.20220427021748.53f1efa.el9ost.noarch


Steps:
Scenairo1:
1.1 Prepare a v2v-appliance on OSP16 env and convert a linux guest from VMware to openstack by v2v on v2v-appliance

# virt-v2v -ic vpx://root.227.27/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=76:75:59:0E:32:F5:1E:58:69:93:75:5A:7B:51:32:C5:D1:6D:F1:21  -ip /home/passwd esx7.0-rhel9.1-x86_64 -o openstack -oo server-id=v2v-appliance
[   0.0] Setting up the source: -i libvirt -ic vpx://root.227.27/data/10.73.199.217/?no_verify=1 -it vddk esx7.0-rhel9.1-x86_64
[   3.9] Opening the source
[  15.7] Inspecting the source
[  26.1] Checking for sufficient free disk space in the guest
[  26.1] Converting Red Hat Enterprise Linux 9.1 Beta (Plow) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 203.6] Mapping filesystem data to avoid copying unused and blank areas
[ 204.9] Closing the overlay
[ 205.2] Assigning disks to buses
[ 205.2] Checking if the guest needs BIOS or UEFI to boot
[ 205.2] Setting up the destination: -o openstack -oo server-id=v2v-appliance
[ 226.2] Copying disk 1/1
█ 100% [****************************************]
[ 524.2] Creating output metadata
[ 530.5] Finishing off

1.2 Launch the volume as instance after v2v conversion on OSP16 env, check guest and checkpoints of guest are passed


Scenario2:

2.1 Convert a windows guest from VMware to openstack by v2v on v2v-appliance
# virt-v2v -ic vpx://root.227.27/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=76:75:59:0E:32:F5:1E:58:69:93:75:5A:7B:51:32:C5:D1:6D:F1:21  -ip /home/passwd esx7.0-win2022-x86_64-uefi -o openstack -oo server-id=v2v-appliance
[   0.5] Setting up the source: -i libvirt -ic vpx://root.227.27/data/10.73.199.217/?no_verify=1 -it vddk esx7.0-win2022-x86_64-uefi
[   4.3] Opening the source
[  12.3] Inspecting the source
[  23.8] Checking for sufficient free disk space in the guest
[  23.8] Converting Windows Server 2022 Standard to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  47.9] Mapping filesystem data to avoid copying unused and blank areas
[  50.1] Closing the overlay
[  50.4] Assigning disks to buses
[  50.4] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[  50.4] Setting up the destination: -o openstack -oo server-id=v2v-appliance
[  66.7] Copying disk 1/1
█ 100% [****************************************]
[ 449.7] Creating output metadata
[ 454.9] Finishing off

2.2 Launch the volume as instance after v2v conversion on OSP16 env, check guest and checkpoints of guest are passed


Result:
    The bug has been fixed, move the bug from ON_QA to VERIFIED

Comment 8 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