nova/nova/scheduler/client
John Garbutt d984a6d886 Tell oslo.limit how to count nova resources
A follow on patch will use this code to enforce the limits, this patch
provides integration with oslo.limit and a new internal nova API that is
able to enforce those limits.

The first part is providing a callback for oslo.limit to be able to count
the resources being used. We only count resources grouped by project_id.

For counting servers, we make use of the instance mappings list in the
api database, just as the existing quota code does. While we do check to
ensure the queued for delete migration has been completed, we simply
error out if that is not the case, rather than attempting to fallback to
any other counting system. We hope one day we can count this in
placement using consumer records, or similar.

For counting all other resource usage, they must refer to some usage
relating to a resource class being consumed in placement. This is similar
to how the count with placement variant of the existing placement code
works today. This is not restricted to RAM and VCPU, it is open to any
resource class that is known to placement.

The second part is the enforcement method, that keeps a similar
signature to the existing enforce_num_instnaces call that is use to
check quotas using the legacy quota system.

From the flavor we extract the current resource usage. This is
considered the simplest first step that helps us deliver Ironic limits
alongside all the existing RAM and VCPU limits. At a later date, we
would ideally get passed a more complete view of what resources are
being requested from placement.

NOTE: given the instance object doesn't exist when enforce is called, we
can't just pass the instance into here.

A [workarounds] option is also available for operators who need the
legacy quota usage behavior where VCPU = VCPU + PCPU.

blueprint unified-limits-nova

Change-Id: I272b59b7bc8975bfd602640789f80d2d5f7ee698
2022-02-24 16:21:02 +00:00
..
__init__.py Rip out the SchedulerClient 2019-01-16 18:35:26 +00:00
query.py Modify select_destinations() to return objects and alts 2017-12-07 15:01:13 +00:00
report.py Tell oslo.limit how to count nova resources 2022-02-24 16:21:02 +00:00