Any problems using archive_deleted_rows or purge in nova-manage db?

I was looking at our database usage recently and discovered that we have over 88K deleted instances in our database.

All of our instances are very transient. We provision a given template via Heat, do what we need to and then tear it all down again. So we move through a lot of instances on a daily basis.

No one really uses Horizon except for myself to investigate when things go wonky.

Are there any issues with running nova-manage db archive_deleted_rows --purge on a daily basis to keep things tidy in the nova database? We never really have to go back and look at an instance as they are truly treated as ephemeral.

Alternatively, is there a configuration option in nova.conf that I am missing that would delete the instances from the database rather than a soft delete?

Posted Nov 16, 2022, 3:12 PM UTC

13
LewisDenny_•

Hey u/expressadmin

This is what we are doing in Tripleo, the random sleep was added due to a bug with the 3 controller nodes running the nova-manage commands at once.

[root@controller-0 tripleo-admin]# podman exec -u nova -it nova_api_cron crontab -l
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 0 * * * sleep `expr ${RANDOM} \% 3600`; nova-manage db archive_deleted_rows --max_rows 1000 --before `date --date='today - 90 days' +\%F` --until-complete --all-cells >>/var/log/nova/nova-rowsflush.log 2>&1


PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
0 5 * * * sleep `expr ${RANDOM} \% 3600`; nova-manage db purge --before `date --date='today - 14 days' +\%D` --all-cells >>/var/log/nova/nova-rowspurge.log 2>&1

I'm not sure about an option to disable the soft delete, I couldn't see anything relevant when I took a look in the nova.conf

2
expressadminOP•

Thanks for the reply.

You didn't see any negative impacts from running this?

2
LewisDenny_•

No certainly not, this is implemented by default mate.

If you have any concerns you can always take a backup of the nova database.

2