Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6f442da
chore: initial commit with the configurations files
Eduardo-Morais Jan 21, 2026
180b358
Update migration/tasks/main.yml
Eduardo-Morais Jan 22, 2026
c0d6615
Update migration/tasks/main.yml
Eduardo-Morais Jan 22, 2026
005b9c3
Update migration/tasks/ovn_deploy.yml
Eduardo-Morais Jan 22, 2026
f81464c
Update migration/tasks/finishing_the_migration.yml
Eduardo-Morais Jan 22, 2026
b3579b5
Update migration/tasks/finishing_the_migration.yml
Eduardo-Morais Jan 22, 2026
ca5a45d
Update migration/tasks/main.yml
Eduardo-Morais Jan 23, 2026
f849d16
Update migration/tasks/preparing_netron_to_migration.yml
Eduardo-Morais Jan 23, 2026
b656ae1
fix: I fixed some functionalities and made some improvements
Eduardo-Morais Jan 23, 2026
fc66862
fix: adjusting the prepare task
Eduardo-Morais Jan 26, 2026
996d2a7
docs: document OVS to OVN migration
Eduardo-Morais Feb 2, 2026
6b920bf
docs: ajusting the README
Eduardo-Morais Feb 2, 2026
d15efb0
refactor: change arquive name and update the docs
Eduardo-Morais Mar 25, 2026
41ed7c4
refactor: update tasks
Eduardo-Morais Mar 26, 2026
12839a8
refactor: adjusting some syntaxes
Eduardo-Morais May 4, 2026
9a66b88
refactor: changing some task to use a ansible module
Eduardo-Morais May 5, 2026
a95e8ed
Docs: documentation how migration work with octavia service
Eduardo-Morais May 8, 2026
03f232d
Docs: documentation how migration work with octavia service
Eduardo-Morais May 8, 2026
d224206
Docs: documentation how migration work with octavia service
Eduardo-Morais May 8, 2026
34d097c
refactor: use VIP variable for Galera Cluster connection
Eduardo-Morais May 11, 2026
26f5480
docs: tested octavia with ovn driver
Eduardo-Morais May 11, 2026
a29e5a3
docs: fixing the Readme
Eduardo-Morais May 11, 2026
8ab56bb
feat: add a db sync
Eduardo-Morais Jul 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 114 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,114 @@
# migration-tool-openstack-kolla
# Migration Tool – OVS to OVN (Kolla OpenStack)

## Overview

This repository provides an **Ansible-based migration tool** to migrate an OpenStack environment from **Neutron Open vSwitch (OVS)** to **Neutron OVN**, specifically designed for **Kolla**.

The migration process is based on existing community approaches, with adaptations to better fit the Kolla architecture. While the tool has been tested in several scenarios, it may still require adjustments depending on the target environment.

> **Important:** Before running this migration, it is **strongly recommended** to create a **full backup** of your OpenStack environment.
Comment thread
Eduardo-Morais marked this conversation as resolved.
https://docs.openstack.org/kolla-ansible/latest/admin/mariadb-backup-and-restore.html
---

## Scope and Assumptions

- OpenStack deployed using **Kolla**
- Migration path: **Neutron OVS → Neutron OVN**
- Open vSwitch is **not removed** during the migration
- Networking control is transferred from OVS to OVN

---

## Migration Workflow

The migration is executed through an **Ansible playbook** and is divided into three main steps.

---

### Step 1 – Stop OVS Services and Clean OVS State

The playbook performs the following actions:

- Stops systemd services related to **Neutron OVS**
- Stops the **Neutron service**
- Removes existing **Open vSwitch flows**
- Cleans the **`br-tun` bridge**

#### Why this step is required

- `br-tun` is **not used by OVN**
- Existing OVS flows may conflict with OVN rules
- Ensures a clean transition to OVN

> ℹ️ **Note:** OVS remains installed after this step, but it is no longer managed by Neutron.

---

### Step 2 – Switch Neutron Plugin and Deploy OVN

This step updates the OpenStack configuration to use OVN:

- Updates the Neutron plugin in `globals.yml`
- Deploys **OVN services**
- Adds required **OVN configuration options** to Neutron configuration files
- Reconfigures Neutron to apply OVN settings

After this step, Neutron is fully configured to operate with OVN.

---

### Step 3 – Database Adjustment

A small but critical database change is performed:

- Updates the `providerresourceassociations` table
- Removes legacy **OVS-related entries**
- Ensures the provider information reflects **OVN**

#### Why this step is necessary

Without this adjustment, the system may appear functional but will fail after:

- Neutron service restarts
- Host reboots

Neutron will attempt to register OVN as the provider, but the table will already be populated with OVS data, causing network failures.

Once this step is completed, the migration is considered **finalized**.

---

## Important Notes

- **Always back up your environment before running the migration**
- Tested in limited environments; additional tuning may be required
- **Octavia compatibility**

> **This migration has NOT been tested with Octavia (Load Balancer as a Service).**
> Environments using Octavia may encounter unexpected behavior.
> Thorough testing in a staging environment is strongly recommended.

---

## Migration Status

- [x] Neutron OVS to OVN migration
- [x] Kolla-specific workflow
- [x] Tested with Octavia with Amphora driver
- [x] Tested with Octavia with OVN driver

---

## About Octavia

In tests using the tool, Octavia with the Amphora driver did not show any errors or critical issues. However, in the UI, the provisioning status remains in an error state even though the load balancer continues to work correctly. You can fix this by running a simple **openstack loadbalancer failover <loadbalancer-id>**. Using Octavia with the OVN driver has not been tested yet.

---

## Disclaimer

This tool modifies core networking components and database entries in OpenStack.
Use it at your own risk and **never run directly in production without prior validation**.



7 changes: 7 additions & 0 deletions init_migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: migration OVS plugin to OVN
hosts: control
gather_facts: yes
become: true
roles:
- role: migration
17 changes: 17 additions & 0 deletions migration/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---

- name: Stop Neutron service
ansible.builtin.import_tasks: prepare_neutron.yml
tags:
- stop-neutron

- name: Deploy OVN plugin
ansible.builtin.import_tasks: ovn_deploy.yml
tags:
- deploy-ovn

- name: Clean the database and finish the migration
ansible.builtin.import_tasks: post_migration.yml
tags:
- cleaning-bd

43 changes: 43 additions & 0 deletions migration/tasks/ovn_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Suggested change

- name: Replace ML2 plugin from OVS to OVN
ansible.builtin.replace:
path: /etc/kolla/globals.yml
regexp: '^neutron_plugin_agent: "openvswitch"'
replace: 'neutron_plugin_agent: "ovn"'

- name: Deploy OVN service
shell: kolla-ansible deploy -i {{ path_to_hosts }} -t ovn

- name: Get file stats
stat:
path: /etc/kolla/config/neutron/ml2_conf.ini
register: ml2_conf_file

- name: Ensure neutron config directory and ml2_conf.ini exist
file:
path: "{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
loop:
- { path: /etc/kolla/config/neutron, state: directory, mode: '0755' }
- { path: /etc/kolla/config/neutron/ml2_conf.ini, state: touch, mode: '0644' }

- name: Set OVN options in ml2_conf.ini
ini_file:
path: /etc/kolla/config/neutron/ml2_conf.ini
section: ovn
option: "{{ item.option }}"
value: "{{ item.value }}"
loop:
- { option: neutron_sync_mode, value: repair }
- { option: ovn_l3_mode, value: "True" }
- { option: vif_type, value: ovs }

- name: Reconfigure the neutron service
shell: kolla-ansible reconfigure -i {{ path_to_hosts }} -t neutron

- name: Sync existing data
shell: docker exec neutron_server neutron-ovn-db-sync-util --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
register: sync_result
failed_when: sync_result.rc != 0 and "Deprecated" not in sync_result.stderr
16 changes: 16 additions & 0 deletions migration/tasks/post_migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

- name: Delete rows via Docker Exec module
community.docker.docker_container_exec:
container: mariadb
command: >
mysql -h {{ vip_address }}
-u {{ mariadb_user }}
-p{{ mariadb_password }}
-e "DELETE FROM providerresourceassociations;"
neutron
register: result

- name: Reconfigure OVS to get OVN configurations
shell: kolla-ansible reconfigure -i {{ path_to_hosts }} -t openvswitch

21 changes: 21 additions & 0 deletions migration/tasks/prepare_neutron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

- name: Stoping neutron OVS services on systemd
shell: systemctl disable {{ item }}
loop:
- kolla-neutron_metadata_agent-container.service
- kolla-neutron_l3_agent-container.service
- kolla-neutron_openvswitch_agent-container.service

- name: Stoping neutron to aplication configurations
shell: kolla-ansible stop -i {{ path_to_hosts }} -t neutron --yes-i-really-really-mean-it

- name: Configure OVS container
command: docker exec openvswitch_vswitchd {{ item }}
loop:
- ovs-vsctl del-br br-tun
- ovs-vsctl set Bridge br-ex protocols=[]
- ovs-vsctl set Bridge br-int protocols=[]

- name: Clean network namespaces
shell: ip -all netns delete
5 changes: 5 additions & 0 deletions migration/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
mariadb_user:
mariadb_password:
path_to_hosts:
vip_address: