qcow2 [virtio-scsi] devices when mapped to the guest shows as 0MB irrespective of the volume size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned | ||
Fedora |
New
|
Undecided
|
Unassigned |
Bug Description
qcow2 [virtio-scsi] devices when mapped to the guest shows as 0MB irrespective of the volume size.
Kernel Version: 3.10.0-rc5+
Libvirt Version: 1.0.6
Qemu Version: 1.5.50
Steps to reproduce the issue:
1. Create a qcow2 voulme using the command qemu-img create -f qcow2 virtio-scsi11.img 10G
2. Add the virtio-scsi controller
<controller type='scsi' index='0' model='
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller>
3. Attach the qcow2 device to the guest, virsh attach-disk rhel64-64 /home/images/
4. Run the scan commnad echo ' - - - ' > /sys/class/
5. Check the dmesg for the added volume.
6. Run fdisk -l command
Disk /dev/sdl: 0 MB, 197120 bytes
1 heads, 1 sectors/track, 385 cylinders, total 385 sectors
Units = cylinders of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
And observe that the 10G qcow2 volume shows as 0MB.
This is not seen with the raw image.
Disk /dev/sdm: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Expected Result:
The volume size for the qcow2 volumes should be shown correctly inside the guest to avoid confusion.
Guest XML:
virsh dumpxml rhel64-64
<domain type='kvm' id='4'>
<name>
<uuid>
<memory unit='KiB'
<currentMemory unit='KiB'
<vcpu placement=
<resource>
<partition>
</resource>
<os>
<type arch='x86_64' machine=
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>
<on_reboot>
<on_crash>
<devices>
<emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/
<target dev='hdb' bus='ide'/>
<readonly/>
<alias name='ide0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sda' bus='scsi'/>
<alias name='scsi0-
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdf' bus='scsi'/>
<alias name='scsi0-
<address type='drive' controller='0' bus='0' target='0' unit='5'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdg' bus='scsi'/>
<alias name='scsi0-
<address type='drive' controller='0' bus='0' target='0' unit='6'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdh' bus='scsi'/>
<alias name='scsi1-0-0'/>
<address type='drive' controller='1' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdi' bus='scsi'/>
<alias name='scsi1-0-1'/>
<address type='drive' controller='1' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdk' bus='scsi'/>
<alias name='scsi1-0-3'/>
<address type='drive' controller='1' bus='0' target='0' unit='3'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdl' bus='scsi'/>
<alias name='scsi1-0-4'/>
<address type='drive' controller='1' bus='0' target='0' unit='4'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdm' bus='scsi'/>
<alias name='scsi1-0-5'/>
<address type='drive' controller='1' bus='0' target='0' unit='5'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdn' bus='scsi'/>
<alias name='scsi1-0-6'/>
<address type='drive' controller='1' bus='0' target='0' unit='6'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdr' bus='scsi'/>
<alias name='scsi2-0-3'/>
<address type='drive' controller='2' bus='0' target='0' unit='3'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdx' bus='scsi'/>
<alias name='scsi3-0-2'/>
<address type='drive' controller='3' bus='0' target='0' unit='2'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdy' bus='scsi'/>
<alias name='scsi3-0-3'/>
<address type='drive' controller='3' bus='0' target='0' unit='3'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='
<source file='/
<target dev='sdz' bus='scsi'/>
<alias name='scsi3-0-4'/>
<address type='drive' controller='3' bus='0' target='0' unit='4'/>
</disk>
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci0'/>
</controller>
<controller type='scsi' index='0' model='
<alias name='scsi0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</controller>
<controller type='scsi' index='1'>
<alias name='scsi1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
<controller type='scsi' index='2'>
<alias name='scsi2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
<controller type='scsi' index='3'>
<alias name='scsi3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</controller>
<interface type='network'>
<mac address=
<source network='default'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
<listen type='address' address=
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
<seclabel type='none' model='selinux'/>
</domain>
I tried booting with the qemu and observed the same thing.
qemu-system-x86_64 /home/images/ rhel64- 64.qcow2 -drive if=none, id=hd,file= /home/images/ virtio- scsi11. img -device virtio- scsi-pci, id=scsi --enable-kvm -device scsi-hd,drive=hd -m 2000
After creating the filesystem tried running the iozone and noticed disk out of space issue.