-
Notifications
You must be signed in to change notification settings - Fork 0
chore: initial commit with the configurations files #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Eduardo-Morais
wants to merge
23
commits into
main
Choose a base branch
from
migration-tool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 180b358
Update migration/tasks/main.yml
Eduardo-Morais c0d6615
Update migration/tasks/main.yml
Eduardo-Morais 005b9c3
Update migration/tasks/ovn_deploy.yml
Eduardo-Morais f81464c
Update migration/tasks/finishing_the_migration.yml
Eduardo-Morais b3579b5
Update migration/tasks/finishing_the_migration.yml
Eduardo-Morais ca5a45d
Update migration/tasks/main.yml
Eduardo-Morais f849d16
Update migration/tasks/preparing_netron_to_migration.yml
Eduardo-Morais b656ae1
fix: I fixed some functionalities and made some improvements
Eduardo-Morais fc66862
fix: adjusting the prepare task
Eduardo-Morais 996d2a7
docs: document OVS to OVN migration
Eduardo-Morais 6b920bf
docs: ajusting the README
Eduardo-Morais d15efb0
refactor: change arquive name and update the docs
Eduardo-Morais 41ed7c4
refactor: update tasks
Eduardo-Morais 12839a8
refactor: adjusting some syntaxes
Eduardo-Morais 9a66b88
refactor: changing some task to use a ansible module
Eduardo-Morais a95e8ed
Docs: documentation how migration work with octavia service
Eduardo-Morais 03f232d
Docs: documentation how migration work with octavia service
Eduardo-Morais d224206
Docs: documentation how migration work with octavia service
Eduardo-Morais 34d097c
refactor: use VIP variable for Galera Cluster connection
Eduardo-Morais 26f5480
docs: tested octavia with ovn driver
Eduardo-Morais a29e5a3
docs: fixing the Readme
Eduardo-Morais 8ab56bb
feat: add a db sync
Eduardo-Morais File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
| 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**. | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||
| --- | ||||
|
|
||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| mariadb_user: | ||
| mariadb_password: | ||
| path_to_hosts: | ||
| vip_address: |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.