nova/nova/tests/unit/api/openstack
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
..
compute Delete resource providers for all nodes when deleting compute service 2019-06-21 10:51:52 -04:00
placement Merge "placement: skip authentication on root URI" 2017-12-27 13:43:51 +00:00
__init__.py
common.py [python3] Webob request body should be bytes 2015-12-28 13:51:29 -05:00
fakes.py Merge "Merge ResourceV21 obj into Resource obj" 2018-01-27 15:28:51 +00:00
test_api_version_request.py Use assert(Not)Equal instead of assertTrue(A == X) 2016-06-03 16:53:15 +01:00
test_common.py Fix TypeError of _get_project_id when project_id is None 2017-11-21 22:21:12 -05:00
test_faults.py [Py34] api.openstack.test_faults.TestFaultWrapper 2015-12-10 20:56:42 +00:00
test_legacy_v2_compatible_wrapper.py Trivial-Fix: Fix typos 2016-06-13 06:41:08 +00:00
test_mapper.py [Py34] Enable api.openstack.test_mapper unit test 2015-10-05 18:59:28 +03:00
test_requestlog.py log test: use fixtures.StandardLogging in setUp 2018-01-04 10:38:49 +08:00
test_wsgi.py Merge ResourceV21 obj into Resource obj 2017-12-21 19:33:35 +08:00