From 48a935d7c8a8a96d6e66f0cc1b4b7fb7b33760bb Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 19 Nov 2024 13:04:30 +0100 Subject: [PATCH] Re-enable uWSGI as default for Neutron Neutron team has reportedly addressed issues with uWSGI for the service including OVN within [1]. Solution requires deployment of 2 new services while one should be running whenever WSGI is used, where second is needed specifically for OVN scenario. neutron-ovn-maintenance-worker is conditionally enabled to avoid systemd service deployment for non-OVN scenarios, as we do not support switching neutron_plugin_type back and force at the moment. [1] https://bugs.launchpad.net/neutron/+bug/1912359 Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/935664 Change-Id: I9340d1dc94a6aa1a962bdc10b97439aa1fdc8658 --- defaults/main.yml | 7 +++--- ...ron_uwsgi_re-enabled-d75d0362aaf32278.yaml | 24 ++++++++++++++++++ vars/main.yml | 25 +++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/neutron_uwsgi_re-enabled-d75d0362aaf32278.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 661d7e5a..7fe12c40 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -183,18 +183,19 @@ _neutron_rootwrap_conf_overrides: neutron_rootwrap_conf_overrides: {} neutron_api_uwsgi_ini_overrides: {} -neutron_server_init_overrides: {} +neutron_periodic_workers_init_overrides: {} neutron_rpc_server_init_overrides: {} +neutron_server_init_overrides: {} neutron_sriov_nic_agent_ini_overrides: {} neutron_sriov_nic_agent_init_overrides: {} +neutron_ovn_maintenance_init_overrides: {} neutron_ovn_metadata_agent_ini_overrides: {} neutron_ovn_metadata_agent_init_overrides: {} ### ### UWSGI ### -# NOTE(noonedeadpunk): uWSGI is still not fully supported. See: https://bugs.launchpad.net/neutron/+bug/1912359 -neutron_use_uwsgi: False +neutron_use_uwsgi: True neutron_wsgi_processes_max: 16 neutron_wsgi_processes: "{{ [[ansible_facts['processor_vcpus'] | default(1), 1] | max * 2, neutron_wsgi_processes_max] | min }}" neutron_wsgi_threads: 1 diff --git a/releasenotes/notes/neutron_uwsgi_re-enabled-d75d0362aaf32278.yaml b/releasenotes/notes/neutron_uwsgi_re-enabled-d75d0362aaf32278.yaml new file mode 100644 index 00000000..501baf74 --- /dev/null +++ b/releasenotes/notes/neutron_uwsgi_re-enabled-d75d0362aaf32278.yaml @@ -0,0 +1,24 @@ +--- +upgrade: + - | + uWSGI has been re-enabled by default for Neutron one more time. With that + new services are introduced which should ensure adequate functionality of + Neutron when uWSGI is being used. + + - ``neutron-periodic-workers`` service is enabled for all drivers when + WSGI is being used. It runs along with previously existing + ``neutron-rpc-server`` + + - ``neutron-ovn-maintenance-worker`` service is added only if `ml2.ovn` + is being used as ``neutron_plugin_type``. The service will be enabled + and running only when WSGI is used for Neutron ``neutron_use_uwsgi`` is + set to `True` + + - | + If you are using Ubuntu 22.04 Jammy Jellyfish and ``install_method: distro`` + please make sure to disable ``neutron_use_uwsgi`` as required binaries for + this mode to work are missing from packages for this distro. +fixes: + - | + Issues with uWSGI mode for Neutron has been addressed and uWSGI be used + for the service. diff --git a/vars/main.yml b/vars/main.yml index f712e31a..15d48d3d 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -513,6 +513,31 @@ neutron_services: {% if ('ml2.genericswitch' in neutron_plugin_types) -%} --config-file {{ neutron_conf_dir }}/{{ neutron_plugins['ml2.genericswitch'].plugin_ini }} {% endif %} + neutron-periodic-workers: + group: neutron_server + service_name: neutron-periodic-workers + service_en: True + enabled: "{{ neutron_use_uwsgi }}" + state: "{{ neutron_use_uwsgi | ternary('started', 'stopped') }}" + init_config_overrides: "{{ neutron_periodic_workers_init_overrides | combine(neutron_server_init_overrides) }}" + start_order: 2 + execstarts: >- + {{ neutron_bin }}/neutron-periodic-workers --config-file {{ neutron_conf_dir }}/neutron.conf + --config-file {{ neutron_conf_dir }}/{{ neutron_plugins[neutron_plugin_type].plugin_ini }} + {% if ('ml2.genericswitch' in neutron_plugin_types) -%} + --config-file {{ neutron_conf_dir }}/{{ neutron_plugins['ml2.genericswitch'].plugin_ini }} + {% endif %} + neutron-ovn-maintenance-worker: + group: neutron_server + service_name: neutron-ovn-maintenance-worker + service_en: "{{ neutron_plugin_type == 'ml2.ovn' }}" + enabled: "{{ neutron_use_uwsgi and neutron_plugin_type == 'ml2.ovn' }}" + state: "{{ (neutron_use_uwsgi and neutron_plugin_type == 'ml2.ovn') | ternary('started', 'stopped') }}" + init_config_overrides: "{{ neutron_ovn_maintenance_init_overrides | combine(neutron_server_init_overrides) }}" + start_order: 2 + execstarts: >- + {{ neutron_bin }}/neutron-ovn-maintenance-worker --config-file {{ neutron_conf_dir }}/neutron.conf + --config-file {{ neutron_conf_dir }}/{{ neutron_plugins[neutron_plugin_type].plugin_ini }} neutron-sriov-nic-agent: group: neutron_sriov_nic_agent service_name: neutron-sriov-nic-agent