removing a unit leaves a stale provider entry in the nova_api.resource_providers table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Nova Compute Charm |
Triaged
|
Low
|
Unassigned |
Bug Description
In bionic queens, nova-compute charm v269, removing a nova-compute unit will leave a stale entry in the nova_api.
Redeploying a new nova-compute unit onto the same machine (or possibly onto any new machine reusing the same hostname) will then yield a non-functional hypervisor.
Although charm installation will succeed (aside from other reinstallation-
The following will then be seen in the nova-compute.log within the redeployed unit:
2020-04-17 19:05:29.637 1353458 ERROR nova.scheduler.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
2020-04-17 19:05:29.638 1353458 ERROR nova.compute.
Workaround:
Manually delete the stale provider (requires a recent osc-placement client):
name=<hostname of the redeployed unit>.maas
openstack resource provider delete "$(openstack resource provider list --name $name -cuuid -fvalue)"
tags: | added: scaleback |
Changed in charm-nova-compute: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in charm-nova-compute: | |
assignee: | nobody → Hemanth Nakkina (hemanth-n) |
tags: | added: sts |
Changed in charm-nova-compute: | |
assignee: | Hemanth Nakkina (hemanth-n) → nobody |
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 hypervisor> ';
mysql> select * from resource_providers where name='<
Find allocations for that provider id (or use a join) provider_ id='<id> '; ------- ------- -+----- ------- +------ --+---- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------- ------- +------ + provider_ id | consumer_id | resource_class_id | used | ------- ------- -+----- ------- +------ --+---- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------- ------- +------ + 2ed2-4cbc- 8ac7-78c7122792 4c | 0 | 1 | b460-4103- b561-86dff5f781 25 | 0 | 1 | c901-40ea- 9df3-293c30d972 1f | 0 | 1 | 2ed2-4cbc- 8ac7-78c7122792 4c | 1 | 512 | b460-4103- b561-86dff5f781 25 | 1 | 512 | c901-40ea- 9df3-293c30d972 1f | 1 | 512 | 2ed2-4cbc- 8ac7-78c7122792 4c | 2 | 20 | b460-4103- b561-86dff5f781 25 | 2 | 20 | c901-40ea- 9df3-293c30d972 1f | 2 | 20 | ------- ------- -+----- ------- +------ --+---- ------- ------- ----+-- ------- ------- ------- ------- ------- -+----- ------- ------- +------ +
mysql> select * from allocations where resource_
+------
| created_at | updated_at | id | resource_
+------
| 2019-10-09 08:59:27 | NULL | 124441 | 17 | 0b48fced-
| 2019-10-09 09:00:01 | NULL | 124459 | 17 | fddeeafa-
| 2019-10-09 09:00:25 | NULL | 124477 | 17 | 47c5c56e-
| 2019-10-09 08:59:27 | NULL | 124444 | 17 | 0b48fced-
| 2019-10-09 09:00:01 | NULL | 124462 | 17 | fddeeafa-
| 2019-10-09 09:00:25 | NULL | 124480 | 17 | 47c5c56e-
| 2019-10-09 08:59:27 | NULL | 124447 | 17 | 0b48fced-
| 2019-10-09 09:00:01 | NULL | 124465 | 17 | fddeeafa-
| 2019-10-09 09:00:25 | NULL | 124483 | 17 | 47c5c56e-
+------
9 rows in set (0.00 sec)
Now you can delete the allocations with `openstack resource provider allocation delete <consumer_id>`