Bug 1744484

Summary: [machines] The VM can not attach raw disks which have been created
Product: Red Hat Enterprise Linux 8 Reporter: YunmingYang <yunyang>
Component: cockpit-appstreamAssignee: Katerina Koukiou <kkoukiou>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: leiwang, mpitt, skobyda, wshi, xchen, ymao
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1765488 (view as bug list) Environment:
Last Closed: 2020-04-28 15:43:05 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1765488    

Description YunmingYang 2019-08-22 09:34:40 UTC
Description of problem:
If create a raw disk in advance, then attach it to the VM through the UI. The attaching is failed with an error message,that is 'operation failed: Incorrect disk format'.

Version-Release number of selected component (if applicable):
cockpit-machines-197.2-1.el8.noarch
libvirt-dbus-1.2.0-3.module+el8.1.0+3531+2918145b.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create an raw disk by using 'virsh vol-create-as $pool $disk $capacity --format raw' 
2. Login cockpit and Create a VM
3. Switch to the disk tab of the VM, then click attach button
4. Switch the raw disk which is prepared in advance from 'Using existing'

Actual results:
1. The attaching is failed with an error message that is 'operation failed: Incorrect disk format'.

Expected results:
1. The raw disks which have been created can be attached

Additional info:

Comment 1 Simon Kobyda 2019-08-26 10:52:14 UTC
This bug was already fixed and merged 19 days ago

commit 0eba27e0735c5eba1edbfed4d29237adf6d4249e
Author: Simon Kobyda <skobyda>
Date:   Thu Aug 1 13:27:59 2019 +0200

    machines: Fix incorrect disk format when attaching existing volume
    
    If you attach existing volume as a disk, default storage pool format
    would be used as disk format. That's however not correct, as we should
    use volume's format type as a disk's format type.
    Pool's default format type should be used only as a fallback when volume's
    format type is not present.

Comment 3 Xianghua Chen 2019-12-09 07:02:24 UTC
Verified with packages:
cockpit-machines-208-1.el8.noarch
libvirt-dbus-1.2.0-3.module+el8.1.0+4066+0f1aadab.x86_64

Steps:
1. Create an raw disk by :
# virsh vol-create-as default raw-disk 1G --format raw
2. Login cockpit and Create a VM
3. Switch to the disk tab of the VM, click "Add Disk"
4. Choose "Use Existing" and the new created volume: raw-disk, click Add

The prepared raw disk can be attached successfully.

Comment 5 errata-xmlrpc 2020-04-28 15:43:05 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-2020:1639