nova/nova/scheduler
Balazs Gibizer 6f1a1f5e8e Consumer gen support for delete instance allocations
The placement API version 1.28 introduced consumer generation as a way
to make updating allocation safe even if it is done from multiple
places.

This patch changes delete_allocation_for_instance to use PUT
/allocations instead of DELETE /allocations to benefit from the consumer
generation handling.

In this patch the report client will GET the current allocation of the
instance including the consumer generation and then try to PUT an empty
allocation with that generation. If this fails due to a consumer
generation conflict, meaning something modified the allocation of the
instance in between GET and PUT then the report client will raise
AllocationDeleteFailed exception. This will cause that the instance
goes to ERROR state.

This patch only detects a small portion of possible cases when
allocation is modified outside of the delete code path. The rest can
only be detected if nova would cache at least the consumer generation
of the instance.

To be able to put the instance state to ERROR the instance.destroy()
call is moved to the end to of the deletion call path. To keep the
instance.delete.end notification behavior consistent with this move
(e.g. deleted_at field is filled) the notification sending needed to
be moved too.

Blueprint: use-nested-allocation-candidates
Change-Id: I77f34788dd7ab8fdf60d668a4f76452e03cf9888
2018-09-25 11:16:37 +02:00
..
client Consumer gen support for delete instance allocations 2018-09-25 11:16:37 +02:00
filters Deprecate Core/Ram/DiskFilter 2018-08-24 19:32:27 -04:00
weights Change deprecated policies to policy 2018-07-27 02:20:30 +00:00
__init__.py Improve hacking rule to avoid author markers 2014-05-05 14:35:20 +02:00
caching_scheduler.py Mark Chance and Caching schedulers as deprecated 2017-08-09 10:53:53 -07:00
driver.py Remove [scheduler]/host_manager config option 2018-05-03 09:39:26 -04:00
filter_scheduler.py Update RequestSpec.instance_uuid during scheduling 2018-07-19 14:50:09 -04:00
host_manager.py Do not dump all instances in the scheduler 2018-09-07 15:56:51 +03:00
manager.py Fix confusing log message in scheduler 2018-07-18 11:16:33 +03:00
request_filter.py Honor availability_zone hint via placement 2018-05-22 08:56:50 -07:00
rpcapi.py Modify select_destinations() to return objects and alts 2017-12-07 15:01:13 +00:00
utils.py Make scheduler.utils.setup_instance_group query all cells 2018-08-24 23:44:58 +00:00