Over time, the openstack databases will grow into infinity, because nothing is actually. Deleted resources will only be "soft deleted" in the database. All modules has commands for housekeeping.
root@novaapi1:~# nova-manage db archive_deleted_rows --verbose --until-complete --purge # if this fails, try to run first. Select a fairly recent date (you should get a hint from the error) root@novaapi1:~# nova-manage db purge --before dd.mm.yyyy --all --verbose --all-cells |
# <days> means, "purge all records older than <days>" root@cinder1:~# cinder-manage db purge <days> |
If you run into a bug, like this. Some manual housekeeping will be required:
# List all volumes that has been deleted, but the attachment is not marked as deleted: MariaDB [cinder]> SELECT volumes.id,volumes.deleted_at,volume_attachment.id,volume_attachment.deleted_at FROM volumes INNER JOIN volume_attachment ON volumes.id=volume_attachment.volume_id WHERE volumes.deleted_at IS NOT NULL AND volume_attachment.deleted_at IS NULL; +--------------------------------------+---------------------+--------------------------------------+------------+ | id | deleted_at | id | deleted_at | +--------------------------------------+---------------------+--------------------------------------+------------+ | 1588f08b-8014-4997-b874-9268fbf99315 | 2018-06-21 13:56:43 | ad9d1a73-4754-4db0-a9a6-d1f2a96d3c87 | NULL | +--------------------------------------+---------------------+--------------------------------------+------------+ # If this returns something, then update the deleted_at column for every volume_attachment listed. Just use the timstamp from volumes.deleted_at UPDATE volume_attachment SET deleted=1, deleted_at='2018-06-21 13:56:43' WHERE id='ad9d1a73-4754-4db0-a9a6-d1f2a96d3c87'; |
# <days> means, "purge all records older than <days>" root@heatapi1:~# heat-manage purge_deleted <days> |