Revision history [back]

click to hide/show revision 1
initial version

Well. At the end I have tested the cleanup script on our system. First run i got a problem because the command "openstack server list --all" was retuning one API error for orphaned object on database.

Unexpected exception in API method: OrphanedObjectError: Cannot call obj_load_attr on orphaned Instance object

After some a deep analysis i found the problem: for one unknown reason (maybe for internal scheduling processes or locks) the first run didn't delete one record on nova_cell0:

nova_cell0.block_device_mapping WHERE instance_uuid = 'my-uuid-number'

A second run of the script solved the issue and now my openstack is clean!

I suggest to all to use this workaround just when you don have any other chance and to test it in deep in a lab environment because the database fields used are strictly related to your OpenStack version and your architecture.

Pay attention: I take no responsability for any data loss or corruption when using this procedure and make sure to have a consistent backup and test a restore before stanting manipulate your db.

Have fun