nova/nova/tests/unit/api
Matt Riedemann b2f438bab4 Delete resource providers for all nodes when deleting compute service
Change I7b8622b178d5043ed1556d7bdceaf60f47e5ac80 started deleting the
compute node resource provider associated with a compute node when
deleting a nova-compute service. However, it would only delete the
first compute node associated with the service which means for an
ironic compute service that is managing multiple nodes, the resource
providers were not cleaned up in placement. This fixes the issue by
iterating all the compute nodes and cleaning up their providers.
Note this could be potentially a lot of nodes, but we don't really
have many good options here but to iterate them and clean them up
one at a time.

Note that this is best-effort but because of how the
SchedulerReportClient.delete_resource_provider method ignores
ResourceProviderInUse errors, and we could have stale allocations
on the host for which delete_resource_provider is not accounting,
namely allocations from evacuated instances (or incomplete migrations
though you can't migrate baremetal instances today), we could still
delete the compute service and orphan those in-use providers. That,
however, is no worse than before this change where we did not try
to cleanup all providers. The issue described above is being tracked
with bug 1829479 and will be dealt with separately.

Conflicts:
      nova/tests/unit/api/openstack/compute/test_services.py

NOTE(mriedem): The conflict is due to not having change
Ie1aa45a508fbba16e969f216398dee15b37a9569 in Queens.

Change-Id: I9e852e25ea89f32bf19cdaeb1f5dac8f749f5dbc
Closes-Bug: #1811726
(cherry picked from commit 650fe118d1)
(cherry picked from commit e9889be94e)
(cherry picked from commit 64d5278883)
2019-06-21 10:51:52 -04:00
..
openstack Delete resource providers for all nodes when deleting compute service 2019-06-21 10:51:52 -04:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
test_auth.py conf: Move api options to a group 2016-11-25 16:32:31 -06:00
test_compute_req_id.py Migrate to oslo request_id middleware - mv 2.46 2017-05-27 10:11:44 +00:00
test_wsgi.py Capture stdout in for test_wsgi:test_debug 2016-09-26 06:45:08 -04:00