From 51bd75bd1100a3506f05856439a8fe7f367cf90b Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 27 Jan 2025 16:37:24 +0000 Subject: [PATCH 1/6] Add flavor reservation configuration --- kolla/defaults.yml | 5 +++++ kolla/node_custom_config/blazar.conf | 2 +- kolla/node_custom_config/horizon/custom_local_settings | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/kolla/defaults.yml b/kolla/defaults.yml index 3dfe967d..5e10f835 100644 --- a/kolla/defaults.yml +++ b/kolla/defaults.yml @@ -370,3 +370,8 @@ enable_image_cleaner: no # Manila default_share_type: cephfsnfstype + +# Flavor reservation +# introducing new value here to enable host plugin. Before we were default to `enable_nova` +enable_host_reservation: "{{ enable_nova | bool }}" +enable_flavor_reservation: no \ No newline at end of file diff --git a/kolla/node_custom_config/blazar.conf b/kolla/node_custom_config/blazar.conf index 9f46a536..82d5527f 100644 --- a/kolla/node_custom_config/blazar.conf +++ b/kolla/node_custom_config/blazar.conf @@ -30,7 +30,7 @@ region_name = {{ openstack_region_name }} [manager] {# note: important to preserve newline after this #} -plugins = network.plugin,virtual.floatingip.plugin{% if enable_nova | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %} +plugins = network.plugin,virtual.floatingip.plugin{% if enable_host_reservation | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %}{% if enable_flavor_reservation | bool %},flavor.instance.plugin{% endif %} minutes_before_end_lease = {{ blazar_minutes_before_end_lease }} diff --git a/kolla/node_custom_config/horizon/custom_local_settings b/kolla/node_custom_config/horizon/custom_local_settings index 86d676ef..aa40c746 100644 --- a/kolla/node_custom_config/horizon/custom_local_settings +++ b/kolla/node_custom_config/horizon/custom_local_settings @@ -91,9 +91,12 @@ OPENSTACK_BLAZAR_DEVICE_RESERVATION = { 'enabled': {{ enable_zun | bool }}, } OPENSTACK_BLAZAR_HOST_RESERVATION = { - 'enabled': {{ enable_nova | bool }}, + 'enabled': {{ enable_host_reservation | bool }}, 'url_format': '{{ blazar_host_url_format }}', } +OPENSTACK_BLAZAR_FLAVOR_RESERVATION = { + "enabled": {{ enable_flavor_reservation | bool}}, +} {% endif %} # horizon themes are represented as a tuple of name, label, and path @@ -193,4 +196,4 @@ OPENSTACK_MANILA_FEATURES = { X_FRAME_OPTIONS = 'SAMEORIGIN' # disable usage report on overview page -OPENSTACK_USE_SIMPLE_TENANT_USAGE = False \ No newline at end of file +OPENSTACK_USE_SIMPLE_TENANT_USAGE = False From 9ae7128e91050fb12aeda691a50a17dee6636e51 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 30 Jan 2025 17:20:27 +0000 Subject: [PATCH 2/6] Add blazar randomize host flag --- kolla/defaults.yml | 4 ++-- kolla/node_custom_config/blazar.conf | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/kolla/defaults.yml b/kolla/defaults.yml index 5e10f835..ea639436 100644 --- a/kolla/defaults.yml +++ b/kolla/defaults.yml @@ -372,6 +372,6 @@ enable_image_cleaner: no default_share_type: cephfsnfstype # Flavor reservation -# introducing new value here to enable host plugin. Before we were default to `enable_nova` enable_host_reservation: "{{ enable_nova | bool }}" -enable_flavor_reservation: no \ No newline at end of file +enable_flavor_reservation: no +blazar_randomize_hosts: no diff --git a/kolla/node_custom_config/blazar.conf b/kolla/node_custom_config/blazar.conf index 82d5527f..88b28766 100644 --- a/kolla/node_custom_config/blazar.conf +++ b/kolla/node_custom_config/blazar.conf @@ -30,7 +30,7 @@ region_name = {{ openstack_region_name }} [manager] {# note: important to preserve newline after this #} -plugins = network.plugin,virtual.floatingip.plugin{% if enable_host_reservation | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %}{% if enable_flavor_reservation | bool %},flavor.instance.plugin{% endif %} +plugins = network.plugin,virtual.floatingip.plugin{% if enable_nova | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %}{% if enable_flavor_reservation | bool %},flavor.instance.plugin{% endif %} minutes_before_end_lease = {{ blazar_minutes_before_end_lease }} @@ -63,6 +63,8 @@ enable_polling_monitor_dry_run = {{ blazar_physical_polling_monitor_dry_run }} retry_allocation_without_defaults = {{ blazar_host_retry_without_default_resources | bool }} default_resource_properties = {{ blazar_host_default_resource_properties }} {% endif %} +allow_reservation = {{ enable_host_reservation | bool }} +randomize_host_selection = {{ blazar_randomize_hosts | bool }} {% if enable_zun | bool %} [device] @@ -80,5 +82,10 @@ default_resource_properties = {{ blazar_network_default_resource_properties }} enable_polling_monitor = {{ blazar_network_polling_monitor}} enable_polling_monitor_dry_run = {{ blazar_network_polling_monitor_dry_run }} +[flavor:instance] +randomize_host_selection = {{ blazar_randomize_hosts | bool }} +# Note this configures if email is sent. Email relay uses host config. +before_end = email + [api] allocation_extras = {{ blazar_api_allocation_extras }} From 752fb9abe70804ef1f7d0f6ab53f6b38e580ea1b Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 28 May 2025 19:48:19 +0000 Subject: [PATCH 3/6] Add configurable placement trait for blazar flavor res --- kolla/defaults.yml | 6 ++++-- kolla/node_custom_config/blazar.conf | 5 +++-- kolla/node_custom_config/horizon/custom_local_settings | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kolla/defaults.yml b/kolla/defaults.yml index ea639436..e5428708 100644 --- a/kolla/defaults.yml +++ b/kolla/defaults.yml @@ -372,6 +372,8 @@ enable_image_cleaner: no default_share_type: cephfsnfstype # Flavor reservation -enable_host_reservation: "{{ enable_nova | bool }}" -enable_flavor_reservation: no +blazar_enable_host_reservation: "{{ enable_nova | bool }}" +blazar_enable_flavor_reservation: no blazar_randomize_hosts: no +# The trait which permits flavor reservation +blazar_flavor_reservation_trait: blazar_flavor_reservation \ No newline at end of file diff --git a/kolla/node_custom_config/blazar.conf b/kolla/node_custom_config/blazar.conf index 88b28766..fe0b33c5 100644 --- a/kolla/node_custom_config/blazar.conf +++ b/kolla/node_custom_config/blazar.conf @@ -30,7 +30,7 @@ region_name = {{ openstack_region_name }} [manager] {# note: important to preserve newline after this #} -plugins = network.plugin,virtual.floatingip.plugin{% if enable_nova | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %}{% if enable_flavor_reservation | bool %},flavor.instance.plugin{% endif %} +plugins = network.plugin,virtual.floatingip.plugin{% if enable_nova | bool %},physical.host.plugin{% endif %}{% if enable_zun | bool %},device.plugin{% endif %}{% if blazar_enable_flavor_reservation | bool %},flavor.instance.plugin{% endif %} minutes_before_end_lease = {{ blazar_minutes_before_end_lease }} @@ -63,7 +63,7 @@ enable_polling_monitor_dry_run = {{ blazar_physical_polling_monitor_dry_run }} retry_allocation_without_defaults = {{ blazar_host_retry_without_default_resources | bool }} default_resource_properties = {{ blazar_host_default_resource_properties }} {% endif %} -allow_reservation = {{ enable_host_reservation | bool }} +allow_reservation = {{ blazar_enable_host_reservation | bool }} randomize_host_selection = {{ blazar_randomize_hosts | bool }} {% if enable_zun | bool %} @@ -86,6 +86,7 @@ enable_polling_monitor_dry_run = {{ blazar_network_polling_monitor_dry_run }} randomize_host_selection = {{ blazar_randomize_hosts | bool }} # Note this configures if email is sent. Email relay uses host config. before_end = email +placement_reservation_permitted_trait = {{ blazar_flavor_reservation_trait }} [api] allocation_extras = {{ blazar_api_allocation_extras }} diff --git a/kolla/node_custom_config/horizon/custom_local_settings b/kolla/node_custom_config/horizon/custom_local_settings index aa40c746..0f225f68 100644 --- a/kolla/node_custom_config/horizon/custom_local_settings +++ b/kolla/node_custom_config/horizon/custom_local_settings @@ -96,6 +96,7 @@ OPENSTACK_BLAZAR_HOST_RESERVATION = { } OPENSTACK_BLAZAR_FLAVOR_RESERVATION = { "enabled": {{ enable_flavor_reservation | bool}}, + "blazar_flavor_reservation_trait": {{ blazar_flavor_reservation_trait }}, } {% endif %} From 39adab63c8dc597264648a078b71dde7774b7a39 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 28 May 2025 21:39:23 +0000 Subject: [PATCH 4/6] Fix quoting --- kolla/node_custom_config/horizon/custom_local_settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kolla/node_custom_config/horizon/custom_local_settings b/kolla/node_custom_config/horizon/custom_local_settings index 0f225f68..4a5c3c88 100644 --- a/kolla/node_custom_config/horizon/custom_local_settings +++ b/kolla/node_custom_config/horizon/custom_local_settings @@ -96,7 +96,7 @@ OPENSTACK_BLAZAR_HOST_RESERVATION = { } OPENSTACK_BLAZAR_FLAVOR_RESERVATION = { "enabled": {{ enable_flavor_reservation | bool}}, - "blazar_flavor_reservation_trait": {{ blazar_flavor_reservation_trait }}, + "blazar_flavor_reservation_trait": '{{ blazar_flavor_reservation_trait }}', } {% endif %} From d5a78d2077c81323d2fb1e2bcbcce3224f20f4b6 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Mon, 18 Aug 2025 21:36:11 +0000 Subject: [PATCH 5/6] Add placement policy.yaml --- kolla/node_custom_config/placement/policy.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 kolla/node_custom_config/placement/policy.yaml diff --git a/kolla/node_custom_config/placement/policy.yaml b/kolla/node_custom_config/placement/policy.yaml new file mode 100644 index 00000000..8ff3e497 --- /dev/null +++ b/kolla/node_custom_config/placement/policy.yaml @@ -0,0 +1,2 @@ +"placement:resource_providers:traits:list": "@" +"placement:resource_providers:list": "@" From b583059b55eaf56d39d1e8cda1688529e6a48f63 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 28 Aug 2025 15:03:41 +0000 Subject: [PATCH 6/6] Updated blazar enforcement filter template --- kolla/defaults.yml | 1 + kolla/node_custom_config/blazar.conf | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kolla/defaults.yml b/kolla/defaults.yml index e5428708..a9773941 100644 --- a/kolla/defaults.yml +++ b/kolla/defaults.yml @@ -48,6 +48,7 @@ backup_location: "{{ mariabackup_location if enable_mariabackup | bool else mysq # Blazar enable_blazar: yes enable_blazar_allocation_enforcement: no +enable_blazar_max_lease_enforcement: no blazar_project_enforcement_id: charge_code # When to send lease notification email blazar_minutes_before_end_lease: 2880 diff --git a/kolla/node_custom_config/blazar.conf b/kolla/node_custom_config/blazar.conf index fe0b33c5..3f65443d 100644 --- a/kolla/node_custom_config/blazar.conf +++ b/kolla/node_custom_config/blazar.conf @@ -5,8 +5,15 @@ os_region_name = {{ openstack_region_name }} {# note: important to preserve newline after this #} exempt_projects = {% for project_id in blazar_usage_project_exemptions %}{{ project_id }}{% if not loop.last %},{% endif %}{% endfor %} +{% set filters = [] %} +{% if enable_blazar_max_lease_enforcement | bool %} +{% set _ = filters.append("MaxLeaseDurationFilter") %} +{% endif %} {% if enable_blazar_allocation_enforcement | bool %} -enabled_filters = MaxLeaseDurationFilter, ExternalServiceFilter +{% set _ = filters.append("ExternalServiceFilter") %} +{% endif %} +enabled_filters = {{ filters | join(", ") }} + {% if blazar_external_service_endpoint is defined %} external_service_base_endpoint = {{ blazar_external_service_endpoint }} {% endif %} @@ -19,9 +26,6 @@ external_service_check_update_endpoint = {{ blazar_external_service_check_update {% if blazar_external_service_on_end_endpoint is defined %} external_service_on_end_endpoint = {{ blazar_external_service_on_end_endpoint }} {% endif %} -{% else %} -enabled_filters = MaxLeaseDurationFilter -{% endif %} max_lease_duration = {{ blazar_default_max_lease_duration }} reservation_extension_window = {{ blazar_default_reservation_extension_window }}