ovn-migration: Stop neutron server while running db sync
The patch stops all running neutron-server processes before syncing database from Neutron to OVN. Then it creates a new container to execute the sync in and after it is done the container is removed. Change-Id: Ifa439a536572efb72ccefde128fa186fc2f73bef
This commit is contained in:
parent
b71b25820b
commit
feb9f2b21c
@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
tunnel_bridge: "br-tun"
|
tunnel_bridge: "br-tun"
|
||||||
ovn_bridge: "br-int"
|
ovn_bridge: "br-int"
|
||||||
|
ovn_db_sync_container: "neutron-ovn-db-sync"
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
- include_tasks: clone-dataplane.yml
|
- include_tasks: clone-dataplane.yml
|
||||||
|
|
||||||
- include_tasks: sync-dbs.yml
|
- include_tasks: sync-dbs.yml
|
||||||
when: ovn_central is defined
|
|
||||||
|
|
||||||
- include_tasks: activate-ovn.yml
|
- include_tasks: activate-ovn.yml
|
||||||
|
|
||||||
|
@ -1,20 +1,34 @@
|
|||||||
---
|
---
|
||||||
- name: Get the neutron container ID
|
- name: stop neutron_api containers
|
||||||
shell:
|
ansible.builtin.systemd:
|
||||||
podman ps --filter "name=neutron_api" --format {% raw %}"{{.ID}}"{% endraw %}
|
name: tripleo_neutron_api
|
||||||
register: neutron_id
|
state: stopped
|
||||||
|
|
||||||
- name: Sync neutron db with OVN db (container) - Run 1
|
- name: get neutron_server image url
|
||||||
command: podman exec "{{ neutron_id.stdout }}"
|
command: podman ps -a --filter "name=neutron_api" --format {% raw %}"{{.Image}}"{% endraw %}
|
||||||
neutron-ovn-db-sync-util --config-file /etc/neutron/neutron.conf
|
register: neutron_server_image
|
||||||
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini
|
|
||||||
--ovn-neutron_sync_mode migrate
|
|
||||||
|
|
||||||
- name: Sync neutron db with OVN db (container) - Run 2
|
- name: sync neutron db with OVN db
|
||||||
command: podman exec "{{ neutron_id.stdout }}"
|
command: podman run --name {{ ovn_db_sync_container }}
|
||||||
neutron-ovn-db-sync-util --config-file /etc/neutron/neutron.conf
|
-v /var/log/containers/neutron:/var/log/neutron:Z
|
||||||
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini
|
-v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:Z
|
||||||
--ovn-neutron_sync_mode migrate
|
--privileged=True --network host --user root
|
||||||
|
{{ neutron_server_image.stdout }}
|
||||||
|
neutron-ovn-db-sync-util --config-file /etc/neutron/neutron.conf
|
||||||
|
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini
|
||||||
|
--log-file /var/log/neutron/neutron-db-sync.log
|
||||||
|
--ovn-neutron_sync_mode migrate
|
||||||
|
--debug
|
||||||
|
when: ovn_central is defined
|
||||||
|
|
||||||
|
- name: remove db-sync container
|
||||||
|
command: podman rm -f {{ ovn_db_sync_container }}
|
||||||
|
when: ovn_central is defined
|
||||||
|
|
||||||
|
- name: start neutron_api containers
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: tripleo_neutron_api
|
||||||
|
state: started
|
||||||
|
|
||||||
- name: Pause and let ovn-controllers settle before doing the final activation (5 minute)
|
- name: Pause and let ovn-controllers settle before doing the final activation (5 minute)
|
||||||
pause: minutes=5
|
pause: minutes=5
|
||||||
|
Loading…
Reference in New Issue
Block a user