ovn-migration: Change network type from vxlan to Geneve

The patch goes to one of ovn-dbs nodes and runs a SQL query to change
all vxlan networks to Geneve. It's done via Python and sqlalchemy in
neutron_api container because mysql client is not installed there. This
approach was chosen to avoid installing more dependencies.

Change-Id: Ic417a115fdc212527866122bc9d3c93ea9599bdf
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
This commit is contained in:
Jakub Libosvar 2021-03-19 16:55:41 +01:00
parent 80dfbb0371
commit d3fce77ff5
3 changed files with 21 additions and 0 deletions

View File

@ -33,6 +33,16 @@
tags:
- migration
# It runs tasks on ovn-dbs nodes
# 1. Change vxlan network type to Geneve
- name: Prepare controllers
hosts: ovn-dbs
roles:
- prepare-controllers
tags:
- migration
#
# TripleO / Director is executed to deploy ovn using "br-migration" for the
# dataplane, while br-int is left intact to avoid dataplane disruption.

View File

@ -0,0 +1,2 @@
---
neutron_conf_path: /var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf

View File

@ -0,0 +1,9 @@
---
- name: Get DB connection string
command: crudini --get {{ neutron_conf_path }} database connection
when: ovn_central is defined
register: mysql_url
- name: Change vxlan networks to Geneve
shell: podman exec -it neutron_api python3 -c $'from sqlalchemy import create_engine\nengine = create_engine("{{ mysql_url.stdout }}")\nwith engine.connect() as conn:\n\tconn.execute("update networksegments set networksegments.network_type=\'geneve\' where networksegments.network_type=\'vxlan\';")'
when: ovn_central is defined