Add support for nova custom provider inventories

Nova supports to configure resource provider inventory and traits using a
standardized YAML file format starting victoria release [1]. This introduces
CustomProviderInventories role parameter to configure the custom provider yaml.

[1] https://docs.openstack.org/nova/latest/admin/managing-resource-providers.html

Depends-On: If12d7f5a8c331e051eb543f88187c31e676f3b62
Depends-On: I509eec3bf37368640ae8a3df8271b769d29f70c4
Change-Id: I25ea828397fcc968d07b0d5e87bdc9445ac690e2
This commit is contained in:
Martin Schuppert 2021-02-18 18:23:49 +01:00
parent cada48fc30
commit f55a08ad7b
2 changed files with 47 additions and 0 deletions

View File

@ -702,6 +702,44 @@ parameters:
default: ''
tags:
- role_specific
CustomProviderInventories:
description: |
Array of hashes describing the custom providers for the compute role.
Format:
name/uuid - Resource providers to target can be identified by either
UUID or name. In addition, the value $COMPUTE_NODE can be used in
the UUID field to identify all nodes managed by the service.
Exactly one of uuid or name is mandatory. If neither uuid or name
is provided, the special uuid $COMPUTE_NODE gets set in the template.
inventories - (Optional) Hash of custom provider inventories. 'total' is
a mandatory property. Any other optional properties not populated will
be given a default value by placement. If overriding a pre-existing
provider values will not be preserved from the existing inventory.
traits - (Optional) Array of additional traits.
Example:
ComputeParameters:
CustomProviderInventories:
- uuid: $COMPUTE_NODE
inventories:
CUSTOM_EXAMPLE_RESOURCE_CLASS:
total: 100
reserved: 0
min_unit: 1
max_unit: 10
step_size: 1
allocation_ratio: 1.0
CUSTOM_ANOTHER_EXAMPLE_RESOURCE_CLASS:
total: 100
traits:
- CUSTOM_P_STATE_ENABLED
- CUSTOM_C_STATE_ENABLED
type: json
default: {}
tags:
- role_specific
# DEPRECATED: the following options are deprecated and are currently maintained
# for backwards compatibility. They will be removed in future release.
@ -818,6 +856,7 @@ resources:
nova::compute::image_cache::remove_unused_base_images: NovaComputeImageCacheRemoveUnusedBaseImages
nova::compute::image_cache::remove_unused_resized_minimum_age_seconds: NovaComputeImageCacheRemoveUnusedResizedMinimumAge
nova::compute::image_cache::precache_concurrency: NovaComputeImageCachePrecacheConcurrency
nova::compute::provider::custom_inventories: CustomProviderInventories
- values: {get_param: [RoleParameters]}
- values:
NovaVcpuPinSet: {get_param: NovaVcpuPinSet}
@ -915,6 +954,7 @@ resources:
NovaComputeImageCacheRemoveUnusedBaseImages: {get_param: NovaComputeImageCacheRemoveUnusedBaseImages}
NovaComputeImageCacheRemoveUnusedResizedMinimumAge: {get_param: NovaComputeImageCacheRemoveUnusedResizedMinimumAge}
NovaComputeImageCachePrecacheConcurrency: {get_param: NovaComputeImageCachePrecacheConcurrency}
CustomProviderInventories: {get_param: CustomProviderInventories}
conditions:
enable_instance_ha: {equals: [{get_param: EnableInstanceHA}, true]}

View File

@ -0,0 +1,7 @@
---
features:
- |
Nova supports to configure resource provider inventory and traits using a
standardized YAML file format starting victoria release [1]. This introduces
CustomProviderInventories role parameter to configure the custom provider yaml.
[1] https://docs.openstack.org/nova/latest/admin/managing-resource-providers.html