Symptoms:
7.x
The Nova database contains records of deleted instances. Cleaning this up before upgrade should speed up the time to upgrade the Nova database.
Impact/Risks:
Warning: This procedure modifies the database. Ensure to take a backup of the deployment before proceeding. See Backup and Restore.
This will move deleted rows from production tables to shadow tables. --verbose will print the results of the archive operation for any tables that were changed.
# nova-manage db archive_deleted_rows --verbose --until-complete --max_rows 10000
Archiving....complete
+------------------------------+-------------------------+
| Table | Number of Rows Archived |
+------------------------------+-------------------------+
| API_DB.instance_group_member | 0 |
| API_DB.instance_mappings | 22 |
| API_DB.request_specs | 22 |
| block_device_mapping | 22 |
| instance_actions | 53 |
| instance_actions_events | 53 |
| instance_extra | 22 |
| instance_faults | 1 |
| instance_id_mappings | 22 |
| instance_info_caches | 22 |
| instance_metadata | 1 |
| instance_system_metadata | 256 |
| instances | 22 |
| virtual_interfaces | 22 |
+------------------------------+-------------------------+
This will delete rows from shadow tables. --verbose will cause information to be printed about purged records.
# nova-manage db purge --all --verbose
DB: Deleted 22 rows from shadow_block_device_mapping based on timestamp column (n/a)
DB: Deleted 53 rows from shadow_instance_actions based on timestamp column (n/a)
DB: Deleted 53 rows from shadow_instance_actions_events based on timestamp column (n/a)
DB: Deleted 22 rows from shadow_instance_extra based on timestamp column (n/a)
DB: Deleted 1 rows from shadow_instance_faults based on timestamp column (n/a)
DB: Deleted 22 rows from shadow_instance_id_mappings based on timestamp column (n/a)
DB: Deleted 22 rows from shadow_instance_info_caches based on timestamp column (n/a)
DB: Deleted 1 rows from shadow_instance_metadata based on timestamp column (n/a)
DB: Deleted 256 rows from shadow_instance_system_metadata based on timestamp column (n/a)
DB: Deleted 22 rows from shadow_instances based on timestamp column (n/a)
DB: Deleted 22 rows from shadow_virtual_interfaces based on timestamp column (n/a)
Note: The command will take some time to execute especially with large amounts of records.