nova/nova/tests/functional/notification_sample_tests
Lee Yarwood bf89a23d91 api: Reject requests to force up computes when `done` evacuation records exist
When evacuating an instance the evacuation migration record moves from a
state of `accepted` to `pre-migrating` and eventually `done` once the
instance has been rebuilt on the new compute host. At present the
migration record remains in this state until the original compute host
is restarted and the service cleans up any leftovers of the instance
before it is moved to a state of `completed`.

Bug #1922053 details a use case where an operator might unintentionally
forget to ensure the compute service is restarted before forcing the
service up leaving evacuation migration records stuck as `done`.

This could become an issue in the future if the instance is moved back
to this compute before the service is restarted. Any future restart
invoking the cleanup logic and potentially damaging the running
instance.

This change aims to address this by blocking requests to force up
computes associated to `done` evacuation records. Forcing operators to
restart the service allowing them to move to a `completed` state before
the service can be forced up again.

To allow this to be backportable these requests are rejected with a 400
BadRequest return code from the API. A TODO is left to move this to a
409 Conflict during the Xena release under a new microversion.

Finally, some additional functional tests have been updated to ensure
they restart the source compute service of an evacuation before
attempting to force up the service, ensuring any migration records are
marked as completed.

Closes-Bug: #1922053
Change-Id: I95882ea28564a31a6b4f8b665de462774d84edfc
2021-04-01 19:28:34 +01:00
..
__init__.py Adds json sample for the versioned notifications 2016-01-28 15:31:21 +01:00
notification_sample_base.py functional: Add and use 'GlanceFixture' 2020-09-16 11:31:23 +01:00
test_aggregate.py Add Aggregate image caching progress notifications 2019-10-29 08:18:32 -07:00
test_compute_task.py Use _evacuate_server helper in func test 2020-11-04 13:23:40 +00:00
test_exception_notification.py Add full traceback to ExceptionPayload in versioned notifications 2018-06-19 16:46:46 +08:00
test_flavor.py trivial: Use recognized extra specs in tests 2020-02-19 08:24:31 +00:00
test_instance.py api: Reject requests to force up computes when `done` evacuation records exist 2021-04-01 19:28:34 +01:00
test_keypair.py Transform keypair.import notification 2017-10-30 16:44:29 -04:00
test_libvirt.py Transform libvirt.error notification 2018-09-18 07:06:09 +00:00
test_metrics.py Use a static resource tracker in compute manager 2019-01-17 06:34:29 +00:00
test_server_group.py nova-net: Remove final references to nova-net from functional tests 2019-11-29 17:20:02 +00:00
test_service.py Avoid timeout from service update notification tests 2019-08-12 17:49:11 +02:00
test_volume.py nova-net: Remove final references to nova-net from functional tests 2019-11-29 17:20:02 +00:00