Package: a10-nlbaas2oct
This tool has been designed to migration A10 devices and their associated neutron lbaas objects from the Neutron database to Octavia.InstallationInstall from PyPipip install a10-nlbaas2octInstall from Sourcegitclonegit@github.com:a10networks/a10-nlbaas2oct.gitcda10-nlbaas2octpipinstall-e.Note: This tool must be installed on the host running neutron-lbaasUsageStep 1: Copy the sample config file from the project to another directoryInstalled from PyPipip show a10-nlbaas2oct | grep "Location" | cp $(awk '{print $2}')/a10_nlbaas2oct/a10_nlbaas2oct.conf /path/to/another/directoryInstalled from sourcecp /path/to/a10-nlbaas2oct/a10_nlbaas2oct/a10_nlbaas2oct.conf /path/to/another/directorySample Config File Contents[DEFAULT]

debug = True

[migration]

# Run without making changes
# trial_run = False

# Delete the load balancer records from neutron-lbaas after migration
# delete_after_migration = False

# Octavia service account ID or username (ex: admin)
octavia_account_id =

# Example db connection string:
# connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia
# Replace 127.0.0.1 above with the IP address of the database used by the
# main octavia server. (Leave it as is if the database runs on this host.)

# Connection string for the keystone databas
keystone_db_connection =

# Connection string for the neutron database
neutron_db_connection =

# Connection string for the octavia database
octavia_db_connection =

# Connection string for the A10 database used in neutron lbaas env
# a10_nlbaas_db_connection =

# Connection string for the A10 database used in the octavia env
# a10_oct_connection =

# Path to config file. Default is /etc/a10/config.py
a10_config_path = /etc/a10/config.pyStep 2: Modify the config fileDatabase connection string locationsThekeystone_db_connectioncan be found in the/etc/keystone/keystone.conffile under thedatabasegroup.[database]
connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8Theneutron_db_connectioncan be found in the/etc/neutron/neutron.conffile under thedatabasegroup.[database]
connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8Theoctavia_db_connectioncan be found be found in the/etc/octavia/octavia.conffile under thedatabasegroup.[database]
connection = mysql+pymysql://root:password@127.0.0.1:3306/octaviaConfig for migrating from Neutron LBaaS to Octavia on the same host# Octavia service account ID or username (ex: admin)
octavia_account_id = admin

# Connection string for the keystone databas
keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8

# Connection string for the neutron database
neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8

# Connection string for the octavia database
octavia_db_connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia

# Path to config file. Default is /etc/a10/config.py
a10_config_path = /etc/a10/config.pyConfig for migrating from Neutron LBaaS to Octavia across hosts# Octavia service account ID or username (ex: admin)
octavia_account_id = admin

# Connection string for the keystone databas
keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8

# Connection string for the neutron database
neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8

# Connection string for the octavia database
octavia_db_connection = mysql+pymysql://root:password@<b>ip_address_of_remote_host</b>:3306/octavia

# Path to config file. Default is /etc/a10/config.py
a10_config_path = /etc/a10/config.pyPerforming cross host migration when A10 database is seperate from Neutron DB and Octavia DB# Octavia service account ID or username (ex: admin)
octavia_account_id = admin

# Connection string for the keystone databas
keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8

# Connection string for the neutron database
neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8

# Connection string for the octavia database
octavia_db_connection = mysql+pymysql://root:password@<b>ip_address_of_remote_host</b>:3306/octavia

# Path to config file. Default is /etc/a10/config.py
a10_config_path = /etc/a10/config.py

# Connection string for the A10 database used in neutron lbaas env
a10_nlbaas_db_connection = mysql+pymysql://user:password@127.0.0.1/a10_db

# Connection string for the A10 database used in the octavia env
a10_oct_connection = mysql+pymysql://user:password@<b>ip_address_of_remote_host</b>/a10_dbPerforming migration when using parent projects# Octavia service account ID or username (ex: admin)
octavia_account_id = admin

# Connection string for the keystone database
<b>keystone_db_connection = mysql+pymysql://user:password@127.0.0.1/keystone?charset=utf8</b>

# Connection string for the neutron database
neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8

# Connection string for the octavia database
octavia_db_connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia

# Path to config file. Default is /etc/a10/config.py
a10_config_path = /etc/a10/config.pyStep 3: Perform the migrationMigrate a single loadbalancer and its child objectsa10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --lb-id <loadbalancer_id>Note: This takes in the UUID of the loadbalancer **not*the name*Migrate all lbaas objects in a projecta10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --project-id <project_id>Note: This takes in the UUID of the project **not*the name*Migrate all lbaas objectsa10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --allStep 4 (OPTIONAL): Cleanup post migrationThere is a foreign key association with the VIP Port in the Neutron port table and the VIP entries in the Neutron lbaas_loadbalancer table. When performing a migration from Neutron LBaaS to Octavia, the VIPs are migrated to their own table and VIP port ownership is transferred to Octavia.However, that foreign key relationship between VIP and VIP Port will still exist in the Neutron lbaas_loadbalancer table and the port table. Therefore, a delete action on either the load balancer in the Neutron LBaaS table or the Octavia will result in a failure due to the deadlocked foreign key state. As such, it is required that the Neutron LBaaS database entries are deleted or otherwise made inaccessible before performingdeletecommands via Octavia.a10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf [--lb-id <lb_id> | --all | --project-id <project_id>]  --cleanupThis step is only necessary if the delete_after_migration was not set to True in the config.Note to ReaderThe vast majority of this tooling was copied and modified from openstack’s neutron-lbaas repo for ease of use purposes. The
original can be found herehttps://github.com/openstack/neutron-lbaas/tree/stable/stein/tools/nlbaas2octavia