nova-manage db purge-deleted-instances

Registered by Matt Riedemann on 2015-07-09

Until we have automated DB archival (https://review.openstack.org/#/c/137669/) or no more soft delete (https://review.openstack.org/#/c/184645/) we should have a way to purge soft deleted instances from the database along with their related meta tables like instance_metadata, instance_system_metadata, instance_info_cache, instance_extra, tags, etc. basically whatever shows up under nova.objects.Instance.INSTANCE_OPTIONAL_ATTRS:

http://git.openstack.org/cgit/openstack/nova/tree/nova/objects/instance.py#n53

This would be similar to the nova-manage db null-instance-uuid-scan command:

http://git.openstack.org/cgit/openstack/nova/tree/nova/cmd/manage.py#n954

Which scans the database looking for instance_uuid records in other tables where the uuid value is NULL and then deletes them, and has a sort of dry-run option so you can see what would be deleted if you actually do it, and the help message would point out that this is actually doing to delete data so be careful.

Then it just goes and finds all soft-deleted instances along with those related meta tables and deletes them all (the purge).

Lots of deployments already have a set of tools/scripts that already do something like this but they have to go directly into the nova database to do it, with a nova-manage db command we can at least ship it with the code and test it until better solutions are implemented, like the aforementioned archive or no more soft delete specs.

Blueprint information

Status:
Started
Approver:
Dan Smith
Priority:
Medium
Drafter:
Matt Riedemann
Direction:
Needs approval
Assignee:
Nicolas Hicher
Definition:
Pending Approval
Series goal:
None
Implementation:
Needs Code Review
Milestone target:
None
Started by
John Garbutt on 2015-10-02

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/purge-deleted-instances-cmd,n,z

Addressed by: https://review.openstack.org/200224
    Spec: add nova-manage db purge-deleted-instances

Addressed by: https://review.openstack.org/203751
    This commit adds the functionality to purge soft-deleted instances from the DB, along with data in tables directly related to the soft-deleted instance.

Sorry, we have now hit the Non-Priority Feature Freeze for Mitaka. For more details please see: http://docs.openstack.org/releases/schedules/mitaka.html#m-nova-npff and http://docs.openstack.org/developer/nova/process.html#non-priority-feature-freeze
--johnthetubaguy 2016.02.08

Addressed by: https://review.openstack.org/330791
    Purge soft-deleted instances cmd

Addressed by: https://review.openstack.org/331204
    Purge soft-deleted instances cmd

Addressed by: https://review.openstack.org/331350
    Purge soft-deleted instances cmd

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.