Bug 713468

Summary: [RFE]: e2image: Add support for exporting image in qcow2 format
Product: Red Hat Enterprise Linux 6 Reporter: Lukáš Czerner <lczerner>
Component: e2fsprogsAssignee: Lukáš Czerner <lczerner>
Status: CLOSED ERRATA QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: bnater, sct
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: e2fsprogs-1.41.12-9.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:14:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Lukáš Czerner 2011-06-15 13:50:50 UTC
Description of problem:

Nowadays we can export only raw image by e2image and even though it exports the file system image into sparse file, there is a problem when manipulating with it. The usual approach is to use compression, but compression/decompression takes forever on bigger file system (not even mentioning huge file systems).

Qcow2 format has the advantage of being really small, almost as sparse raw image, but not actually being sparse. It means that we can easily manipulate with it. It it done by packing used data blocks closely together and then addresing them by the system of address tables.


How reproducible:
Try to export and transfer file system image. It is really painful process.

Additional info:

Upstream already have this feature:

commit bf0449b1a6547a566975cb32c18a2ba5972deace
Author: Lukas Czerner <lczerner>
Date:   Wed May 18 13:36:53 2011 +0200

    e2image: Add support for qcow2 format
    
    This commit adds support for exporting filesystem into QCOW2 image
    format. Like sparse format this saves space, by writing only necessary
    (metadata blocks) into image. Unlike sparse image, QCOW2 image is NOT
    sparse, hence does not change its size by copying with not-sparse-aware
    tools.
    
    New options '-Q' has been added to tell the e2image to use QCOW2 as an
    output image format. QCOW2 supports encryption and compression, however
    e2image so far does no support such features, however you can still
    scramble filenames with '-s' option.
    
    Signed-off-by: Lukas Czerner <lczerner>
    Signed-off-by: Theodore Ts'o <tytso>

commit 92dcfb7692da5c3ed61899c49c0915f889815c45
Author: Lukas Czerner <lczerner>
Date:   Wed May 18 14:20:47 2011 +0200

    e2image: Support for conversion QCOW2 image into raw
    
    This commit adds support for converting QCOW2 image created previously
    with e2image into raw image. The QCOW2 image is detected automatically,
    so there is not new option. Just use following command:
    
      e2image -r image.qcow image.raw
    
    No that this tool is aimed to quickly convert qcow2 image created with
    e2image into raw image. In order to improve speed we are doing some
    assumption I believe might not be true for regular qcow2 images. So it
    was not tested with regular QCOW2 images and it might not work with
    them. The intention of this tool is only convert images previously
    created by e2image.
    
    Note that there is nothing special with QCOW2 images created by e2images
    and it can be used with tools like qemu-img, or qemu-nbd without any
    problems.
    
    Signed-off-by: Lukas Czerner <lczerner>
    Signed-off-by: Theodore Ts'o <tytso>


commit 9e713505ab4216c1391a14aa86a7f49a6026aa46
Author: Lukas Czerner <lczerner>
Date:   Wed May 18 13:36:55 2011 +0200

    tests: New i_e2image test to validate image creation/conversion
    
    This commit adds new regression test called i_e2image which should
    validate expected behaviour of e2image raw and qcow2 image creation
    and qcow2 -> raw image conversion. You can run it with "make check" as
    the rest of regression tests.
    
    Testing is performed on three filesystem images with different block
    sizes (1024, 2048, 4096). It creates raw and qcow2 images from the
    original and then convert qcow2 image back to raw image. The results are
    checksummed and compared with pre-prepared results. All md5sums should
    stay the same and raw image created from original and qcow2 image should
    be the same as well (just for the record).
    
    Signed-off-by: Lukas Czerner <lczerner>
    Signed-off-by: Theodore Ts'o <tytso>

Comment 1 Lukáš Czerner 2011-06-21 09:46:54 UTC
commited and build with version e2fsprogs-1.41.12-9.el6

Comment 4 errata-xmlrpc 2011-12-06 18:14:02 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.

http://rhn.redhat.com/errata/RHBA-2011-1735.html