nova/nova/api/openstack
Chris Dent 4a97bbd824 [placement] Enable limiting GET /allocation_candidates
This adds a limit query parameter to GET
/allocation_candidates?limit=5&resource=VCPU:1

A 'limit' filter is added to the AllocationCandidates. If set, after
the database query has been run to create the allocation requests and
provider summaries, a slice or sample of the allocation requests is
taken to limit the results. The summaries are then filtered to only
include those in the allocation requests.

This method avoids needing to make changes to the generated SQL, the
creation of which is fairly complex, or the database tables. The amount
of data queried is still high in the extreme case, but the amount of
data sent over the wire (as JSON) is shrunk. This is a trade-off that
was discussed in the spec and the discussion surrounding its review.
If it turns out that memory use server-side is an issue we can
investigate changing the SQL.

A configuration setting, [placement]/randomize_allocation_candidates,
is added to allow deployers to declare whether they want the results
to be returned in whatever order the database chooses or a random
order. The default is "False" which is expected to preserve existing
behavior and impose a packing placement strategy.

When the config setting is combined with the limit parameter, if
"True" the limited results are a random sampling from the full
results. If "False", it is a slice from the front.

This is done as a new microversion, 1.16, with updates to docs, a reno
and adjustments to the api history doc.

Change-Id: I5f3d4f49c34fd3cd6b9d2e12b3c3c4cdcb409bec
Implements: bp allocation-candidates-limit
2017-12-20 20:08:39 +00:00
..
compute Merge "doc: add note about fixing admin-only APIs without a microversion" 2017-12-19 21:07:14 +00:00
placement [placement] Enable limiting GET /allocation_candidates 2017-12-20 20:08:39 +00:00
__init__.py Remove dead code of api.fault notification sending 2017-10-09 17:29:40 +02:00
api_version_request.py Add pagination and changes-since for instance-actions 2017-12-14 07:42:17 +00:00
auth.py conf: Move api options to a group 2016-11-25 16:32:31 -06:00
common.py Fix TypeError of _get_project_id when project_id is None 2017-11-21 22:21:12 -05:00
extensions.py Remove the objects for describing the extension for v2.1 API 2017-11-29 13:20:15 +08:00
identity.py Use ksa adapter for keystone conf & requests 2017-11-30 22:33:01 +00:00
requestlog.py request_log addition for running under uwsgi 2017-07-24 14:23:38 -04:00
urlmap.py Use of six.PY3 should be forward compatible 2016-01-17 03:32:34 +00:00
versioned_method.py Implement microversion support on api methods 2014-12-05 09:54:41 +08:00
wsgi.py Stop caching compute nodes in the request 2017-06-14 20:35:37 -04:00
wsgi_app.py Fix binary name 2017-09-11 07:34:09 +00:00