Bug 1204131 - RFE: virt-builder creates qcow v3 images, add build option for qcow v2
Summary: RFE: virt-builder creates qcow v3 images, add build option for qcow v2
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-20 13:00 UTC by Stefan Assmann
Modified: 2015-11-04 10:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-04 10:17:07 UTC


Attachments (Terms of Use)

Description Stefan Assmann 2015-03-20 13:00:05 UTC
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

Comment 1 Richard W.M. Jones 2015-03-20 13:26:31 UTC
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.

Comment 2 Richard W.M. Jones 2015-11-04 10:17:07 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.