diff --git a/doc/source/admin/maintenance-tasks.rst b/doc/source/admin/maintenance-tasks.rst index 4e219ecdb4..8dfff4de42 100644 --- a/doc/source/admin/maintenance-tasks.rst +++ b/doc/source/admin/maintenance-tasks.rst @@ -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 diff --git a/doc/source/admin/maintenance-tasks/inventory-backups.rst b/doc/source/admin/maintenance-tasks/inventory-backups.rst new file mode 100644 index 0000000000..d6b67b734b --- /dev/null +++ b/doc/source/admin/maintenance-tasks/inventory-backups.rst @@ -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 diff --git a/doc/source/admin/troubleshooting.rst b/doc/source/admin/troubleshooting.rst index 6fda8aa136..5850129ec5 100644 --- a/doc/source/admin/troubleshooting.rst +++ b/doc/source/admin/troubleshooting.rst @@ -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.