Nova assumes that USB Host is present

Bug #1745340 reported by Marcin Juszkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned
Pike
In Progress
Medium
Mohammed Naser

Bug Description

I am working on getting OpenStack running on aarch64 architecture. And it is there. But I wanted to have graphical console like it is present on x86.

Went though settings, enabled VNC/Spice and got "libvirtError: internal error: No free USB ports" message instead.

Digged into code and it looks like Nova blindly assumes that USB host is present in VM instance as it just adds usbtablet device and starts an instance.

But it should add USB host device first...

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

host information:
- architecture: aarch64
- distribution: Debian/stable
- libvirt version: 3.10.0
- nova version: Queens (2018.01.21 HEAD)

Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

You're going to want to modify this function:

  https://github.com/openstack/nova/blob/16.0.0/nova/virt/libvirt/driver.py#L5002

Or, more specifically, its caller:

  https://github.com/openstack/nova/blob/16.0.0/nova/virt/libvirt/driver.py#L4966

This generates the device and later adds it. If we're adding a USB tablet, we should ensure we also add a USB hub.

  https://github.com/openstack/nova/blob/16.0.0/nova/virt/libvirt/driver.py#L4870-L4872

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Keyboard presence is probably also assumed.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Change of libvirt defaults can handle that without nova changes.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :
Revision history for this message
Daniel Berrange (berrange) wrote :

Nova should be explicitly adding USB host controllers, rather than relying on arch specific defaults in this area. That libvirt enabled USB by default on x86 is considered a mistake, so hasn't been copied on other architectures. Even on x86 it is better for Nova to explicitly add USB host controllers, since the default host controller model is USB1 which is a very poor choice.

eg For USB2 the recommended XML would be:

    <controller type='usb' index='0' model='ich9-ehci1'>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
    </controller>

int32bit (int32bit)
Changed in nova:
assignee: nobody → int32bit (int32bit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/538003

Changed in nova:
assignee: int32bit (int32bit) → Marcin Juszkiewicz (hrw)
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: aarch64 libvirt
tags: added: console
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/538003
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b92e3bc95fd69759031b7439b7f8392926910cc2
Submitter: Zuul
Branch: master

commit b92e3bc95fd69759031b7439b7f8392926910cc2
Author: Marcin Juszkiewicz <email address hidden>
Date: Thu Jan 25 20:00:37 2018 +0100

    Make sure that we have usable input for graphical console

    Graphical console is optional thing. But when it is enabled then it is
    good to have some input devices.

    On x86(-64) it is handled by PS/2 keyboard/mouse. On ppc64 we have USB
    keyboard/mouse. On aarch64 we have nothing.

    So make sure that we have USB Host controller available and that usb
    keyboard is present. Also USB tablet (default pointer_model device) will
    have a port to plug to.

    Closes-bug: 1745340

    Change-Id: I69a934d188446a1aa95ab33975dbe1d6e058ebf9

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0rc1

This issue was fixed in the openstack/nova 17.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/564320

Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/pike)

Change abandoned by Mohammed Naser (<email address hidden>) on branch: stable/pike
Review: https://review.openstack.org/564320
Reason: I don't have the resources to finish this backport and we're on Queens, abandoning..

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.