Bug 1154875 - Add DB cleanup functionality to nova-manage.
Summary: Add DB cleanup functionality to nova-manage.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: Upstream M2
: 14.0 (Rocky)
Assignee: Dan Smith
QA Contact: Joe H. Rahme
URL: https://blueprints.launchpad.net/nova...
Whiteboard: upstream_milestone_none upstream_defi...
: 1283619 1500362 1540637 (view as bug list)
Depends On:
Blocks: 1541693 1595886 1595887 1732852 1894145
TreeView+ depends on / blocked
 
Reported: 2014-10-20 21:57 UTC by Summer Long
Modified: 2022-08-09 14:35 UTC (History)
18 users (show)

Fixed In Version: openstack-nova-18.0.0-0.20180710150340.8469fa7
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1595886 1595887 (view as bug list)
Environment:
Last Closed: 2019-01-11 11:47:00 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 137669 0 None ABANDONED Adds an archival framework to Nova 2020-12-09 10:14:03 UTC
OpenStack gerrit 200224 0 None MERGED Spec: add nova-manage db purge-deleted-instances 2020-12-09 10:14:04 UTC
OpenStack gerrit 203751 0 None ABANDONED Purge soft-deleted instances cmd 2020-12-09 10:14:32 UTC
Red Hat Issue Tracker OSP-8466 0 None None None 2022-08-09 14:35:23 UTC
Red Hat Knowledge Base (Solution) 3190162 0 None None None 2018-03-09 14:52:05 UTC
Red Hat Product Errata RHEA-2019:0045 0 None None None 2019-01-11 11:48:10 UTC

Description Summer Long 2014-10-20 21:57:46 UTC
Description of problem:
Need an update of nova-manage tool to help with Compute housekeeping. Currently, the main housekeeping job (manual, that is) for Compute is that of DB cleanup. From Russell, "Nova (and other services) use a "soft delete" of rows.  Instead of actually deleting the instance record from the database, we just mark a deleted column.  Some may want to delete all of these occasionally."

Adding this to the tool would be user friendly (the alternative is to write down instructions).

Comment 2 Stephen Gordon 2014-12-24 15:23:41 UTC
Is it possible to get a Kbase on covering manual steps for now? If this was covered as part of the more general discussion around cleanup tasks then please link it.

Comment 3 Summer Long 2015-01-04 23:31:44 UTC
Russell responded with the above to an email question about Compute housekeeping. Martin Lopes has been working on a housekeeping article to include what we do know: https://bugzilla.redhat.com/show_bug.cgi?id=1154535

Comment 6 Dan Smith 2015-08-07 14:51:15 UTC
There are a couple of ongoing upstream efforts to address this:

https://review.openstack.org/#/c/200224/

https://review.openstack.org/#/c/137669/

Comment 7 Radomir Dopieralski 2016-02-25 15:36:21 UTC
This is being worked on upstream already: https://review.openstack.org/#/c/203751/

Comment 8 Radomir Dopieralski 2016-02-29 13:45:26 UTC
We will monitor the progress of work on this, and grab this patch the moment it merges. However, it's at -2 for process reasons right now (no new features are accepted in this version anymore), so it will not be merged until OSP10/newton.

Comment 9 Stephen Gordon 2016-04-09 22:41:04 UTC
*** Bug 1283619 has been marked as a duplicate of this bug. ***

Comment 11 Stephen Gordon 2016-04-20 19:28:27 UTC
This is currently stalled and thus it is not clear this will make Newton, we will continue to monitor. Note that going forward as certain objects move to the new API database they will no longer have "soft-deletion" and as a result wont leave as many spurious database records around. This will not be the case for the instance records though.

Comment 20 Stephen Gordon 2017-03-14 16:52:32 UTC
Moved to Queens/RHOSP 13 to reflect current upstream reality, upstream work on this item has stalled and will need to be restarted.

Comment 21 Stephen Gordon 2017-07-18 18:56:31 UTC
Removing Triaged, this needs to be re-assessed.

Comment 25 Dan Smith 2018-03-09 14:50:22 UTC
*** Bug 1540637 has been marked as a duplicate of this bug. ***

Comment 26 Dan Smith 2018-03-09 14:52:05 UTC
*** Bug 1500362 has been marked as a duplicate of this bug. ***

Comment 27 Dan Smith 2018-03-09 14:57:49 UTC
This is now fully merged upstream.

To test this, it's possible to just use the existing archive command on a database with deleted records:

 nova-manage db archive_deleted_rows --all-cells --purge --verbose --until-complete

The verbose output should show many rows archived, and purged. When complete, the shadow tables (shadow_instances for example) should be empty.

Comment 31 errata-xmlrpc 2019-01-11 11:47:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:0045


Note You need to log in before you can comment on or make changes to this bug.