Disable/stop/mask Open vSwitch on ovn-northd nodes

There is no need to configure and run Open vSwitch (data-plane) services
on `neutron-ovn-northd` (control-plane) nodes.

Change-Id: I6fdc5b0e212a8b21fc576639a2a82dfe3324244e
This commit is contained in:
Danila Balagansky 2022-09-04 18:43:30 +03:00 committed by Dmitriy Rabotyagov
parent 5baba40337
commit 61cd240918
5 changed files with 10 additions and 15 deletions

View File

@ -76,7 +76,9 @@
state: restarted
listen:
- "Restart provider services"
when: neutron_needs_openvswitch | bool
when:
- neutron_needs_openvswitch | bool
- not _neutron_ovs_disabled
- name: Symlink neutron config directory
file:

View File

@ -106,11 +106,12 @@
('need_db_expand' not in ansible_local['openstack_ansible']['neutron']) or
('need_db_contract' not in ansible_local['openstack_ansible']['neutron'])
- name: Ensure Open vSwitch service is started and enabled
- name: Ensure Open vSwitch service state is set according to node group
service:
name: "{{ neutron_ovs_service_name }}"
state: started
enabled: yes
state: "{{ _neutron_ovs_disabled | ternary('stopped', 'started') }}"
enabled: "{{ _neutron_ovs_disabled | ternary(false, true) }}"
masked: "{{ _neutron_ovs_disabled | ternary(true, omit) }}"
when: neutron_needs_openvswitch | bool
# NOTE(hwoarang) contains may share the same physical host so we only

View File

@ -40,15 +40,6 @@
when:
- neutron_services['neutron-ovn-controller']['group'] in group_names
- name: Ensure Open vSwitch service is started and enabled
systemd:
name: "{{ neutron_ovs_service_name }}"
state: started
enabled: yes
when:
- neutron_services['neutron-ovn-northd']['group'] in group_names
or neutron_services['neutron-ovn-controller']['group'] in group_names
- name: Ensure ovn-northd service is started and enabled
systemd:
name: "{{ neutron_ovn_northd_service_name }}"

View File

@ -17,8 +17,7 @@
- name: Set openvswitch hostname
command: "ovs-vsctl set open_vswitch . external-ids:hostname='{{ ansible_facts['nodename'] }}'"
when:
- (neutron_services['neutron-ovn-northd']['group'] in group_names) or
(neutron_services['neutron-ovn-controller']['group'] in group_names)
- (neutron_services['neutron-ovn-controller']['group'] in group_names)
# (NOTE) This makes all computes eligible to be gateway nodes
- name: Set CMS Options for Gateway Scheduling

View File

@ -265,6 +265,8 @@ _neutron_non_tunnel_types:
- vlan
- local
_neutron_ovs_disabled: "{{ (neutron_services['neutron-ovn-northd']['group'] in group_names) and (neutron_services['neutron-ovn-controller']['group'] not in group_names) }}"
# Tunnel network types used by the OVS agent
neutron_tunnel_types: "{{ neutron_ml2_drivers_type.split(',') | difference(_neutron_non_tunnel_types) | join(',') }}"