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 1662213 - When adding a disk to a VM via cockpit, qcow2 is added as 'raw'
Summary: When adding a disk to a VM via cockpit, qcow2 is added as 'raw'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: cockpit-appstream
Version: 8.0
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: 8.1
Assignee: Katerina Koukiou
QA Contact: YunmingYang
URL:
Whiteboard:
Depends On: 1678935
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-27 05:28 UTC by Marcus West
Modified: 2020-09-21 08:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 20:41:35 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
disk attach screen (111.68 KB, image/png)
2018-12-27 05:32 UTC, Marcus West
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3776601 0 None None None 2018-12-27 06:38:55 UTC
Red Hat Product Errata RHBA-2019:3325 0 None None None 2019-11-05 20:41:46 UTC

Description Marcus West 2018-12-27 05:28:43 UTC
## 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

Comment 1 Marcus West 2018-12-27 05:32:16 UTC
Created attachment 1516984 [details]
disk attach screen

In this screenshot, 'vdc' is the incorrect disk (qcow2 added as 'raw')

Comment 2 Martin Pitt 2019-01-03 12:20:56 UTC
Fix landed upstream: https://github.com/cockpit-project/cockpit/pull/10897

Comment 4 YunmingYang 2019-05-29 07:29:11 UTC
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.

Comment 6 errata-xmlrpc 2019-11-05 20:41:35 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://access.redhat.com/errata/RHBA-2019:3325


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