Nova assumes that USB Host is present

Bug #1745340 reported by Marcin Juszkiewicz on 2018-01-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Marcin Juszkiewicz
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...

Marcin Juszkiewicz (hrw) wrote :
Marcin Juszkiewicz (hrw) wrote :

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

You're going to want to modify this function:

Or, more specifically, its caller:

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

Marcin Juszkiewicz (hrw) wrote :

Keyboard presence is probably also assumed.

Marcin Juszkiewicz (hrw) wrote :

Change of libvirt defaults can handle that without nova changes.

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 type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>

int32bit (int32bit) on 2018-01-25
Changed in nova:
assignee: nobody → int32bit (int32bit)

Fix proposed to branch: master

Changed in nova:
assignee: int32bit (int32bit) → Marcin Juszkiewicz (hrw)
status: New → In Progress
Matt Riedemann (mriedem) on 2018-01-31
tags: added: aarch64 libvirt
tags: added: console

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

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

Matt Riedemann (mriedem) on 2018-04-25
Changed in nova:
importance: Undecided → Medium

Change abandoned by Mohammed Naser (<email address hidden>) on branch: stable/pike
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  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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