From f55a08ad7b7498a72eb037e97137ec77dfe2c7ad Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Thu, 18 Feb 2021 18:23:49 +0100 Subject: [PATCH] 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 --- .../nova/nova-compute-container-puppet.yaml | 40 +++++++++++++++++++ ...ment_custom_provider-21203c3ff54c878c.yaml | 7 ++++ 2 files changed, 47 insertions(+) create mode 100644 releasenotes/notes/nova_placement_custom_provider-21203c3ff54c878c.yaml diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index 8f859d4422..a87e1bb546 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -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]} diff --git a/releasenotes/notes/nova_placement_custom_provider-21203c3ff54c878c.yaml b/releasenotes/notes/nova_placement_custom_provider-21203c3ff54c878c.yaml new file mode 100644 index 0000000000..1a9a8cce92 --- /dev/null +++ b/releasenotes/notes/nova_placement_custom_provider-21203c3ff54c878c.yaml @@ -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