nova/nova/conductor
Balazs Gibizer 37301f2f27 consumer gen: support claim_resources
This patch adds the handling of consumer generation conflict for the
scheduler report client claim_resources function.

Note that almost every instance move operation uses the migration.uuid
to hold the source node allocation while attempting to allocate on the
destination for the instance. The only exception is evacuation as during
evacuation both the source and the destination allocations are held by
the instance.uuid as consumer.

There are three major cases handled regarding consumer generation
conflicts during claim_resources:

* The caller wants to claim resources and assumes that the provided
  consumer is a new consumer. For example scheduler claims during the
  build of a new instance or during the move of an existing
  instance and the source allocation is held by the migration_uuid. In
  this case if Placement returns consumer generation conflict then there
  is a serious inconsistency about that consumer. So this patch
  ensures that the operation is aborted.

* The caller knows that there is allocation on the consumer before
  calling claim and reads the current allocation from Placement. The
  only example of this in the current codebase is forced evacuation. In
  this case the caller provides the consumer_generation to
  claim_resources. If Placement returns consumer generaton conflict then
  the caller aborts the operation.

* The scheduler wants to claim resources for a non-forced evacuation.
  The scheduler does not know that it is an evacuate operation and the
  scheduler only sees allocation candidates. Therefore the scheduler
  uses the same code path as in the first case and calls claim_resources
  without providing consumer generation. In this case the
  claim_resources code needs to read the actual consumer generation
  from Placement. If during this claim Placement returns consumer
  generaton conflict then claim_resource will raise and let the caller
  abort the opertion.

Blueprint: use-nested-allocation-candidates
Change-Id: I097732754b67bd5cf50abd15db7da3f013b6cdd5
2018-10-04 13:37:37 +02:00
..
tasks consumer gen: support claim_resources 2018-10-04 13:37:37 +02:00
__init__.py Remove conductor local api:s and 'use_local' config option 2016-10-18 14:26:06 +02:00
api.py In Python3.7 async is a keyword [1] 2018-07-20 12:21:34 -04:00
manager.py consumer gen: support claim_resources 2018-10-04 13:37:37 +02:00
rpcapi.py Merge "conf: Remove '[conductor] topic' opt" 2018-03-13 08:00:43 +00:00