Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1223216

Summary: qemu-img can not create qcow2 image when backend is block device
Product: Red Hat Enterprise Linux 6 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.7CC: chayang, famz, juzhang, michen, mkenneth, qzhang, rbalakri, rpacheco, virt-maint, xfu, zhguo
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.484.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 20:58:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jun Li 2015-05-20 06:40:54 UTC
Description of problem:
when backend is block device, create a qcow2 format image, will got error hint as "Header extension too large".

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.475.el6.x86_64

How reproducible:
Sometimes

Steps to Reproduce:
1.using qemu-img to create a qcow2 format image.
e.g:
# qemu-img create -f qcow2 /dev/iscsi-juli/disk1.qcow2 1G
Formatting '/dev/iscsi-juli/disk1.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 
Header extension too large
/dev/iscsi-juli/disk1.qcow2: error while creating qcow2: Invalid argument

2.
3.

Actual results:
# qemu-img create -f qcow2 /dev/iscsi-juli/disk1.qcow2 1G
Formatting '/dev/iscsi-juli/disk1.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 
Header extension too large
/dev/iscsi-juli/disk1.qcow2: error while creating qcow2: Invalid argument

Expected results:
Create this qcow2 format image successfully.

Additional info:
Workaround:
1, write zero to this block devcie.
# dd if=/dev/zero of=/dev/iscsi-juli/disk1.qcow2 bs=4k count=1
2, create qcow2 format image, will success.
# qemu-img create -f qcow2 /dev/iscsi-juli/disk1.qcow2 1G
Formatting '/dev/iscsi-juli/disk1.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536

Comment 2 Kevin Wolf 2015-05-20 17:24:31 UTC
Probably fixed by upstream commit f8413b3c.

Comment 4 Jeff Nelson 2016-01-18 21:51:11 UTC
Fix included in qemu-kvm-0.12.1.2-2.484.el6

Comment 6 Guo, Zhiyi 2016-01-20 07:25:18 UTC
Reproduce the issue on qemu-kvm-0.12.1.2-2.483.el6.x86_64:
# qemu-img create -f qcow2 /dev/sdb 500M
Formatting '/dev/sdb', fmt=qcow2 size=524288000 encryption=off cluster_size=65536 
Header extension too large
/dev/sdb: error while creating qcow2: Invalid argument
Verified on qemu-kvm version:qemu-img-0.12.1.2-2.484.el6.x86_64, image create successfully:
# qemu-img create -f qcow2 /dev/sdb 500M
Formatting '/dev/sdb', fmt=qcow2 size=524288000 encryption=off cluster_size=65536
#

Comment 9 errata-xmlrpc 2016-05-10 20:58:53 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.

https://rhn.redhat.com/errata/RHBA-2016-0815.html