Trivial: fix spelling of allocation_request
Reviews of other patches in this series raised the criticism that the term 'allocation request' was being used, when the proper name for it should be 'allocation_request'. I've broken these simple corrections into a separate patch so as not to clutter up the other patches. Blueprint: return-alternate-hosts Change-Id: Idd2b9e3b0000fa8eeb2e0e9c3337b1d99b13ada7
This commit is contained in:
@@ -153,7 +153,7 @@ def _instance_to_allocations_dict(instance):
|
||||
|
||||
def _move_operation_alloc_request(source_allocs, dest_alloc_req):
|
||||
"""Given existing allocations for a source host and a new allocation
|
||||
request for a destination host, return a new allocation request that
|
||||
request for a destination host, return a new allocation_request that
|
||||
contains resources claimed against both source and destination, accounting
|
||||
for shared providers.
|
||||
|
||||
@@ -163,10 +163,10 @@ def _move_operation_alloc_request(source_allocs, dest_alloc_req):
|
||||
|
||||
:param source_allocs: Dict, keyed by resource provider UUID, of resources
|
||||
allocated on the source host
|
||||
:param dest_alloc_request: The allocation request for resources against the
|
||||
:param dest_alloc_request: The allocation_request for resources against the
|
||||
destination host
|
||||
"""
|
||||
LOG.debug("Doubling-up allocation request for move operation.")
|
||||
LOG.debug("Doubling-up allocation_request for move operation.")
|
||||
# Remove any allocations against resource providers that are
|
||||
# already allocated against on the source host (like shared storage
|
||||
# providers)
|
||||
@@ -205,7 +205,7 @@ def _move_operation_alloc_request(source_allocs, dest_alloc_req):
|
||||
scheduler_utils.merge_resources(current_alloc['resources'],
|
||||
alloc['resources'])
|
||||
|
||||
LOG.debug("New allocation request containing both source and "
|
||||
LOG.debug("New allocation_request containing both source and "
|
||||
"destination hosts in move operation: %s", new_alloc_req)
|
||||
return new_alloc_req
|
||||
|
||||
@@ -330,16 +330,16 @@ class SchedulerReportClient(object):
|
||||
def get_allocation_candidates(self, resources):
|
||||
"""Returns a tuple of (allocation_requests, provider_summaries).
|
||||
|
||||
The allocation requests are a collection of potential JSON objects that
|
||||
The allocation_requests are a collection of potential JSON objects that
|
||||
can be passed to the PUT /allocations/{consumer_uuid} Placement REST
|
||||
API to claim resources against one or more resource providers that meet
|
||||
the requested resource constraints.
|
||||
|
||||
The provider summaries is a dict, keyed by resource provider UUID, of
|
||||
inventory and capacity information for any resource provider involved
|
||||
in the allocation requests.
|
||||
in the allocation_requests.
|
||||
|
||||
:returns: A tuple with a list of allocation request dicts and a dict of
|
||||
:returns: A tuple with a list of allocation_request dicts and a dict of
|
||||
provider information or (None, None) if the request failed
|
||||
|
||||
:param resources: A dict, keyed by resource class name, of requested
|
||||
@@ -1009,7 +1009,7 @@ class SchedulerReportClient(object):
|
||||
placement's PUT /allocations API
|
||||
:param project_id: The project_id associated with the allocations.
|
||||
:param user_id: The user_id associated with the allocations.
|
||||
:param attempt: The attempt at claiming this allocation request (used
|
||||
:param attempt: The attempt at claiming this allocation_request (used
|
||||
in recursive retries)
|
||||
:returns: True if the allocations were created, False otherwise.
|
||||
"""
|
||||
|
||||
@@ -55,11 +55,11 @@ class FilterScheduler(driver.Scheduler):
|
||||
:param instance_uuids: List of UUIDs, one for each value of the spec
|
||||
object's num_instances attribute
|
||||
:param alloc_reqs_by_rp_uuid: Optional dict, keyed by resource provider
|
||||
UUID, of the allocation requests that may
|
||||
UUID, of the allocation_requests that may
|
||||
be used to claim resources against
|
||||
matched hosts. If None, indicates either
|
||||
the placement API wasn't reachable or
|
||||
that there were no allocation requests
|
||||
that there were no allocation_requests
|
||||
returned by the placement API. If the
|
||||
latter, the provider_summaries will be an
|
||||
empty dict, not None.
|
||||
@@ -124,11 +124,11 @@ class FilterScheduler(driver.Scheduler):
|
||||
:param spec_obj: The RequestSpec object
|
||||
:param instance_uuids: List of instance UUIDs to place or move.
|
||||
:param alloc_reqs_by_rp_uuid: Optional dict, keyed by resource provider
|
||||
UUID, of the allocation requests that may
|
||||
UUID, of the allocation_requests that may
|
||||
be used to claim resources against
|
||||
matched hosts. If None, indicates either
|
||||
the placement API wasn't reachable or
|
||||
that there were no allocation requests
|
||||
that there were no allocation_requests
|
||||
returned by the placement API. If the
|
||||
latter, the provider_summaries will be an
|
||||
empty dict, not None.
|
||||
@@ -201,14 +201,14 @@ class FilterScheduler(driver.Scheduler):
|
||||
|
||||
# Attempt to claim the resources against one or more resource
|
||||
# providers, looping over the sorted list of possible hosts
|
||||
# looking for an allocation request that contains that host's
|
||||
# looking for an allocation_request that contains that host's
|
||||
# resource provider UUID
|
||||
claimed_host = None
|
||||
for host in hosts:
|
||||
cn_uuid = host.uuid
|
||||
if cn_uuid not in alloc_reqs_by_rp_uuid:
|
||||
LOG.debug("Found host state %s that wasn't in "
|
||||
"allocation requests. Skipping.", cn_uuid)
|
||||
"allocation_requests. Skipping.", cn_uuid)
|
||||
continue
|
||||
|
||||
alloc_reqs = alloc_reqs_by_rp_uuid[cn_uuid]
|
||||
@@ -252,7 +252,7 @@ class FilterScheduler(driver.Scheduler):
|
||||
def _claim_resources(self, ctx, spec_obj, instance_uuid, alloc_reqs):
|
||||
"""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
|
||||
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.
|
||||
|
||||
@@ -260,7 +260,7 @@ class FilterScheduler(driver.Scheduler):
|
||||
: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
|
||||
: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
|
||||
@@ -282,11 +282,11 @@ class FilterScheduler(driver.Scheduler):
|
||||
# the spec object?
|
||||
user_id = ctx.user_id
|
||||
|
||||
# TODO(jaypipes): Loop through all allocation requests instead of just
|
||||
# TODO(jaypipes): Loop through all allocation_requests instead of just
|
||||
# trying the first one. For now, since we'll likely want to order the
|
||||
# allocation requests in the future based on information in the
|
||||
# allocation_requests in the future based on information in the
|
||||
# provider summaries, we'll just try to claim resources using the first
|
||||
# allocation request
|
||||
# allocation_request
|
||||
alloc_req = alloc_reqs[0]
|
||||
|
||||
return self.placement_client.claim_resources(instance_uuid,
|
||||
|
||||
Reference in New Issue
Block a user