'nova hypervisor-servers' returns unexpected results when working with Ironic

Bug #1815793 reported by Tzu-Mainn Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Triaged
Wishlist
Unassigned

Bug Description

Description
===========
I have a baremetal environment using Nova to schedule on top of four Ironic baremetal nodes. I successfully deployed an instance to one of those nodes. Then I ran 'nova hypervisor-servers' against each of the nodes, and the instance showed up against every node.

Steps to reproduce
==================
After registering the nodes in Ironic and creating the server, I can see that the server is deployed on a single Ironic node:

[stack@localhost compute(keystone_admin)]$ openstack hypervisor list
+----+--------------------------------------+-----------------+-------------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP | State |
+----+--------------------------------------+-----------------+-------------+-------+
| 1 | a00696d5-32ba-475e-9528-59bf11cffea6 | ironic | 192.168.1.2 | up |
| 2 | 534653c9-890d-4b25-9d6d-f4f260945384 | ironic | 192.168.1.2 | up |
| 5 | dba7d2e5-0013-48c7-8dc3-2ccc949f4715 | ironic | 192.168.1.2 | up |
| 7 | 015954fa-c900-4798-8c04-808a1504fe35 | ironic | 192.168.1.2 | up |
+----+--------------------------------------+-----------------+-------------+-------+
[stack@localhost compute(keystone_admin)]$ openstack server list
+--------------------------------------+------------+--------+----------------------------+---------+------------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+------------+--------+----------------------------+---------+------------+
| 8b09bb55-c288-4d95-8caf-60550a661350 | instance-0 | ACTIVE | provisioning=192.168.1.221 | centos7 | trait-test |
+--------------------------------------+------------+--------+----------------------------+---------+------------+
[stack@localhost compute(keystone_admin)]$ openstack baremetal node list
+--------------------------------------+---------+--------------------------------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------+--------------------------------------+-------------+--------------------+-------------+
| a00696d5-32ba-475e-9528-59bf11cffea6 | dell-14 | None | power off | available | False |
| 534653c9-890d-4b25-9d6d-f4f260945384 | dell-15 | None | power off | available | False |
| dba7d2e5-0013-48c7-8dc3-2ccc949f4715 | dell-12 | None | power off | available | False |
| 015954fa-c900-4798-8c04-808a1504fe35 | dell-13 | 8b09bb55-c288-4d95-8caf-60550a661350 | power on | active | False |
+--------------------------------------+---------+--------------------------------------+-------------+--------------------+-------------+

Then, if I run 'nova hypervisor-servers', the one instance shows up for multiple nodes:

[stack@localhost compute(keystone_admin)]$ nova hypervisor-servers 015954fa-c900-4798-8c04-808a1504fe35
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| ID | Name | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| 8b09bb55-c288-4d95-8caf-60550a661350 | instance-00000012 | 015954fa-c900-4798-8c04-808a1504fe35 | 015954fa-c900-4798-8c04-808a1504fe35 |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
[stack@localhost compute(keystone_admin)]$ nova hypervisor-servers a00696d5-32ba-475e-9528-59bf11cffea6
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| ID | Name | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| 8b09bb55-c288-4d95-8caf-60550a661350 | instance-00000012 | a00696d5-32ba-475e-9528-59bf11cffea6 | a00696d5-32ba-475e-9528-59bf11cffea6 |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
[stack@localhost compute(keystone_admin)]$ nova hypervisor-servers 534653c9-890d-4b25-9d6d-f4f260945384
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| ID | Name | Hypervisor ID | Hypervisor Hostname |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+
| 8b09bb55-c288-4d95-8caf-60550a661350 | instance-00000012 | 534653c9-890d-4b25-9d6d-f4f260945384 | 534653c9-890d-4b25-9d6d-f4f260945384 |
+--------------------------------------+-------------------+--------------------------------------+--------------------------------------+

Expected result
===============
The instance only shows up when 'nova hypervisor-servers' is run against the node where the instance is deployed.

Actual result
=============
The instance shows up when 'nova hypervisor-servers' is run against any node.

Environment
===========
nova @ ad842aa
ironic @ 4404292.

Revision history for this message
Vladyslav Drok (vdrok) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

More details in the IRC discussion about this:

http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-02-13.log.html#t2019-02-13T17:34:32

But yeah that API is not baremetal-friendly and we could probably easily change that but it would require a new microversion which means a blueprint and spec:

https://docs.openstack.org/nova/latest/contributor/blueprints.html

Changed in nova:
importance: Undecided → Wishlist
status: New → Triaged
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.