Adding ability to cleanup database stale resources
Related-Prod: PROD-36574
Change-Id: I6aef843c4800d9b82ce417d6282f018a12a3a058
diff --git a/README.rst b/README.rst
index 07dd64a..f1d4d98 100644
--- a/README.rst
+++ b/README.rst
@@ -538,6 +538,37 @@
# Add key without value to remove line from policy.json
modify_member:
+Execute database maintenance tasks
+----------------------------------
+Cleanup stale records from glance database to make it smaller.
+This is helpful before any upgrade activity.
+It is safe to execute it generally without maintenance window same as online db_sync.
+
+Enable this pillar:
+
+.. code-block:: yaml
+
+ glance:
+ server:
+ db_purge:
+ enabled: True
+
+Execute state glance.db.db_cleanup to purge stale records:
+
+.. code-block:: bash
+
+ salt -C 'I@glance:server:role:primary' state.apply glance.db.db_cleanup -l debug
+
+It is possible to pass days parameter.
+If you skip setting it, all records would be archived/purged:
+
+.. code-block:: yaml
+
+ glance:
+ server:
+ db_purge:
+ enabled: True
+ days: 45
Change files/directories permissions for glance service:
=======================================