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 1018651 - qemu-img fail to open the disk format image its created correctly (block device only)
Summary: qemu-img fail to open the disk format image its created correctly (block devi...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-14 05:31 UTC by Sibiao Luo
Modified: 2013-10-14 09:51 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-14 08:37:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2013-10-14 05:31:43 UTC
Description of problem:
create a lvm qcow2 disk format with qemu-img, then create it to raw format, it fail to open the disk format image its created correctly (block device only).
BTW, also tried the rhel6.4GA qemu-kvm-0.12.1.2-2.355.el6.x86_64 also hit this issue, so it's not a regression issue.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-422.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.412.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.logging in to a iSCSI and create a lvm.
# lvcreate -L 10G -n sluo_lv sluo_vg
  Logical volume "sluo_lv" created
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
...
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0
2.create a lvm qcow2 disk format with qemu-img and check the info.
# qemu-img create -f qcow2 /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
...
3.then create it to raw format and check it.
# qemu-img create -f qcow2 /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qcow2                       <------------------wrong.
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
# qemu-img create -f qcow2 /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qcow2                       <------------------wrong.
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
4.boot a guest and attach this lvm specified qcow2/raw format.
e.g:...-drive file=/dev/sluo_vg/sluo_lv,if=none,id=drive-virtio-disk1,*format=qcow2|raw*,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,vectors=0,bus=pci.0,addr=0x7,scsi=off,drive=drive-virtio-disk1,id=virtio-disk1,bootindex=2

Actual results:
after step 3, it was wrong file format.
after step 4, both qcow2 and raw format can boot up.

Expected results:
step 3: it can create it to raw format correctly and read it to raw format correctly.
step 4: qemu should quit with prompt message when specified qcow2 format, like:
qemu-kvm: -drive file=/dev/sluo_vg/sluo_lv,if=none,id=drive-virtio-disk1,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop: could not open disk image /dev/sluo_vg/sluo_lv: Invalid argument

Additional info:

Comment 1 Sibiao Luo 2013-10-14 05:34:03 UTC
Aslo tried the local file image with the same testing that did not meet such issue. so this issue is specified block device only.

Comment 2 Sibiao Luo 2013-10-14 05:37:04 UTC
(In reply to Sibiao Luo from comment #0)
> Description of problem:
> create a lvm qcow2 disk format with qemu-img, then create it to raw format,
> it fail to open the disk format image its created correctly (block device
> only).
> BTW, also tried the rhel6.4GA qemu-kvm-0.12.1.2-2.355.el6.x86_64 also hit
> this issue, so it's not a regression issue.
> 
> Version-Release number of selected component (if applicable):
> host info:
> # uname -r && rpm -q qemu-kvm-rhev
> 2.6.32-422.el6.x86_64
> qemu-kvm-rhev-0.12.1.2-2.412.el6.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1.logging in to a iSCSI and create a lvm.
> # lvcreate -L 10G -n sluo_lv sluo_vg
>   Logical volume "sluo_lv" created
> # lvscan 
>   ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
> ...
> # qemu-img info /dev/sluo_vg/sluo_lv
> image: /dev/sluo_vg/sluo_lv
> file format: raw
> virtual size: 10G (10737418240 bytes)
> disk size: 0
> 2.create a lvm qcow2 disk format with qemu-img and check the info.
> # qemu-img create -f qcow2 /dev/sluo_vg/sluo_lv 10G
> Formatting '/dev/sluo_vg/sluo_lv', fmt=qcow2 size=10737418240 encryption=off
> cluster_size=65536 
> # qemu-img info /dev/sluo_vg/sluo_lv
> image: /dev/sluo_vg/sluo_lv
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 0
> cluster_size: 65536
> # lvscan 
>   ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
> ...
> 3.then create it to raw format and check it.
sorry for wrong pasting.
# qemu-img create -f raw /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=raw size=10737418240
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qcow2                       <------------------wrong.
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
# lvscan
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit
> 4.boot a guest and attach this lvm specified qcow2/raw format.
> e.g:...-drive
> file=/dev/sluo_vg/sluo_lv,if=none,id=drive-virtio-disk1,*format=qcow2|raw*,
> cache=none,aio=native,werror=stop,rerror=stop -device
> virtio-blk-pci,vectors=0,bus=pci.0,addr=0x7,scsi=off,drive=drive-virtio-
> disk1,id=virtio-disk1,bootindex=2
> 
> Actual results:
> after step 3, it was wrong file format.
> after step 4, both qcow2 and raw format can boot up.
> 
> Expected results:
> step 3: it can create it to raw format correctly and read it to raw format
> correctly.
> step 4: qemu should quit with prompt message when specified qcow2 format,
> like:
> qemu-kvm: -drive
> file=/dev/sluo_vg/sluo_lv,if=none,id=drive-virtio-disk1,format=qcow2,
> cache=none,aio=native,werror=stop,rerror=stop: could not open disk image
> /dev/sluo_vg/sluo_lv: Invalid argument
> 
> Additional info:

Comment 3 Sibiao Luo 2013-10-14 05:41:41 UTC
Also can be reproduce this issue with the following testing: create the lvm to qed first and then create it into raw agian, the qemu-img will fail to open the disk format image its created correctly (block device only).

# lvcreate -L 10G -n sluo_lv sluo_vg
  Logical volume "sluo_lv" created
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0
# qemu-img create -f qed /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=qed size=10737418240 cluster_size=0 table_size=0 
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qed
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit
# qemu-img create -f raw /dev/sluo_vg/sluo_lv 10G
Formatting '/dev/sluo_vg/sluo_lv', fmt=raw size=10737418240 
# qemu-img info /dev/sluo_vg/sluo_lv
image: /dev/sluo_vg/sluo_lv
file format: qed
virtual size: 10G (10737418240 bytes)
disk size: 0
cluster_size: 65536
# lvscan 
  ACTIVE            '/dev/sluo_vg/sluo_lv' [10.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_root' [50.00 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_home' [407.49 GiB] inherit
  ACTIVE            '/dev/vg_dhcp9242/lv_swap' [7.78 GiB] inherit

Comment 4 Paolo Bonzini 2013-10-14 08:37:42 UTC
This is not a bug.  It happens because block devices are not initialized to zero.  For this reason it is always preferrable to "scrub" devices when you create them as raw.

We are working on it upstream and we might get a fix in RHEL7 together with bug 1007815.


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