Comment 1 for bug 1873521

Revision history for this message
Andrea Ieri (aieri) wrote :

Here are more details about the workaround. If the provider deletion fails because it still has allocations, you need to clean those up first.

Connect to the nova_api db, then:

Find the resource provider id
mysql> select * from resource_providers where name='<hypervisor>';

Find allocations for that provider id (or use a join)
mysql> select * from allocations where resource_provider_id='<id>';
+---------------------+------------+--------+----------------------+--------------------------------------+-------------------+------+
| created_at | updated_at | id | resource_provider_id | consumer_id | resource_class_id | used |
+---------------------+------------+--------+----------------------+--------------------------------------+-------------------+------+
| 2019-10-09 08:59:27 | NULL | 124441 | 17 | 0b48fced-2ed2-4cbc-8ac7-78c71227924c | 0 | 1 |
| 2019-10-09 09:00:01 | NULL | 124459 | 17 | fddeeafa-b460-4103-b561-86dff5f78125 | 0 | 1 |
| 2019-10-09 09:00:25 | NULL | 124477 | 17 | 47c5c56e-c901-40ea-9df3-293c30d9721f | 0 | 1 |
| 2019-10-09 08:59:27 | NULL | 124444 | 17 | 0b48fced-2ed2-4cbc-8ac7-78c71227924c | 1 | 512 |
| 2019-10-09 09:00:01 | NULL | 124462 | 17 | fddeeafa-b460-4103-b561-86dff5f78125 | 1 | 512 |
| 2019-10-09 09:00:25 | NULL | 124480 | 17 | 47c5c56e-c901-40ea-9df3-293c30d9721f | 1 | 512 |
| 2019-10-09 08:59:27 | NULL | 124447 | 17 | 0b48fced-2ed2-4cbc-8ac7-78c71227924c | 2 | 20 |
| 2019-10-09 09:00:01 | NULL | 124465 | 17 | fddeeafa-b460-4103-b561-86dff5f78125 | 2 | 20 |
| 2019-10-09 09:00:25 | NULL | 124483 | 17 | 47c5c56e-c901-40ea-9df3-293c30d9721f | 2 | 20 |
+---------------------+------------+--------+----------------------+--------------------------------------+-------------------+------+
9 rows in set (0.00 sec)

Now you can delete the allocations with `openstack resource provider allocation delete <consumer_id>`