| Summary: | qemu-img fail to open the disk format image its created correctly (block device only) | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Sibiao Luo <sluo> |
| Component: | qemu-kvm | Assignee: | Virtualization Maintenance <virt-maint> |
| Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.5 | CC: | acathrow, bsarathy, chayang, famz, juzhang, michen, mkenneth, pbonzini, qzhang, virt-maint, xfu |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-10-14 08:37:58 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: | |
|
Description
Sibiao Luo
2013-10-14 05:31:43 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. (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: 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 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. |