Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scheduler: Flatten 'ResourceRequest.from_extra_specs', 'from_image_pr…
…ops' The 'ResourceRequest' object sources information from three different attributes of an instance: the instance's image metadata properties, the instance's flavor, this flavor's extra specs. It's possible for a user to override resources requested via the flavor using flavor extra specs (e.g. using the 'resources:VCPU=N' extra spec), and it's possible to override traits requested via the flavor extra specs using image metadata (e.g. using the 'traits_required=foo' metadata property). This means there's an implicit hierarchy present: - Traits: image metadata > flavor extra specs - Resources: flavor extra specs > flavor Previously, we pulled information from the flavor extra specs and image metadata using two classmethods, 'from_extra_specs' and 'from_image_props', but this required a lot of glue code in between to ensure this hierarchy was maintained. Stop doing this, preferring to centralize everything in one location. This results in fewer LoC and a more grokable implementation, and will make things much easier when we start handling 'PCPU's here. Part of blueprint cpu-resources Change-Id: Ic0e6bc47b79711b38b2d4dabaeb5ae1dbaf2b18a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
- Loading branch information
1 parent
912a46c
commit 7abe83f
Showing
4 changed files
with
292 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.