'Given an instance UUID (representing the consumer of resources), the
HostState object for the host that was chosen for the instance, and a
list of allocation request JSON objects, attempt to claim resources for
the instance in the placement API. Returns True if the claim process
was successful, False otherwise.
:param ctx: The RequestContext object
:param spec_obj: The RequestSpec object
:param instance_uuid: The UUID of the consuming instance
:param cn_uuid: UUID of the host to allocate against
:param alloc_reqs: A list of allocation request JSON objects that
allocate against (at least) the compute host
selected by the _schedule() method. These allocation
requests were constructed from a call to the GET
/allocation_candidates placement API call.  Each
allocation_request satisfies the original request
for resources and can be supplied as-is (along with
the project and user ID to the placement API\'s
PUT /allocations/{consumer_uuid} call to claim
resources for the instance'

def _claim_resources(self, ctx, spec_obj, instance_uuid, alloc_reqs):

    LOG.debug('Attempting    to    claim    resources    in    the    placement    API    for    instance    %s', instance_uuid)
    project_id = spec_obj.project_id
    user_id = ctx.user_id
    alloc_req = alloc_reqs[0]
    claimed = self.placement_client.claim_resources(instance_uuid, alloc_req, project_id, user_id)
    if (not claimed):
        return False
    LOG.debug('Successfully    claimed    resources    for    instance    %s    using    allocation    request    %s', instance_uuid, alloc_req)
    return True
