Red Hat Bugzilla – Bug 635354
Can not commit copy-on-write image's data to raw backing-image
Last modified: 2013-01-09 18:09:24 EST
Description of problem: Can not commit copy-on-write image's data to raw backing-image Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.54.el6 How reproducible: 100% Steps to Reproduce: 1.create a raw image #qemu-img create -f raw Mike 5G 2.create snapshot disk : #qemu-img create -F raw -f qcow2 -b Mike Mike.sp 3.write some datas to the snapshot disk eg:#qemu-io Mike.sp qemu-io> write 0 512k -P 3 4.commit snapshot datas to the backing-image eg:# qemu-img commit Mike.sp Actual results: # qemu-img commit Mike.sp qemu-img: Error while committing image Expected results: # qemu-img commit Mike.sp Image committed. Additional info: re-tested on qemu-kvm-0.12.1.2-2.53.el6 , it works fine.
Bill asked me to clarify what this bug actually means. When committing the content of a qcow2 image to its backing file, the backing file is reopened as qcow2 instead of its real format. This means that committing fails when you use other formats for the backing file, most importantly raw. If you do this from within a running VM (using the 'commit' monitor command), the VM will lose access to the disk. The integrity of the image is not harmed.
Verified on qemu-kvm-0.12.1.2-2.115.el6 backding file: block_device(raw)--->pass block_device(qcow2)--->pass file(raw)--->pass file(qcow2)--->pass based on above ,this issue has been fixed .
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error: qemu-img: Error while committing image With this update, this error no longer occurs, and such images can now be committed as expected.
Re-verify this bug with package qemu-kvm-0.12.1.2-2.128.el6.x86_64 as following steps: 1. install guest in base image 2. create snapshot for base image 3. start snapshot, and dd 1G size file in guest 4. shutdown snapshot, do snapshot commit 5. start base image, check big file using cksum, if cksum is same, pass Verify four kind of images as following block device (qcow2) block device (raw) File (qcow2) File (raw) All pass, so this bug has been fixed.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,5 +1,12 @@ -Previously, attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error: +Cause: backing file re-opening code opened the backing file with the wrong format. +Consequence: + +attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error: + qemu-img: Error while committing image -With this update, this error no longer occurs, and such images can now be committed as expected.+ +Fix: the block device backing file re-open code now re-opens the backing file with the backing file format and not with the format of the snapshot image. + +Result: With this update, the 'Error while committing image' error no longer occurs when using 'qemu-img commit', and the images can now be committed as expected.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,12 +1 @@ -Cause: backing file re-opening code opened the backing file with the wrong format. +Previously, when a QCOW2 image was committed to a backing file, the backing file was erroneously opened as a QCOW2 format file instead of its correct format, which caused a "qemu-img: Error while committing image" error to display. This is fixed to ensure that backing files are now opened in the correct format and images commits execute as expected.- -Consequence: - -attempting to commit a copy-on-write image to a raw backing disk image using the "quemu-img commit" command may have failed with the following error: - - qemu-img: Error while committing image - - -Fix: the block device backing file re-open code now re-opens the backing file with the backing file format and not with the format of the snapshot image. - -Result: With this update, the 'Error while committing image' error no longer occurs when using 'qemu-img commit', and the images can now be committed as expected.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0534.html