ovn: Fix broken deployment/reconfig on Ubuntu

Initially Ubuntu/Debian used /var/run/openvswitch as default OVN run dir,
it seems it has changed long time ago - but we haven't picked that up on latest
OVN DB refactor.

Adding in OVN and OVN upgrade Debian jobs to enhance coverage.

Closes-Bug: #2035584

Change-Id: I78967c4499269578ac921ad9a553946b65e1293f
This commit is contained in:
Michal Nasiadka 2023-09-14 07:31:17 +02:00
parent 428acfe97f
commit f6d0ffd61c
5 changed files with 25 additions and 14 deletions

View File

@ -94,5 +94,3 @@ ovn_sb_command: >-
--db-sb-pidfile=/run/ovn/ovnsb_db.pid --db-sb-pidfile=/run/ovn/ovnsb_db.pid
--db-sb-file=/var/lib/openvswitch/ovn-sb/ovnsb.db --db-sb-file=/var/lib/openvswitch/ovn-sb/ovnsb.db
--ovn-sb-logfile=/var/log/kolla/openvswitch/ovn-sb-db.log --ovn-sb-logfile=/var/log/kolla/openvswitch/ovn-sb-db.log
ovn_db_path: "{{ '/var/run/openvswitch' if kolla_base_distro in ['debian', 'ubuntu'] else '/var/run/ovn' }}"

View File

@ -14,7 +14,7 @@
- name: Check NB cluster status - name: Check NB cluster status
command: > command: >
{{ kolla_container_engine }} exec ovn_nb_db ovs-appctl -t {{ ovn_db_path }}/ovnnb_db.ctl {{ kolla_container_engine }} exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl
cluster/status OVN_Northbound cluster/status OVN_Northbound
become: true become: true
changed_when: false changed_when: false
@ -24,7 +24,7 @@
- name: Check SB cluster status - name: Check SB cluster status
command: > command: >
{{ kolla_container_engine }} exec ovn_sb_db ovs-appctl -t {{ ovn_db_path }}/ovnsb_db.ctl {{ kolla_container_engine }} exec ovn_sb_db ovs-appctl -t /var/run/ovn/ovnsb_db.ctl
cluster/status OVN_Southbound cluster/status OVN_Southbound
become: true become: true
changed_when: false changed_when: false
@ -37,7 +37,7 @@
ovn_nb_old_node: "{{ ovn_nb_db_cluster_status | regex_search('\\((\\w{4}) at tcp:' + api_interface_address + ':6643\\)', '\\1') | first }}" ovn_nb_old_node: "{{ ovn_nb_db_cluster_status | regex_search('\\((\\w{4}) at tcp:' + api_interface_address + ':6643\\)', '\\1') | first }}"
become: true become: true
command: > command: >
{{ kolla_container_engine }} exec ovn_nb_db ovs-appctl -t {{ ovn_db_path }}/ovnnb_db.ctl {{ kolla_container_engine }} exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl
cluster/kick OVN_Northbound {{ ovn_nb_old_node }} cluster/kick OVN_Northbound {{ ovn_nb_old_node }}
when: when:
- ovn_nb_db_cluster_status.stdout is defined - ovn_nb_db_cluster_status.stdout is defined
@ -49,7 +49,7 @@
ovn_sb_old_node: "{{ ovn_sb_db_cluster_status | regex_search('\\((\\w{4}) at tcp:' + api_interface_address + ':6644\\)', '\\1') | first }}" ovn_sb_old_node: "{{ ovn_sb_db_cluster_status | regex_search('\\((\\w{4}) at tcp:' + api_interface_address + ':6644\\)', '\\1') | first }}"
become: true become: true
command: > command: >
{{ kolla_container_engine }} exec ovn_sb_db ovs-appctl -t {{ ovn_db_path }}/ovnsb_db.ctl {{ kolla_container_engine }} exec ovn_sb_db ovs-appctl -t /var/run/ovn/ovnsb_db.ctl
cluster/kick OVN_Southbound {{ ovn_sb_old_node }} cluster/kick OVN_Southbound {{ ovn_sb_old_node }}
when: when:
- ovn_sb_db_cluster_status.stdout is defined - ovn_sb_db_cluster_status.stdout is defined

View File

@ -20,14 +20,8 @@ function test_ovn {
echo "OVN SB DB entries:" echo "OVN SB DB entries:"
sudo ${container_engine} exec ovn_northd ovn-sbctl --db "$ovn_sb_connection" show sudo ${container_engine} exec ovn_northd ovn-sbctl --db "$ovn_sb_connection" show
# Test OVSDB cluster state OVNNB_STATUS=$(sudo ${container_engine} exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound)
if [[ $BASE_DISTRO =~ ^(debian|ubuntu)$ ]]; then OVNSB_STATUS=$(sudo ${container_engine} exec ovn_sb_db ovs-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound)
OVNNB_STATUS=$(sudo ${container_engine} exec ovn_nb_db ovs-appctl -t /var/run/openvswitch/ovnnb_db.ctl cluster/status OVN_Northbound)
OVNSB_STATUS=$(sudo ${container_engine} exec ovn_sb_db ovs-appctl -t /var/run/openvswitch/ovnsb_db.ctl cluster/status OVN_Southbound)
else
OVNNB_STATUS=$(sudo ${container_engine} exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound)
OVNSB_STATUS=$(sudo ${container_engine} exec ovn_sb_db ovs-appctl -t /var/run/ovn/ovnsb_db.ctl cluster/status OVN_Southbound)
fi
if [[ $(grep -o "at tcp:" <<< ${OVNNB_STATUS} | wc -l) != "3" ]]; then if [[ $(grep -o "at tcp:" <<< ${OVNNB_STATUS} | wc -l) != "3" ]]; then
echo "ERR: NB Cluster does not have 3 nodes" echo "ERR: NB Cluster does not have 3 nodes"

View File

@ -173,6 +173,15 @@
base_distro: rocky base_distro: rocky
is_upgrade: yes is_upgrade: yes
- job:
name: kolla-ansible-debian-upgrade-ovn
parent: kolla-ansible-ovn-base
nodeset: kolla-ansible-debian-bookworm-multi
timeout: 9000
vars:
base_distro: debian
is_upgrade: yes
- job: - job:
name: kolla-ansible-ubuntu-upgrade-ovn name: kolla-ansible-ubuntu-upgrade-ovn
parent: kolla-ansible-ovn-base parent: kolla-ansible-ovn-base
@ -352,6 +361,13 @@
vars: vars:
base_distro: rocky base_distro: rocky
- job:
name: kolla-ansible-debian-ovn
parent: kolla-ansible-ovn-base
nodeset: kolla-ansible-debian-bookworm-multi
vars:
base_distro: debian
- job: - job:
name: kolla-ansible-ubuntu-ovn name: kolla-ansible-ubuntu-ovn
parent: kolla-ansible-ovn-base parent: kolla-ansible-ovn-base

View File

@ -44,10 +44,13 @@
- kolla-ansible-rocky9-cells - kolla-ansible-rocky9-cells
- kolla-ansible-rocky9-mariadb - kolla-ansible-rocky9-mariadb
- kolla-ansible-ubuntu-mariadb - kolla-ansible-ubuntu-mariadb
- kolla-ansible-debian-ovn
- kolla-ansible-rocky9-ovn - kolla-ansible-rocky9-ovn
- kolla-ansible-ubuntu-ovn - kolla-ansible-ubuntu-ovn
- kolla-ansible-debian-upgrade-ovn
- kolla-ansible-rocky9-upgrade-ovn - kolla-ansible-rocky9-upgrade-ovn
- kolla-ansible-ubuntu-upgrade-ovn - kolla-ansible-ubuntu-upgrade-ovn
- kolla-ansible-debian
- kolla-ansible-rocky9-prometheus-opensearch - kolla-ansible-rocky9-prometheus-opensearch
- kolla-ansible-ubuntu-prometheus-opensearch - kolla-ansible-ubuntu-prometheus-opensearch
- kolla-ansible-rocky9-prometheus-opensearch-upgrade - kolla-ansible-rocky9-prometheus-opensearch-upgrade