Bug 2025769

Summary: virt-v2v fails with the error: Backing file specified without backing format
Product: Red Hat Enterprise Linux 8 Reporter: Vera <vwu>
Component: virt-v2vAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Vera <vwu>
Severity: high Docs Contact:
Priority: high    
Version: 8.6CC: chhu, hongzliu, jsuchane, juzhou, mxie, tyan, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: virt-v2v-1.42.0-18.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 13:24:19 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:    
Bug Blocks: 2026666    
Attachments:
Description Flags
debugging log none

Description Vera 2021-11-23 02:43:56 UTC
Created attachment 1843094 [details]
debugging log

Description of problem:
virt-v2v fails with the error: Backing file specified without backing format

Version-Release number of selected component (if applicable):
virt-v2v-1.42.0-16.module+el8.6.0+13085+a15475d8.x86_64
libguestfs-1.44.0-4.module+el8.6.0+12969+f61072d9.x86_64
qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Preapre RHEL8.6 conversion server and xen VM

2.Convert VM using virt-v2v:
# virt-v2v -ic xen+ssh://root.224.33/ -o libvirt -of raw -os v2v_dir --mac 00:16:3e:05:de:21:network:v2v_net_0 xen-hvm-rhel7.9-x86_64
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.224.33/ xen-hvm-rhel7.9-x86_64
[   1.5] Creating an overlay to protect the source from being modified
qemu-img: /var/tmp/v2vovlcec68f.qcow2: Backing file specified without backing format
Detected format of raw.virt-v2v: error: qemu-img command failed, see earlier errors

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

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

Actual results:
As above

Expected results:
The conversion should be sucessful.


Additional info:
The debugging log is in the attachment

Comment 2 Richard W.M. Jones 2021-11-23 10:51:52 UTC
Upstream fix:
https://github.com/libguestfs/virt-v2v/commit/40cfe6da0861ca6360f670e254c71ed923a0402f

I've only done the fix upstream in 1.44 because:

 - Upstream (modular) virt-v2v 2.0 uses qemu-nbd -s (snapshot) option which appears
   to take care of this.

 - This is easy to backport to 1.42 for RHEL 8.6.

Comment 6 Jaroslav Suchanek 2021-11-24 11:25:00 UTC
Copying the comment https://bugzilla.redhat.com/show_bug.cgi?id=2026199#c5 over here, so it's not get lost. Please set the status of this bug appropriately if you want to re-use it.

From the comment 5 of the bug 2026199:

I don't think this is a libvirt bug actually.  In the code we don't
expect libvirt to return a type here, and so we substitute "raw"
format always:

https://github.com/libguestfs/virt-v2v/blob/a3d09f8a7435270e376a53d241ee54c2ebab2b0d/v2v/input_libvirt_vcenter_https.ml#L95

However before we reach this code, we go through parse_libvirt_domain
here which gives the error about the missing type/format:

https://github.com/libguestfs/virt-v2v/blob/a3d09f8a7435270e376a53d241ee54c2ebab2b0d/v2v/parse_libvirt_xml.ml#L270

So this needs another fix in virt-v2v 1.44.  I think we can keep the
same bug (bug 2025769) for the extra fix.

Comment 7 Richard W.M. Jones 2021-11-24 11:29:42 UTC
Additional fix required for RHEL 8.6:

https://github.com/libguestfs/virt-v2v/commit/59dc3293a9b4fdf11da8571c50e3e5badbb511c2

Comment 8 Richard W.M. Jones 2021-11-24 11:38:02 UTC
I checked that this bug does not affect upstream (modular) virt-v2v
because we don't use the qcow2 + backing file overlay.

Comment 9 Vera 2021-11-30 03:58:33 UTC
Verified with the following version:

virt-v2v-1.42.0-18.module+el8.6.0+13447+4b5d0856.x86_64
libguestfs-1.44.0-4.module+el8.6.0+12969+f61072d9.x86_64
qemu-kvm-6.1.0-5.module+el8.6.0+13430+8fdd5f85.x86_64

Steps to verify:
1. create pool and setup passwordless ssh with xen
2. Convert the vm on xen to libvirt
# virt-v2v -ic xen+ssh://root.224.33/ -o libvirt -of raw -os v2v_dir --mac 00:16:3e:05:de:21:network:v2v_net_0 xen-hvm-rhel7.9-x86_64
[   0.0] Opening the source -i libvirt -ic xen+ssh://root.224.33/ xen-hvm-rhel7.9-x86_64
[   1.6] Creating an overlay to protect the source from being modified
[   2.1] Opening the overlay
[   8.7] Inspecting the overlay
[  24.3] Checking for sufficient free disk space in the guest
[  24.3] Estimating space required on target for each disk
[  24.3] Converting Red Hat Enterprise Linux Server 7.9 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 173.2] Mapping filesystem data to avoid copying unused and blank areas
[ 174.0] Closing the overlay
[ 174.0] Assigning disks to buses
[ 174.0] Checking if the guest needs BIOS or UEFI to boot
[ 174.0] Initializing the target -o libvirt -os v2v_dir
[ 174.6] Copying disk 1/1 to /var/lib/libvirt/images/v2v_pool/xen-hvm-rhel7.9-x86_64-sda (raw)
    (100.00/100%)
[ 540.0] Creating output metadata
[ 540.1] Finishing off
# virsh list --all
 Id   Name                     State
-----------------------------------------
 -    xen-hvm-rhel7.9-x86_64   shut off


The conversion is successful.

Moving the bug to the status: VERIFIED.

Comment 11 errata-xmlrpc 2022-05-10 13:24:19 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 (Moderate: virt:rhel and virt-devel:rhel 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:1759