Data Migration on nova-cloud-controller¶
This document explains the details of the database migration for nova-cloud-controller.
nova-cloud-controller Database Migration Details¶
When users upgrade the Juju application nova-cloud-controller, the commands nova-manage db sync and nova-manage db online_data_migration will be executed.
nova-manage db sync - Upgrades the main database schema to the most recent version.
nova-manage db online_data_migration - Performs data migration to update all live data.
db sync¶
Before the Yoga version, nova-cloud-controller used SQLAlchemy to handle database migrations. Starting from Yoga, it switched to Alembic, a migrations tool for SQLAlchemy.
Below is a table showing the migration versions from Ussuri to Caracal.
Version |
Migration Version |
---|---|
Ussuri |
407 |
Victoria |
412 |
Wallaby |
417 |
Xena |
422 |
Yoga |
422
- (move to Alembic)
- |
Zed |
|
2023.1 (Antelope) |
|
2023.2 (Bobcat) |
|
2024.1 (Caracal) |
|
Details of each migration can be found at:
db online_data_migration¶
The list of online data migrations can be found at nova_online_migrations. There are only two online migration cases after Victoria:
pci_device_obj.PciDevice.populate_dev_uuids
, added in Victoriainstance_obj.populate_instance_compute_id
, added in 2023.2
On COU¶
Generally, the data migration operation load is not too high, as observed from previous information. COU provides two optional steps, purge and archive, to reduce the possible load during the upgrade. These two COU steps run the following commands on the nova-cloud-controller Juju unit:
db archive_deleted_rows - Run during the archive step; this command moves deleted rows from production tables to shadow tables.
db purge - Run during the purge step; this command deletes rows from shadow tables.
Make sure to check the details of database schema migrations and online data migrations before each upgrade.