37301f2f27
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 |
||
---|---|---|
.. | ||
tasks | ||
__init__.py | ||
api.py | ||
manager.py | ||
rpcapi.py |