Cleanup database(s)
Eugen Block
eblock at nde.ag
Mon Mar 8 13:18:56 UTC 2021
Hi *,
I have a quick question, last year we migrated our OpenStack to a
highly available environment through a reinstall of all nodes. The
migration went quite well, we're working happily in the new cloud but
the databases still contain deprecated data. For example, the
nova-scheduler logs lines like these on a regular basis:
/var/log/nova/nova-scheduler.log:2021-02-19 12:02:46.439 23540 WARNING
nova.scheduler.host_manager [...] No compute service record found for
host compute1
This is one of the old compute nodes that has been reinstalled and is
now compute01. I tried to find the right spot to delete some lines in
the DB but there are a couple of places so I wanted to check and ask
you for some insights.
The scheduler messages seem to originate in
/usr/lib/python3.6/site-packages/nova/scheduler/host_manager.py
---snip---
for cell_uuid, computes in compute_nodes.items():
for compute in computes:
service = services.get(compute.host)
if not service:
LOG.warning(
"No compute service record found for host %(host)s",
{'host': compute.host})
continue
---snip---
So I figured it could be this table in the nova DB:
---snip---
MariaDB [nova]> select host,deleted from compute_nodes;
+-----------+---------+
| host | deleted |
+-----------+---------+
| compute01 | 0 |
| compute02 | 0 |
| compute03 | 0 |
| compute04 | 0 |
| compute05 | 0 |
| compute1 | 0 |
| compute2 | 0 |
| compute3 | 0 |
| compute4 | 0 |
+-----------+---------+
---snip---
What would be the best approach here to clean up a little? I believe
it would be safe to simply purge those lines containing the old
compute node, but there might be a smoother way. Or maybe there are
more places to purge old data from?
I'd appreciate any ideas.
Regards,
Eugen
More information about the openstack-discuss
mailing list