Add information about restoring inventory from backup

OSA has long had an inventory archive which can be used to restore
inventory in the even that something goes wrong. This change adds to the
troubleshooting guide to illustrate how to restore inventory from
backup.

Change-Id: Iacba866f1e5b534ecdb620e4890a0c710c8adf5c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-05-03 10:46:38 -05:00 committed by Kevin Carter (cloudnull)
parent 271d67b4a0
commit 8797b7a48f
3 changed files with 69 additions and 0 deletions

View File

@ -10,3 +10,4 @@ maintenance tasks.
.. include :: maintenance-tasks/ansible-modules.rst
.. include :: maintenance-tasks/containers.rst
.. include :: maintenance-tasks/firewalls.rst
.. include :: maintenance-tasks/inventory-backups.rst

View File

@ -0,0 +1,41 @@
Prune Inventory Backup Archive
==============================
The inventory backup archive will require maintenance over a long enough period
of time.
Bulk pruning
------------
It's possible to do mass pruning of the inventory backup. The following example will
prune all but the last 15 inventories from the running archive.
.. code-block:: bash
ARCHIVE="/etc/openstack_deploy/backup_openstack_inventory.tar"
tar -tvf ${ARCHIVE} | \
head -n -15 | awk '{print $6}' | \
xargs -n 1 tar -vf ${ARCHIVE} --delete
Selective Pruning
-----------------
To prune the inventory archive selectively first identify the files you wish to
remove by listing them out.
.. code-block:: bash
tar -tvf /etc/openstack_deploy/backup_openstack_inventory.tar
-rw-r--r-- root/root 110096 2018-05-03 10:11 openstack_inventory.json-20180503_151147.json
-rw-r--r-- root/root 110090 2018-05-03 10:11 openstack_inventory.json-20180503_151205.json
-rw-r--r-- root/root 110098 2018-05-03 10:12 openstack_inventory.json-20180503_151217.json
Now delete the targeted inventory archive.
.. code-block:: bash
tar -vf /etc/openstack_deploy/backup_openstack_inventory.tar --delete openstack_inventory.json-20180503_151205.json

View File

@ -622,3 +622,30 @@ To dump traffic on the ``br-mgmt`` bridge, use ``tcpdump`` to see all
communications between the various containers. To narrow the focus,
run ``tcpdump`` only on the desired network interface of the
containers.
Restoring inventory from backup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OpenStack-Ansible maintains a running archive of inventory. If a change has been
introduced into the system that has broken inventory or otherwise has caused an
unforseen issue, the inventory can be reverted to an early version. The backup
file ``/etc/openstack_deploy/backup_openstack_inventory.tar`` contains a set of
timestamped inventories that can be restored as needed.
Example inventory restore process.
.. code-block:: bash
mkdir /tmp/inventory_restore
cp /etc/openstack_deploy/backup_openstack_inventory.tar /tmp/inventory_restore/backup_openstack_inventory.tar
cd /tmp/inventory_restore
tar xf backup_openstack_inventory.tar
# Identify the inventory you wish to restore as the running inventory
cp openstack_inventory.json-YYYYMMDD_SSSSSS.json /etc/openstack_deploy/openstack_inventory.json
cd -
rm -rf /tmp/inventory_restore
At the completion of this operation the inventory will be restored to the ealier
version.