nova api return HTTP 500 error when interface attach failed due to lack of instance PCI slots
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Description
===========
When no more pci slot are available for hot pluggable network interface, nova api return HTTP 500 internal error which is not very helpfull from client point of view.
It seems that nova catch all libvirt error and raise:
nova.exception.
Should it be better to handle "libvirt.
https:/
Steps to reproduce
==================
On a fresh devstack master install
1) spawn one instance
2) create 30 network interfaces
for i in $(seq 2 30) ; do openstack port create --network private port-${i} ; done
3) Attach interface to isntances:
for i in $(seq 2 30) ; do openstack server add port 0c6d2b7a-
last attach ones should failed we the folling out put:
openstack server add port 0c6d2b7a-
Failed to attach network adapter device to 0c6d2b7a-
in Logs:
Jun 03 09:02:06 alex-devstack nova-compute[
Jun 03 09:02:06 alex-devstack nova-compute[
Jun 03 09:02:06 alex-devstack nova-compute[
...
Jun 03 09:02:22 alex-devstack nova-compute[
Jun 03 09:02:22 alex-devstack nova-compute[
Jun 03 09:02:22 alex-devstack nova-compute[
Expected result
===============
Getting HTTP conflict or other explicit response indicating that we reach a limit.
Actual result
=============
Getting HTTP 500 internal error.
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
I can reproduce the problem.
Libvirt reports this as internal error (VIR_ERR_ INTERNAL_ ERROR = 1 (0x1)) and only the error message gives a hint that the fault is due to running out of PCI slots. However I don't like the idea to parse the libvirt error message in nova. I suggest instead to reach out to the libvirt community to either remove this limit or at least return a specific error code so nova can differentiate other libvirt internal errors from reaching this slot limit.