commit b2f438bab4a0fdaa37b1a57cff0b27fb2a3f3437
Author: Matt Riedemann <email address hidden>
Date: Fri May 3 15:23:57 2019 -0400
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.
Reviewed: https:/ /review. opendev. org/666862 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b2f438bab4a 0fdaa37b1a57cff 0b27fb2a3f3437
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit b2f438bab4a0fda a37b1a57cff0b27 fb2a3f3437
Author: Matt Riedemann <email address hidden>
Date: Fri May 3 15:23:57 2019 -0400
Delete resource providers for all nodes when deleting compute service
Change I7b8622b178d504 3ed1556d7bdceaf 60f47e5ac80 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 portClient. delete_ resource_ provider method ignores viderInUse errors, and we could have stale allocations resource_ provider is not accounting,
SchedulerRe
ResourcePro
on the host for which delete_
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 fbba16e969f2163 98dee15b37a9569 in Queens.
Ie1aa45a508
Change-Id: I9e852e25ea89f3 2bf19cdaeb1f5da c8f749f5dbc f78552b82abc114 bb4b84930e) da78ef96d09d8f5 282b86f648) 76f0b9bf9780eea db38232def)
Closes-Bug: #1811726
(cherry picked from commit 650fe118d128f09
(cherry picked from commit e9889be94ee58a6
(cherry picked from commit 64d52788831f0e6