Comment 8 for bug 1594230

Revision history for this message
Hironori Shiina (shiina-hironori) wrote :

We can reproduce this bug by deploying ironic with DevStack[1].
It happens with Nova API microversion 2.28 or later as follows.

~$ nova --os-compute-api-version 2.28 hypervisor-show 1
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.ValueError'> (HTTP 500) (Request-ID: req-06578b31-e22d-450f-855c-567ac0c3a804)

~$ nova --os-compute-api-version 2.27 hypervisor-show 1
+-------------------------+--------------------------------------+
| Property | Value |
+-------------------------+--------------------------------------+
| cpu_info | |
| current_workload | 0 |
| disk_available_least | -10 |
| free_disk_gb | 0 |
| free_ram_mb | 0 |
| host_ip | 192.168.122.148 |
| hypervisor_hostname | 70b56477-97ec-4e8d-84f5-cb6f99afe45e |
| hypervisor_type | ironic |
| hypervisor_version | 1 |
| id | 1 |
| local_gb | 0 |
| local_gb_used | 10 |
| memory_mb | 0 |
| memory_mb_used | 1024 |
| running_vms | 1 |
| service_disabled_reason | None |
| service_host | devstack |
| service_id | 6 |
| state | up |
| status | enabled |
| vcpus | 0 |
| vcpus_used | 1 |
+-------------------------+--------------------------------------+

This bug is caused by passing an empty string as cpu_info to jsonutils.loads in nova/api/openstack/compute/hypervisors.py[2].

[1] http://docs.openstack.org/developer/ironic/dev/dev-quickstart.html#deploying-ironic-with-devstack
[2] https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/hypervisors.py#L72