Created attachment 1060991 [details] Log info Description: Option -oa preallocated -of qcow2 of virt-v2v didn't work efficiently Version: libvirt-1.2.17-3.el7.x86_64 virt-v2v-1.28.1-1.49.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Use virt-v2v to convert guest with -oa preallocated -of qcow2. # virt-v2v -ic xen+ssh://10.66.106.64 -os default -oa preallocated xen-hvm-rhel7.1-x86_64 -of qcow2 -on qcow2-preallocated [ 0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-hvm-rhel7.1-x86_64 [ 1.0] Creating an overlay to protect the source from being modified [ 1.0] Opening the overlay [ 6.0] Initializing the target -o libvirt -os default [ 6.0] Inspecting the overlay [ 29.0] Checking for sufficient free disk space in the guest [ 29.0] Estimating space required on target for each disk [ 29.0] Converting Red Hat Enterprise Linux Server release 7.1 (Maipo) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 191.0] Mapping filesystem data to avoid copying unused and blank areas [ 191.0] Closing the overlay [ 192.0] Checking if the guest needs BIOS or UEFI to boot [ 192.0] Copying disk 1/1 to /var/lib/libvirt/images/qcow2-preallocated-sda (qcow2) (100.00/100%) [ 520.0] Creating output metadata Pool default refreshed Domain qcow2-preallocate defined from /tmp/v2vlibvirt10ab6c.xml [ 520.0] Finishing off 2.After conversion,check the disk,it's not fully peallocated. # ll -lsh /var/lib/libvirt/images/qcow2-preallocated-sda 3.2G -rw-r--r--. 1 root root 5.9G Aug 10 17:21 /var/lib/libvirt/images/qcow2-preallocated-sda # qemu-img info /var/lib/libvirt/images/qcow2-preallocated-sda image: /var/lib/libvirt/images/qcow2-preallocated-sda 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 Actual results: As description. Expected results: Option -oa preallocated -of qcow2 work efficiently Additional info: 1.Option -oa preallocated -of raw work efficiently. 2.Attached the detailed log.
Patches posted: https://www.redhat.com/archives/libguestfs/2015-August/msg00098.html https://www.redhat.com/archives/libguestfs/2015-August/msg00099.html
Moving to RHEL 7.3 since the bug isn't really very serious.
Upstream commits: 66daad38f37c8975c4b6bcb760094cf4490fef14 42b6bb12dcbc5103044a9099d71f17a82009e7de
Since I need to do another build of libguestfs today because of a regression, might as well take this bug for RHEL 7.2.
Tested the bug with: virt-v2v-1.28.1-1.51.el7.x86_64 Steps: 1.Use virt-v2v to convert guest with -oa preallocated -of qcow2. # virt-v2v -ic xen+ssh://10.66.106.64 -os default -oa preallocated xen-hvm-rhel7.1-x86_64 -of qcow2 -on qcow2-preallocated [ 0.0] Opening the source -i libvirt -ic xen+ssh://10.66.106.64 xen-hvm-rhel7.1-x86_64 [ 0.0] Creating an overlay to protect the source from being modified [ 1.0] Opening the overlay [ 8.0] Initializing the target -o libvirt -os default [ 8.0] Inspecting the overlay [ 31.0] Checking for sufficient free disk space in the guest [ 31.0] Estimating space required on target for each disk [ 31.0] Converting Red Hat Enterprise Linux Server release 7.1 (Maipo) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 140.0] Mapping filesystem data to avoid copying unused and blank areas [ 140.0] Closing the overlay [ 142.0] Checking if the guest needs BIOS or UEFI to boot [ 142.0] Copying disk 1/1 to /var/lib/libvirt/images/qcow2-preallocated-sda (qcow2) (100.00/100%) [ 449.0] Creating output metadata Pool default refreshed Domain qcow2-preallocated defined from /tmp/v2vlibvirt953164.xml [ 451.0] Finishing off 2.After conversion,check the disk,it's fully peallocated. # ll -lsh qcow2-preallocated-sda 5.9G -rw-r--r--. 1 root root 5.9G Sep 2 17:59 qcow2-preallocated-sda # qemu-img info qcow2-preallocated-sda image: qcow2-preallocated-sda file format: qcow2 virtual size: 5.9G (6291456000 bytes) disk size: 5.9G cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false Refer the above comments,the bug has been fixed,so move it's status to VERIFIED.
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-2015-2183.html