Skip to content

Commit

Permalink
Merge pull request #429 from booxter/stop-ovsdbs-after-migration
Browse files Browse the repository at this point in the history
Disable ovn db servers after ovn data is migrated
  • Loading branch information
jistr authored May 3, 2024
2 parents 7765aeb + 78512e6 commit 1396329
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs_user/modules/proc_migrating-ovn-data.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,37 @@ oc patch openstackcontrolplane openstack --type=json -p="[{'op': 'remove', 'path
oc delete pod ovn-copy-data
oc delete pvc ovn-data
----

. Stop old OVN database servers.
+
----
ServicesToStop=("tripleo_ovn_cluster_north_db_server.service"
"tripleo_ovn_cluster_south_db_server.service")
echo "Stopping systemd OpenStack services"
for service in ${ServicesToStop[*]}; do
for i in {1..3}; do
SSH_CMD=CONTROLLER${i}_SSH
if [ ! -z "${!SSH_CMD}" ]; then
echo "Stopping the $service in controller $i"
if ${!SSH_CMD} sudo systemctl is-active $service; then
${!SSH_CMD} sudo systemctl stop $service
fi
fi
done
done
echo "Checking systemd OpenStack services"
for service in ${ServicesToStop[*]}; do
for i in {1..3}; do
SSH_CMD=CONTROLLER${i}_SSH
if [ ! -z "${!SSH_CMD}" ]; then
if ! ${!SSH_CMD} systemctl show $service | grep ActiveState=inactive >/dev/null; then
echo "ERROR: Service $service still running on controller $i"
else
echo "OK: Service $service is not running on controller $i"
fi
fi
done
done
----
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ ServicesToStart=("tripleo_horizon.service"
"tripleo_ceilometer_agent_compute.service"
"tripleo_ceilometer_agent_ipmi.service"
"tripleo_ceilometer_agent_notification.service"
"tripleo_ovn_cluster_north_db_server.service"
"tripleo_ovn_cluster_south_db_server.service"
"tripleo_ovn_cluster_northd.service")
PacemakerResourcesToStart=("galera-bundle"
Expand Down
2 changes: 2 additions & 0 deletions tests/roles/control_plane_rollback/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"tripleo_ceilometer_agent_compute.service"
"tripleo_ceilometer_agent_ipmi.service"
"tripleo_ceilometer_agent_notification.service"
"tripleo_ovn_cluster_north_db_server.service"
"tripleo_ovn_cluster_south_db_server.service"
"tripleo_ovn_cluster_northd.service")
PacemakerResourcesToStart=("galera-bundle"
Expand Down
15 changes: 15 additions & 0 deletions tests/roles/ovn_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,18 @@
oc exec ovsdbserver-sb-0 ovn-sbctl show
register: ovn_show_responding_result

- name: stop old ovn ovsdb services
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ ovn_copy_shell_vars }}
$CONTROLLER1_SSH sudo systemctl stop tripleo_ovn_cluster_north_db_server.service
$CONTROLLER2_SSH sudo systemctl stop tripleo_ovn_cluster_north_db_server.service
$CONTROLLER3_SSH sudo systemctl stop tripleo_ovn_cluster_north_db_server.service
$CONTROLLER1_SSH sudo systemctl stop tripleo_ovn_cluster_south_db_server.service
$CONTROLLER2_SSH sudo systemctl stop tripleo_ovn_cluster_south_db_server.service
$CONTROLLER3_SSH sudo systemctl stop tripleo_ovn_cluster_south_db_server.service

0 comments on commit 1396329

Please sign in to comment.