Description of problem: When building an image in qcow format with virt-builder centos-7.0 --format qcow --hostname centos-7.0 the output format will be qcow v3, which is not supported for example in centos6. Would be nice to have a compat option for qcow v2, something like virt-builder centos-7.0 --format qcowv2 --hostname centos-7.0 Pointer to qcow compat format info https://lists.fedoraproject.org/pipermail/virt/2014-April/004041.html So virt-builder could use something like qemu-img convert -f raw <file.img> -O qcow2 -o compat=0.10 <file.qcow> Version-Release number of selected component (if applicable): libguestfs-tools-c-1.28.6-1.fc21.x86_64
Although it would be nice for virt-builder to be able to create these directly, I will note there is a qemu-img amend command you can use to downgrade the image (assuming that the image doesn't already use certain modern features). $ virt-builder centos-7.0 --format qcow2 $ qemu-img amend -f qcow2 -o compat=0.10 centos-7.0.qcow2 $ qemu-img info centos-7.0.qcow2 image: centos-7.0.qcow2 file format: qcow2 virtual size: 6.0G (6442450944 bytes) disk size: 943M cluster_size: 65536 Format specific information: compat: 0.10 <--- note For more details see https://bugzilla.redhat.com/show_bug.cgi?id=1033490 There is also a bug about adding compat=1.1 support for RHEL 6, but I cannot find it right now.
After looking at this, I think the best (and certainly the simplest) approach is just to document the 'qemu-img amend' command, and that is the patch I have posted: https://www.redhat.com/archives/libguestfs/2015-November/msg00023.html The only problem with this is that the qemu-img amend command won't run on RHEL 6 itself (you have to run it on RHEL 7), but then again virt-builder doesn't run on RHEL 6 either. This fix will appear in 1.31.24.