Ask Your Question

libvirtError: internal error: No free USB ports

asked 2017-07-05 01:10:03 -0500

ch155260 gravatar image

updated 2017-07-05 03:54:05 -0500

I follow (Openstack Ocata document) to build Openstack on Ubuntu 16.04.

When create VM will get error as (image).

Compute node


2017-07-05 16:21:49.877 32621 ERROR nova.virt.libvirt.guest [req-c733cce0-b6b1-47e5-91b6-c1312b232f38 0d02b621c5a74a4c82e8487e67990135 23869adf315b4f4da8abc0793449688a - - -] Error defining a guest with XML: <domain type="qemu">
2017-07-05 16:21:49.879 32621 ERROR nova.virt.libvirt.driver [req-c733cce0-b6b1-47e5-91b6-c1312b232f38 0d02b621c5a74a4c82e8487e67990135 23869adf315b4f4da8abc0793449688a - - -] [instance: 02be3d00-78a3-4cc5-aa4d-d1b0d177d7e1] Failed to start libvirt guest
2017-07-05 16:21:50.374 32621 ERROR nova.compute.manager [instance: 02be3d00-78a3-4cc5-aa4d-d1b0d177d7e1] libvirtError: internal error: No free USB ports

Log file as (link).


transport_url = rabbit://openstack:111111@controller
my_ip =
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
compute_scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler
auth_strategy = keystone
api_servers = http://controller:9292
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = 111111
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = 111111
lock_path = /var/lib/nova/tmp
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = 111111
enabled = True
vncserver_listen =
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2020-04-03 03:45:04 -0500

nicholas666 gravatar image

This is due to the lack of usb controller in your libvirt XML. you can add this in your nova generated XML.

<controller type='usb' index='0' model='piix3-uhci'>
  <alias name='usb'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>

in nova/virt/libvirt/

class LibvirtConfigGuestUSBHostController(LibvirtConfigGuestController):

def __init__(self, **kwargs):
    super(LibvirtConfigGuestUSBHostController, self).__init__(**kwargs)
    self.type = 'usb'

you can use like this:

   def _guest_add_usb_host_keyboard(self, guest):
    """Add USB Host controller and keyboard for graphical console use.

    Add USB keyboard as PS/2 support may not be present on non-x86
    keyboard = vconfig.LibvirtConfigGuestInput()
    keyboard.type = "keyboard"
    keyboard.bus = "usb"

    usbhost = vconfig.LibvirtConfigGuestUSBHostController()
    usbhost.index = 0
edit flag offensive delete link more

answered 2017-07-05 02:33:26 -0500

Deepa gravatar image

Have a look at this link ( ? Also how does your /etc/nova/nova.conf looks like ?

edit flag offensive delete link more


My compute node /etc/nova/nova.conf as above.

ch155260 gravatar imagech155260 ( 2017-07-05 03:54:50 -0500 )edit

Can you check status as below

sudo service libvirtd status, and restart the service and try to create a VM again .Do this on all nova-compute nodes

Deepa gravatar imageDeepa ( 2017-07-07 01:21:02 -0500 )edit

When service libvirtd restart and create VM have below message on libvirtd service. - service libvirtd status libvirtd[35454]: this function is not supported by the c libvirtd[35454]: Failed to get host CPU libvirtd[35454]: internal error: No free USB port

ch155260 gravatar imagech155260 ( 2017-07-10 02:41:38 -0500 )edit

I dont see a libvirtd section in your nova.conf Check for Finalize Installation section in (

Deepa gravatar imageDeepa ( 2017-07-10 04:58:08 -0500 )edit

[libvirt] cpu_mode=host-passthrough

ch155260 gravatar imagech155260 ( 2017-07-10 22:06:33 -0500 )edit

answered 2017-09-18 03:36:07 -0500

ericxu gravatar image

Please disable vnc and try:

[vnc] enabled = false

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2017-07-05 01:10:03 -0500

Seen: 1,850 times

Last updated: Apr 03