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 1406854

Summary: Add --vdsm-compat=1.1 flag for VDSM
Product: Red Hat Enterprise Linux 7 Reporter: Marcel Kolaja <mkolaja>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.4CC: amureini, bmcclain, juzhou, kuwei, lkimlick, mxie, mzhan, ptoscano, rjones, snagar, tzheng, xiaodwan, ykaul
Target Milestone: rcKeywords: FutureFeature, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.32.7-3.el7_3.1 Doc Type: Enhancement
Doc Text:
The virt-v2v utility now exports disk images compatible with qcow2 format version 1.1 when using the -o rhev option. In addition, virt-v2v adds the --vdsm-compat=COMPAT option for the vdsm output mode. This option specifies which version of the qcow2 format virt-v2v uses, when exporting images with the -o vdsm option.
Story Points: ---
Clone Of: 1400205 Environment:
Last Closed: 2017-01-17 18:28:26 UTC Type: ---
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: 1400205    
Bug Blocks:    

Description Marcel Kolaja 2016-12-21 16:26:47 UTC
This bug has been copied from bug #1400205 and has been proposed
to be backported to 7.3 z-stream (EUS).

Comment 4 kuwei@redhat.com 2017-01-09 05:59:20 UTC
Beacuause it is a new feature,and when we check the the man page with below bulids don't have the option about "--vdsm-compat= "
virt-v2v-1.32.7-3.el7.x86_64

Try to verify this issue on below new build:
libguestfs-1.32.7-3.el7_3.2.x86_64
virt-v2v-1.32.7-3.el7_3.2.x86_64
rhv4.0: 4.0.6

Scenario 1:
1. Check whether option "--vdsm-ovf-output" has added to man page.
#man virt-v2v
###
--vdsm-compat=0.10
--vdsm-compat=1.1
If -o vdsm and the output format is qcow2, then we add the qcow2
compat=0.10 option to the output file for compatibility with RHEL 6
(see https://bugzilla.redhat.com/1145582).

If --vdsm-compat=1.1 is used then modern qcow2 (compat=1.1) files
are generated instead.

Currently --vdsm-compat=0.10 is the default, but this will change
to --vdsm-compat=1.1 in a future version of virt-v2v (when we can
assume that everyone is using a modern version of qemu).

Note this option only affects -o vdsm output. All other output
modes (including -o rhev) generate modern qcow2 compat=1.1 files,
always.
###

2.Prepare a guest with format "raw",Use virt-v2v with option"--vdsm-compat=1.1 " convert the kvm guest to rhv4.0.
2.1.Check  export domain path and mount it to local.
2.2.Create 2 new path:
images/12345678-1234-1234-1234-123456789011
master/vms/12345678-1234-1234-1234-123456789014
2.3. Run virt-v2v command with option "--vdsm-compat=1.1 ":
#virt-v2v xen-pv-rhel6.7-x86_64 -o vdsm --vdsm-image-uuid 12345678-1234-1234-1234-123456789011 --vdsm-vol-uuid 12345678-1234-1234-1234-123456789012 --vdsm-vm-uuid 12345678-1234-1234-1234-123456789014 --vdsm-ovf-output /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e/master/vms/12345678-1234-1234-1234-123456789014 -os /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e -of qcow2 --vdsm-compat=1.1
[ 0.0] Opening the source -i libvirt xen-pv-rhel6.7-x86_64
[ 0.1] Creating an overlay to protect the source from being modified
[ 0.6] Initializing the target -o vdsm -os /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e --vdsm-image-uuid 12345678-1234-1234-1234-123456789011 --vdsm-vol-uuid 12345678-1234-1234-1234-123456789012 --vdsm-vm-uuid 12345678-1234-1234-1234-123456789014 --vdsm-ovf-output /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e/master/vms/12345678-1234-1234-1234-123456789014 --vdsm-compat=1.1
[ 0.6] Opening the overlay
[ 8.0] Inspecting the overlay
[ 24.0] Checking for sufficient free disk space in the guest
[ 24.0] Estimating space required on target for each disk
[ 24.0] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 164.5] Mapping filesystem data to avoid copying unused and blank areas
[ 165.0] Closing the overlay
[ 166.6] Checking if the guest needs BIOS or UEFI to boot
[ 166.6] Assigning disks to buses
[ 166.6] Copying disk 1/1 to /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e/images/12345678-1234-1234-1234-123456789011/12345678-1234-1234-1234-123456789012 (qcow2)
(100.00/100%)
[ 205.5] Creating output metadata
[ 205.6] Finishing off

3.After finishing convention,cd images/12345678-1234-1234-1234-123456789011 to check the disk format
#qemu-img info 12345678-1234-1234-1234-123456789012
image: 12345678-1234-1234-1234-123456789012
file format: qcow2
virtual size: 5.9G (6291456000 bytes)
disk size: 3.2G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false

Result: Guest disk could be changed to qcow2 with flag compat=1.1 if using virt-v2v  convert guest to vdsm with option --vdsm-compat=1.1

Scenario 2:
1.Prepare a guest with format "raw",then convert it to rhv4.0 without option "-vdsm-compat"
1.1:Run the virt-v2v command:

# virt-v2v xen-pv-rhel6.7-x86_64 -o vdsm --vdsm-image-uuid 12345678-1234-1234-1234-123456789021 --vdsm-vol-uuid 12345678-1234-1234-1234-123456789022 --vdsm-vm-uuid 12345678-1234-1234-1234-123456789024 --vdsm-ovf-output /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e/master/vms/12345678-1234-1234-1234-123456789024 -os /mnt/c3fbdb8d-fe1b-4252-b2db-eb3edafc0c5e -of qcow2
2.After convention successfully,check the format :
 #qemu-img info 12345678-1234-1234-1234-123456789022
 image: 12345678-1234-1234-1234-123456789022
 file format: qcow2
 virtual size: 5.9G (6291456000 bytes)
 disk size: 3.2G
 cluster_size: 65536
 Format specific information:
 compat: 0.10
 lazy refcounts: false
 refcount bits: 16
 corrupt: false

Result: Guest disk could be changed to qcow2 with flag compat=0.10 if using virt-v2v  convert guest to vdsm without option --vdsm-compat=1.1/0.10. so when using virt-v2v convert guest to vdsm without  option --vdsm-compat=1.1/0.10, the default flag is --vdsm-compat=0.10

Scenario 3:
1.Prepare a guest with format "raw" ,then using virt-v2v convert guest to rhv4.0:
#virt-v2v rhel7.3 -o rhev -os 10.73.131.93:/home/nfs_test -of qcow2
2.After convention successfully,check the format :
#qemu-img info b764f4d6-7407-425c-b7ee-8c179ddad0dd
image: b764f4d6-7407-425c-b7ee-8c179ddad0dd
file format: qcow2
virtual size: 7.0G (7516192768 bytes)
disk size: 3.5G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false

Result: Guest disk could be changed to qcow2 with flag compat=1.1  when using option"-o rhev".

So,according above verify result, the bug :"add --vdsm-compat=1.1 flag for VDSM " has been fixed by virt-v2v,  so move the bug from ON_QA to VERIFIED

Comment 6 errata-xmlrpc 2017-01-17 18:28:26 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, 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://rhn.redhat.com/errata/RHBA-2017-0099.html