Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1984983

Summary: Guest disk will turn into raw format if '-of qcow2 -oa preallocated' is set in v2v rhv conversion
Product: Red Hat Enterprise Linux 9 Reporter: mxie <mxie>
Component: virt-v2vAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: chhu, juzhou, kkiwi, lersek, mzhan, rjones, tyan, tzheng, vwu, xiaodwan
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-07 09:33:03 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:
Attachments:
Description Flags
virt-v2v-to-rhv-qcow2-preallocated-rhel9.log none

Description mxie@redhat.com 2021-07-22 15:18:42 UTC
Created attachment 1804547 [details]
virt-v2v-to-rhv-qcow2-preallocated-rhel9.log

Description of problem
Guest disk will turn into raw format if '-of qcow2 -oa preallocated' is set in v2v rhv conversion

Version-Release number of selected component (if applicable):
virt-v2v-1.45.2-1.el9.x86_64
libguestfs-1.45.6-9.el9.x86_64
guestfs-tools-1.46.1-3.el9.1.x86_64
libvirt-client-7.5.0-1.el9.x86_64
qemu-img-6.0.0-9.el9.x86_64
nbdkit-1.26.2-1.el9.x86_64
virtio-win-1.9.15-3.el9.noarch


How reproducible:
100%

Steps to Reproduce:
1. Convert a guest from ova file to rhv4.4 by v2v and set '-of qcow2 -oa preallocated' in command line
# 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 -o rhv -os 10.73.194.236:/home/nfs_export -of qcow2 -oa preallocated esx7.0-rhel8.4-x86_64 -n ovirtmgmt -on esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export -ip /home/passwd 
[   0.0] Opening the source -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 esx7.0-rhel8.4-x86_64 -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
[   1.7] Creating an overlay to protect the source from being modified
[   3.0] Opening the overlay
[  11.3] Inspecting the overlay
[  20.8] Checking for sufficient free disk space in the guest
[  20.8] Converting Red Hat Enterprise Linux 8.4 (Ootpa) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 116.0] Mapping filesystem data to avoid copying unused and blank areas
[ 118.2] Closing the overlay
[ 118.5] Assigning disks to buses
[ 118.5] Checking if the guest needs BIOS or UEFI to boot
[ 118.5] Initializing the target -o rhv -os 10.73.194.236:/home/nfs_export
[ 118.7] Copying disk 1/1 to /tmp/v2v.6iB4sJ/e2409bea-6f48-45e5-804e-6fa3d0660631/images/887a5eac-6874-4a34-bff6-0af31e9e6a91/e857d18a-abbd-47b6-9732-d992e2695f46 (qcow2)
    (100.00/100%)
[ 418.6] Creating output metadata
[ 418.7] Finishing off

2. Log into rhv node, check the disk format of guest by qemu-img, found disk format is raw which is not correct
# qemu-img info 887a5eac-6874-4a34-bff6-0af31e9e6a91/e857d18a-abbd-47b6-9732-d992e2695f46
image: 887a5eac-6874-4a34-bff6-0af31e9e6a91/e857d18a-abbd-47b6-9732-d992e2695f46
file format: raw
virtual size: 12 GiB (12884901888 bytes)
disk size: 12 GiB

Details please refer to virt-v2v debug log
# 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 -o rhv -os 10.73.194.236:/home/nfs_export -of qcow2 -oa preallocated esx7.0-rhel8.4-x86_64 -n ovirtmgmt -on esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export -ip /home/passwd  -v -x |& tee > virt-v2v-to-rhv-qcow2-preallocated-rhel9.log

# cat virt-v2v-to-rhv-qcow2-preallocated-rhel9.log |grep Copying
[ 130.6] Copying disk 1/1 to /tmp/v2v.4kdzWr/e2409bea-6f48-45e5-804e-6fa3d0660631/images/ca7ae23e-543c-447b-9d5a-b0cb73a7a1bc/36efe0b2-752a-4440-8619-eb2c70691f06 (qcow2)

# qemu-img info ca7ae23e-543c-447b-9d5a-b0cb73a7a1bc/36efe0b2-752a-4440-8619-eb2c70691f06
image: ca7ae23e-543c-447b-9d5a-b0cb73a7a1bc/36efe0b2-752a-4440-8619-eb2c70691f06
file format: raw
virtual size: 12 GiB (12884901888 bytes)
disk size: 12 GiB



Actual results:
As above description


Expected results:
Disk format should be consistent with the value of option -of in v2v conversion

Additional info:
1.Can't reproduce the bug when convert guest to local on rhel9

1.1 Convert a guest from VMware to local by virt-v2v on rhel9, set '-of qcow2 -oa preallocated' in v2v command line
# 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  -of qcow2 -oa preallocated esx7.0-rhel8.4-x86_64 -on esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export -ip /home/passwd 
[   0.0] Opening the source -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 esx7.0-rhel8.4-x86_64 -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
[   1.7] Creating an overlay to protect the source from being modified
[   2.8] Opening the overlay
[  10.7] Inspecting the overlay
[  19.2] Checking for sufficient free disk space in the guest
[  19.2] Converting Red Hat Enterprise Linux 8.4 (Ootpa) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 100.7] Mapping filesystem data to avoid copying unused and blank areas
[ 102.8] Closing the overlay
[ 103.1] Assigning disks to buses
[ 103.1] Checking if the guest needs BIOS or UEFI to boot
[ 103.1] Initializing the target -o libvirt -os default
[ 103.1] Copying disk 1/1 to /var/lib/libvirt/images/esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export-sda (qcow2)
    (100.00/100%)
[ 309.7] Creating output metadata
virt-v2v: warning: could not define libvirt domain: unsupported 
configuration: domain configuration does not support video model 'qxl'.
The libvirt XML is still available in ‘/tmp/v2vlibvirt253470.xml’.  Try 
running ‘virsh -c qemu:///system define /tmp/v2vlibvirt253470.xml’ 
yourself instead.
[ 309.8] Finishing off

1.2 Check disk format after conversion, disk format is qcow2 which is expected, tha preallocated problem has been tracked by bug1845518
# qemu-img info /var/lib/libvirt/images/esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export-sda
image: /var/lib/libvirt/images/esx7.0-rhel8.4-x86_64-qcow2-preallocated-to-export-sda
file format: qcow2
virtual size: 12 GiB (12884901888 bytes)
disk size: 2.84 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

2.Can reproduce the bug on rhel8.5 as well, so I'm not sure if the bug is regression problem

# rpm -q virt-v2v libguestfs libvirt-client qemu-kvm nbdkit
virt-v2v-1.42.0-14.module+el8.5.0+11846+77888a74.x86_64
libguestfs-1.44.0-3.module+el8.5.0+10681+17a9b157.x86_64
libvirt-client-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64
qemu-kvm-6.0.0-24.module+el8.5.0+11844+1e3017bd.x86_64
nbdkit-1.24.0-1.module+el8.4.0+9341+96cf2672.x86_64


# 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 -o rhv -os 10.73.194.236:/home/nfs_export -of qcow2 -oa preallocated esx7.0-rhel7.9-x86_64 -on esx7.0-rhel7.9-x86_64-qcow2-preallocated-rhel8.5 -b ovirtmgmt -ip /home/passwd 
[   0.0] Opening the source -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 esx7.0-rhel7.9-x86_64 -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
[   1.7] Creating an overlay to protect the source from being modified
[   3.0] Opening the overlay
[  10.9] Inspecting the overlay
[  49.0] Checking for sufficient free disk space in the guest
[  49.0] Estimating space required on target for each disk
[  49.0] Converting Red Hat Enterprise Linux Server 7.9 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 265.1] Mapping filesystem data to avoid copying unused and blank areas
[ 266.5] Closing the overlay
[ 266.8] Assigning disks to buses
[ 266.8] Checking if the guest needs BIOS or UEFI to boot
[ 266.8] Initializing the target -o rhv -os 10.73.194.236:/home/nfs_export
[ 267.5] Copying disk 1/1 to /tmp/v2v.VcYS5F/e2409bea-6f48-45e5-804e-6fa3d0660631/images/3dc623ed-197c-4e6d-81a4-6fbfa1c88605/c52f34c9-1a33-43e5-b492-6a0ae217080e (qcow2)
    (100.00/100%)
[ 608.5] Creating output metadata
[ 608.6] Finishing off


# qemu-img info 3dc623ed-197c-4e6d-81a4-6fbfa1c88605/c52f34c9-1a33-43e5-b492-6a0ae217080e
image: 3dc623ed-197c-4e6d-81a4-6fbfa1c88605/c52f34c9-1a33-43e5-b492-6a0ae217080e
file format: raw
virtual size: 12 GiB (12884901888 bytes)
disk size: 12 GiB

Comment 1 Laszlo Ersek 2022-07-07 09:33:03 UTC
Essentially a duplicate of bug 1939479; RHV does not offer an API where we could query the permitted combinations of formats and sparseness.

*** This bug has been marked as a duplicate of bug 1939479 ***