Cannot delete nova-compute service due to service ID conflict

Bug #1891346 reported by Pierre Riteau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

I am trying to delete a nova-compute service for a retired hypervisor:

$ openstack compute service delete 124
Failed to delete compute service with ID '124': Service id 124 refers to multiple services. (HTTP 400) (Request-ID: req-05e01880-237c-4efd-8c54-2899ccbf7316)
1 of 1 compute services failed to delete.

This is caused by a conflicting service with the same ID in nova_cell0:

MariaDB [nova_cell0]> SELECT * FROM services WHERE id = 124;
+---------------------+------------+------------+-----+---------------+---------------+-------+--------------+----------+---------+-----------------+--------------+-------------+---------+--------------------------------------+
| created_at | updated_at | deleted_at | id | host | binary | topic | report_count | disabled | deleted | disabled_reason | last_seen_up | forced_down | version | uuid |
+---------------------+------------+------------+-----+---------------+---------------+-------+--------------+----------+---------+-----------------+--------------+-------------+---------+--------------------------------------+
| 2020-05-27 18:43:34 | NULL | NULL | 124 | 172.16.52.246 | nova-metadata | NULL | 0 | 0 | 0 | NULL | NULL | 0 | 40 | cb03be2c-cd62-4d48-a2eb-424df70862c5 |
+---------------------+------------+------------+-----+---------------+---------------+-------+--------------+----------+---------+-----------------+--------------+-------------+---------+--------------------------------------+

This service in cell0 appears to have been created at the time of an upgrade from Stein to Train.

Environment
===========

python2-novaclient-15.1.0-1.el7.noarch
python2-nova-20.2.0-1.el7.noarch
openstack-nova-api-20.2.0-1.el7.noarch
openstack-nova-common-20.2.0-1.el7.noarch

Revision history for this message
John Garbutt (johngarbutt) wrote :

@Piere do you have this issue with the Nova CLI that uses the new API where we use uuid rather than DB ids.

The problem is cells related here, after cells the old API always has this problem sadly.

Might need to make sure this OpenStack CLI bug is fixed by adopting the newer API microversion where available?

Revision history for this message
Pierre Riteau (priteau) wrote :

Actually the API documentation explains that integer service IDs may not uniquely identify a service in a multi-cell deployment: https://docs.openstack.org/api-ref/compute/?expanded=delete-compute-service-detail#id381

Changed in nova:
status: New → Won't Fix
Revision history for this message
Pierre Riteau (priteau) wrote :

And use a newer microversion in openstackclient:

List compute services. Using ``--os-compute-api-version`` 2.53 or greater will
return the ID as a UUID value which can be used to uniquely identify the
service in a multi-cell deployment.

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.