Skip to content

Commit

Permalink
Merge "Add ML2/OVN and ML2/OVS setting checks for neutron"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Sep 27, 2023
2 parents f64c86d + d3d67dc commit b422bad
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/neutron/tasks/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- import_tasks: neutron_plugin_agent_check.yml

- import_tasks: register.yml

- include_tasks: clone.yml
Expand Down
35 changes: 35 additions & 0 deletions ansible/roles/neutron/tasks/neutron_plugin_agent_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: Get container facts
become: true
kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name:
- neutron_openvswitch_agent
- ovn_controller
check_mode: false
register: container_facts

- name: Get container volume facts
become: true
kolla_container_volume_facts:
container_engine: "{{ kolla_container_engine }}"
name:
- ovn_nb_db
- ovn_sb_db
check_mode: false
register: container_volume_facts

- name: Check for ML2/OVN presence
assert:
that: neutron_plugin_agent == 'ovn'
fail_msg: "ML2/OVN agent detected, neutron_plugin_agent is not set to 'ovn', Kolla-Ansible does not support this migration operation."
when: (container_facts['ovn_controller'] is defined) or (container_volume_facts['ovn_nb_db'] is defined) or (container_volume_facts['ovn_sb_db'] is defined)

- name: Check for ML2/OVS presence
assert:
that:
- neutron_plugin_agent == 'openvswitch'
- container_volume_facts['ovn_nb_db'] is not defined
- container_volume_facts['ovn_sb_db'] is not defined
fail_msg: "ML2/OVS agent detected, neutron_plugin_agent is not set to 'openvswitch', Kolla-Ansible does not support this migration operation."
when: container_facts['neutron_openvswitch_agent'] is defined
2 changes: 2 additions & 0 deletions ansible/roles/neutron/tasks/precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@
run_once: True
when:
- enable_ironic_neutron_agent | bool

- import_tasks: neutron_plugin_agent_check.yml
2 changes: 2 additions & 0 deletions ansible/roles/neutron/tasks/upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
- import_tasks: neutron_plugin_agent_check.yml

- include_tasks: rolling_upgrade.yml
when: neutron_enable_rolling_upgrade | bool

Expand Down
9 changes: 9 additions & 0 deletions releasenotes/notes/ml2ovs_precheck-c859504004f6884b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
features:
- |
Added a neutron check for ML2/OVS and ML2/OVN presence
at the start of deploy phase. It will fail if
neutron_plugin_agent is set to ``ovn`` and use of ML2/OVS
container detected. In case where neutron_plugin_agent
is set to ``openvswitch`` the check will fail when it detects
ML2/OVN container or any of the OVN specific volumes.

0 comments on commit b422bad

Please sign in to comment.