From 5a533aae238638a7af50c75d334f67215fe2142f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 4 Jan 2024 18:13:31 +0100 Subject: [PATCH] Improve Blazar integration with Nova As of today we do not have any means of Blazar integration with Nova, while we do provide roles for Blazar installation for a while now. This patch aims to bring in more native integration and remove necessity of overrides for such deployment. Related-Bug: #2048048 Co-Authored-By: Alexey Rusetsky Change-Id: Ica50a5504de1b1604f72123751cbb3f45c85ab46 --- defaults/main.yml | 8 ++++++++ .../blazar_nova_integration-c8057dcc2ccc162a.yaml | 11 +++++++++++ templates/nova.conf.j2 | 4 ++++ vars/main.yml | 8 ++++++++ 4 files changed, 31 insertions(+) create mode 100644 releasenotes/notes/blazar_nova_integration-c8057dcc2ccc162a.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 1b7caac2..e2d4b458 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,6 +16,8 @@ # Enable/Disable barbican configurations nova_barbican_enabled: "{{ (groups['barbican_all'] is defined) and (groups['barbican_all'] | length > 0) }}" +# Enable/Disable blazar configurations +nova_blazar_enabled: "{{ (groups['blazar_all'] is defined) and (groups['blazar_all'] | length > 0) }}" # Enable/Disable designate configurations nova_designate_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}" # Notification topics for designate. @@ -358,6 +360,9 @@ nova_scheduler_default_filters: - ServerGroupAffinityFilter - NUMATopologyFilter +nova_blazar_scheduler_filters: + - BlazarFilter + nova_scheduler_extra_filters: [] # This should be tuned depending on the number of compute hosts present in the @@ -538,6 +543,9 @@ nova_services: start_order: 5 execstarts: "{{ nova_bin }}/nova-serialproxy {{ nova_backend_ssl | ternary('--ssl_only --cert ' ~ nova_ssl_cert ~ ' --key ' ~ nova_ssl_key, '') }}" +nova_blazar_pip_packages: + - blazar-nova + nova_novnc_pip_packages: - websockify diff --git a/releasenotes/notes/blazar_nova_integration-c8057dcc2ccc162a.yaml b/releasenotes/notes/blazar_nova_integration-c8057dcc2ccc162a.yaml new file mode 100644 index 00000000..3e64d163 --- /dev/null +++ b/releasenotes/notes/blazar_nova_integration-c8057dcc2ccc162a.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Added extra variables to allow control Blazar integration with Nova: + + * ``nova_blazar_enabled`` (bool) - Control if Blazar integration should + be configured + * ``nova_blazar_scheduler_filters`` (list) - Extra filters that will be + enabled in Nova scheduler + * ``nova_blazar_pip_packages`` (list) - Extra Python packages that will + be installed on Nova scheduler hosts diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index 1f492b21..f5c838b5 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -317,6 +317,10 @@ discover_hosts_in_cells_interval = {{ nova_discover_hosts_in_cells_interval }} [filter_scheduler] max_io_ops_per_host = {{ nova_max_io_ops_per_host }} +{% if nova_blazar_enabled and nova_blazar_scheduler_filters %} +available_filters = nova.scheduler.filters.all_filters +available_filters = blazarnova.scheduler.filters.blazar_filter.BlazarFilter +{% endif %} enabled_filters = {{ _nova_scheduler_filters | join(',') }} host_subset_size = {{ nova_scheduler_host_subset_size }} track_instance_changes = {{ nova_scheduler_tracks_instance_changes }} diff --git a/vars/main.yml b/vars/main.yml index 39847682..70b54699 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -47,6 +47,11 @@ nova_venv_packages: |- {%- if nova_oslomsg_amqp1_enabled | bool %} {%- set _ = pkg_list.extend(nova_optional_oslomsg_amqp1_pip_packages) %} {%- endif %} + {%- if nova_blazar_enabled | bool %} + {%- if (nova_services['nova-scheduler']['group'] in group_names) %} + {%- set _ = pkg_list.extend(nova_blazar_pip_packages) %} + {%- endif %} + {%- endif %} {%- if ('novnc' in nova_console_proxy_types) %} {%- set _ = pkg_list.extend(nova_novnc_pip_packages) %} {%- endif %} @@ -137,6 +142,9 @@ _nova_scheduler_filters: |- {% else %} {% set filters = default_filters %} {% endif %} + {% if nova_blazar_enabled | bool %} + {% set _ = filters.extend(nova_blazar_scheduler_filters) %} + {% endif %} {{ filters + nova_scheduler_extra_filters }} _qemu_default_conf_dict: |-