List servers by hypervisor doesn't support ids

Bug #1730975 reported by Forest Romain on 2017-11-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Forest Romain

Bug Description

compute_node_search_by_hypervisor[1] (used by GET http://nova/v2/tenant_id/os-hypervisors/<hypervisor-id>/servers) searchs hypervisor using "like" hypervisor name instead of using hypervisor id.

For example:

Lets assume that we have hypervisors hyp1 (with id=9), hyp2 (with id=1), hyp11 (with id=2):
returns information on an hypervisor using its id as key
=> http://nova/v2/tenant_id/os-hypervisors/1 returns information on hyp2

returns information on hypervisor(s) using a like query on hypervisor hostname.
=> http://nova/v2/tenant_id/os-hypervisors/1/servers returns servers on hyp1 and hyp12 (because "hyp1" and "hyp12" contain "1")

It seems inconsistent, usually REST APIs use resource ids not resource names (nor even worse like resource names).

This trouble affects at least kilo, ocata and queen. According to git it affects every version supporting this feature.


Changed in nova:
assignee: nobody → Forest Romain (romain-forest)
description: updated
description: updated
description: updated
description: updated
description: updated

Fix proposed to branch: master

Changed in nova:
status: New → In Progress

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Reason: I agree that since this is a deprecated API, it seems wrong to make changes to it even if the changes themselves make sense. In any case, given that this effort has stalled, I'm going to abandon this. Please re-open and raise in the weekly meeting [1] or on the openstack-discuss mailing list if you think this should be addressed


To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers