Block deleting compute services with in-progress migrations
This builds on I0bd63b655ad3d3d39af8d15c781ce0a45efc8e3a
which made DELETE /os-services/{service_id} fail with a 409
response if the host has instances on it. This change checks
for in-progress migrations involving the nodes on the host,
either as the source or destination nodes, and returns a 409
error response if any are found.
Failling to do this can lead to orphaned resource providers
in placement and also failing to properly confirm or revert
a pending resize or cold migration.
A release note is included for the (justified) behavior
change in the API. A new microversion should not be required
for this since admins should not have to opt out of broken
behavior.
Change-Id: I70e06c607045a1c0842f13069e51fef438012a9c
Closes-Bug: #1852610
This commit is contained in:
@@ -349,6 +349,12 @@ Attempts to delete a ``nova-compute`` service which is still hosting instances
|
||||
will result in a 409 HTTPConflict response. The instances will need to be
|
||||
migrated or deleted before a compute service can be deleted.
|
||||
|
||||
Similarly, attempts to delete a ``nova-compute`` service which is involved in
|
||||
in-progress migrations will result in a 409 HTTPConflict response. The
|
||||
migrations will need to be completed, for example confirming or reverting a
|
||||
resize, or the instances will need to be deleted before the compute service can
|
||||
be deleted.
|
||||
|
||||
.. important:: Be sure to stop the actual ``nova-compute`` process on the
|
||||
physical host *before* deleting the service with this API.
|
||||
Failing to do so can lead to the running service re-creating
|
||||
|
||||
Reference in New Issue
Block a user