Bug 1207834 - virt-manager doesn't support selecting sata and cdrom at the same time
Summary: virt-manager doesn't support selecting sata and cdrom at the same time
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1176071
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-31 19:46 UTC by Laine Stump
Modified: 2015-05-02 20:01 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1176071
Environment:
Last Closed: 2015-05-02 20:01:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Laine Stump 2015-03-31 19:46:56 UTC
+++ This bug was initially created as a clone of Bug #1176071 +++

(refer to original BZ for background info including investigation leading to this clone)

The symptom is that when you add a 2nd cdrom device to a Q35 domain, it fails to start with an error message like the following:

  qemu-system-x86_64: -device ide-hd,bus=ide.0,unit=1,
  drive=drive-ide0-0-1,id=ide0-0-1:
  Can't create IDE unit 1, bus supports only 1 units

While it is true that libvirt is a) failing to add the necessary -device to qemu's commandline to create an IDE controller and b) mistakenly treating the builtin SATA controller as an IDE controller, it is also the case that if the cdrom was added as "bus='sata'" instead of "bus='ide'", there would have been no confusion, but not only does virt-manager not make this default for Q35 machinetype, it doesn't even allow it.

This BZ is a request for the following in virt-manager:

1) virt-manager shouldn't limit disk devices using a SATA controller to
   prevent CDROM.

2) virt-manager should default the type to new disk devices to SATA (unless we've decided that SCSI support is good enough to be the default).

In the meantime libvirt will fix problems (a) and (b) above, tracked in Bug 1176071.

Comment 1 Cole Robinson 2015-04-04 23:10:51 UTC
Fixed upstream:

commit dd8f7c90c0ab2ccccf341e344f0abd90853d8711
Author: Cole Robinson <crobinso>
Date:   Sat Apr 4 19:07:39 2015 -0400

    addhardware: Allow SATA CDROM (bz 1207834)


And upstream will also default the addhardware wizard to select the bus of the first disk already allocated to the VM, so if your Q35 VM is using SATA, we will do the right thing.

That said, virt-install still uses bus=ide CDROMs when creating a Q35 VM. Laine, should be defaulting to SATA for those as well?

Comment 2 Laine Stump 2015-04-04 23:32:11 UTC
(In reply to Cole Robinson from comment #1)
> Fixed upstream:
> 
> commit dd8f7c90c0ab2ccccf341e344f0abd90853d8711
> Author: Cole Robinson <crobinso>
> Date:   Sat Apr 4 19:07:39 2015 -0400
> 
>     addhardware: Allow SATA CDROM (bz 1207834)
> 

Nice!

> And upstream will also default the addhardware wizard to select the bus of
> the first disk already allocated to the VM, so if your Q35 VM is using SATA,
> we will do the right thing.

What if the first disk uses virtio? We really should always default to SATA for Q35 (and maybe even disallow selecting IDE)
 
> That said, virt-install still uses bus=ide CDROMs when creating a Q35 VM.
> Laine, should be defaulting to SATA for those as well?

Definitely. The Q35 machinetype has a sata controller included, but no ide controller, and currently there isn't any way to add an ide controller (well, with current code, you can add it to the config, but it's essentially ignored when creating the qemu commandline - see this message for the current status and my request for opinions on how to remedy it:

  https://www.redhat.com/archives/libvir-list/2015-April/msg00176.html

The only reason that existing virt-manager/virt-install created guests with a single cdrom work is that qemu has hardcoded the device ID ("alias" in libvirt-speak) of the builtin SATA controller on Q35 to be the same as the builtin IDE controller on i440fx, namely "ide".

Oh %&*%$. Just now I finally realized that we've created a "situation". A lot of people have Q35 domain definitions with

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>

We obviously need to stop silently (and accidentally) connecting this to the builtin SATA controller, but this has been in place long enough that we can't simply disallow bus='ide' for q35 - I think we actually have to provide support for adding an IDE controller to Q35 machines. Sigh. I'm going to reply to my own message about that as soon as I get back from a walk...

Comment 3 Cole Robinson 2015-04-06 17:44:50 UTC
Thanks, pushed a couple more commits:

commit e29f216503106738328d267b33773f54230c2f86
Author: Cole Robinson <crobinso>
Date:   Mon Apr 6 13:43:18 2015 -0400

    guest: Use sata by default for q35 cdrom, non-virtio (bz #1207834)

commit feb010621b480387bd6e4d31573de9e5426cb9f3
Author: Cole Robinson <crobinso>
Date:   Mon Apr 6 13:36:54 2015 -0400

    addhardware: Don't advertise IDE for Q35 (bz #1207834)
    
    Laine suggests we hide it altogether

Comment 4 Fedora Update System 2015-04-13 22:43:52 UTC
virt-manager-1.1.0-6.git310f6527.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/virt-manager-1.1.0-6.git310f6527.fc21

Comment 5 Fedora Update System 2015-04-18 09:34:48 UTC
Package virt-manager-1.1.0-6.git310f6527.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing virt-manager-1.1.0-6.git310f6527.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-6281/virt-manager-1.1.0-6.git310f6527.fc21
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2015-04-18 20:49:20 UTC
virt-manager-1.1.0-7.git310f6527.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/virt-manager-1.1.0-7.git310f6527.fc21


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