From f6d0ffd61c950416f4e521064772291e65de9623 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 14 Sep 2023 07:31:17 +0200 Subject: [PATCH] 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 --- ansible/roles/ovn-db/defaults/main.yml | 2 -- ansible/roles/ovn-db/tasks/bootstrap-initial.yml | 8 ++++---- tests/test-ovn.sh | 10 ++-------- zuul.d/jobs.yaml | 16 ++++++++++++++++ zuul.d/project.yaml | 3 +++ 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/ansible/roles/ovn-db/defaults/main.yml b/ansible/roles/ovn-db/defaults/main.yml index 57735c37cc..a5d301ad5e 100644 --- a/ansible/roles/ovn-db/defaults/main.yml +++ b/ansible/roles/ovn-db/defaults/main.yml @@ -94,5 +94,3 @@ ovn_sb_command: >- --db-sb-pidfile=/run/ovn/ovnsb_db.pid --db-sb-file=/var/lib/openvswitch/ovn-sb/ovnsb.db --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' }}" diff --git a/ansible/roles/ovn-db/tasks/bootstrap-initial.yml b/ansible/roles/ovn-db/tasks/bootstrap-initial.yml index ba0d10c56e..693e2c1ddf 100644 --- a/ansible/roles/ovn-db/tasks/bootstrap-initial.yml +++ b/ansible/roles/ovn-db/tasks/bootstrap-initial.yml @@ -14,7 +14,7 @@ - name: Check NB cluster status 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 become: true changed_when: false @@ -24,7 +24,7 @@ - name: Check SB cluster status 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 become: true 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 }}" become: true 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 }} when: - 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 }}" become: true 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 }} when: - ovn_sb_db_cluster_status.stdout is defined diff --git a/tests/test-ovn.sh b/tests/test-ovn.sh index 7159c804b1..307105c3c0 100755 --- a/tests/test-ovn.sh +++ b/tests/test-ovn.sh @@ -20,14 +20,8 @@ function test_ovn { echo "OVN SB DB entries:" sudo ${container_engine} exec ovn_northd ovn-sbctl --db "$ovn_sb_connection" show - # Test OVSDB cluster state - if [[ $BASE_DISTRO =~ ^(debian|ubuntu)$ ]]; then - 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 + 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) if [[ $(grep -o "at tcp:" <<< ${OVNNB_STATUS} | wc -l) != "3" ]]; then echo "ERR: NB Cluster does not have 3 nodes" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index d83ba33dc6..8539117f14 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -173,6 +173,15 @@ base_distro: rocky 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: name: kolla-ansible-ubuntu-upgrade-ovn parent: kolla-ansible-ovn-base @@ -352,6 +361,13 @@ vars: 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: name: kolla-ansible-ubuntu-ovn parent: kolla-ansible-ovn-base diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 5a6124098f..e3ac918d7a 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -44,10 +44,13 @@ - kolla-ansible-rocky9-cells - kolla-ansible-rocky9-mariadb - kolla-ansible-ubuntu-mariadb + - kolla-ansible-debian-ovn - kolla-ansible-rocky9-ovn - kolla-ansible-ubuntu-ovn + - kolla-ansible-debian-upgrade-ovn - kolla-ansible-rocky9-upgrade-ovn - kolla-ansible-ubuntu-upgrade-ovn + - kolla-ansible-debian - kolla-ansible-rocky9-prometheus-opensearch - kolla-ansible-ubuntu-prometheus-opensearch - kolla-ansible-rocky9-prometheus-opensearch-upgrade