## Description of problem: I have a RHEL8 kvm host. When adding a thin provisioned (qcow2) disk to an existing VM, it adds as raw. This means that the disk is unusable. If I edit the config manually and add "<driver name='qemu' type='qcow2'/>", then it's fine. ## Version-Release number of selected component (if applicable): cockpit-bridge-184-1.el8.x86_64 cockpit-machines-184-1.el8.noarch cockpit-system-184-1.el8.noarch cockpit-ws-184-1.el8.x86_64 ipxe-roms-qemu-20181214-1.git133f4c47.el8.noarch kernel-4.18.0-32.el8.x86_64 kernel-core-4.18.0-32.el8.x86_64 libvirt-daemon-4.5.0-16.module+el8+2586+bf759444.x86_64 libvirt-daemon-driver-storage-4.5.0-16.module+el8+2586+bf759444.x86_64 libvirt-daemon-kvm-4.5.0-16.module+el8+2586+bf759444.x86_64 libvirt-dbus-1.2.0-1.module+el8+2529+a9686a4d.x86_64 libvirt-glib-2.0.0-1.el8.x86_64 libvirt-libs-4.5.0-16.module+el8+2586+bf759444.x86_64 python3-libvirt-4.5.0-1.module+el8+2529+a9686a4d.x86_64 qemu-guest-agent-2.12.0-41.el8+2104+3e32e6f8.x86_64 qemu-img-2.12.0-51.module+el8+2608+a17c4bfe.x86_64 qemu-kvm-2.12.0-51.module+el8+2608+a17c4bfe.x86_64 qemu-kvm-core-2.12.0-51.module+el8+2608+a17c4bfe.x86_64 ## How reproducible: Always ## Steps to Reproduce: 1. Install a VM via cockpit 2. Go to Disks tab and click 'Add Disk' 3. select 'qcow2' as the format Try and use the new virtual disk. ## Actual results: On the VM, usually shows up as something like this: Error: /dev/vdc: unrecognised disk label Model: Virtio Block Device (virtblk) Disk /dev/vdc: 197kB <== too small: Sector size (logical/physical): 512B/512B Partition Table: unknown Disk Flags: While on the KVM host: # qemu-img info test2-disk8 image: test2-disk8 file format: qcow2 virtual size: 2.9G (3072000000 bytes) disk size: 196K cluster_size: 65536 Format specific information: compat: 0.10 refcount bits: 16 ## Expected results: qcow2 disks should be added as qcow2, so that they are usable ## Additional info: I shut down the VM and manually edited the config ('virsh edit') and then the disk was fine after that: old: <disk type='volume' device='disk'> <driver name='qemu'/> <source pool='default' volume='test2-disk6'/> <target dev='vdc' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </disk> new: <disk type='volume' device='disk'> <driver name='qemu' type='qcow2'/> <source pool='default' volume='test2-disk8'/> <target dev='vdc' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </disk> And now the disk is usable: [root@rhel8-test2 ~]# parted /dev/vdc print Error: /dev/vdc: unrecognised disk label Model: Virtio Block Device (virtblk) Disk /dev/vdc: 3072MB Sector size (logical/physical): 512B/512B Partition Table: unknown Disk Flags: [root@rhel8-test2 ~]# mkfs.xfs /dev/vdc meta-data=/dev/vdc isize=512 agcount=4, agsize=187500 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 data = bsize=4096 blocks=750000, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@rhel8-test2 ~]# mount /dev/vdc /mnt [root@rhel8-test2 ~]# df -h /mnt Filesystem Size Used Avail Use% Mounted on /dev/vdc 2.9G 53M 2.8G 2% /mnt
Created attachment 1516984 [details] disk attach screen In this screenshot, 'vdc' is the incorrect disk (qcow2 added as 'raw')
Fix landed upstream: https://github.com/cockpit-project/cockpit/pull/10897
Test Versions: cockpit-machines-193-1.el8.noarch libvirt-dbus-1.2.0-2.module+el8.1.0+2983+b2ae9c0a.x86_64 Test Steps: 1.Create a VM and add a qcow2 disk for it 2.Check the disk type by using command which is 'virsh dumpxml ${vmname}' 3.Use command to check the disk(eg:df -h /dev/vd*) 4.Use command to write something into the disk(eg:dd if=/dev/zero of=${filename} bs=1M count=1000) Test Results: The xml results from command 'virsh dumpxml ${vmnamd}': <disk type='volume' device='disk'> <driver name='qemu' type='qcow2'/> <source pool='default' volume='dddd'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> The information of the disk is correct, and the disk can be also wrote. According to the results, the qcow2 disk can be added correctly through page.So move the status to VERIFIED.
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://access.redhat.com/errata/RHBA-2019:3325