From ad7f6bf573ce5deb31463c0aac8685607c20096a Mon Sep 17 00:00:00 2001
From: Claudio Pisa <claudio.pisa@garr.it>
Date: Wed, 16 Mar 2022 18:01:01 +0100
Subject: [PATCH] update README

---
 openstack/README.rst | 60 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/openstack/README.rst b/openstack/README.rst
index 15522c1..b2618d4 100644
--- a/openstack/README.rst
+++ b/openstack/README.rst
@@ -1,3 +1,63 @@
+OpenStack backup scripts
+========================
+
+This directory contains scripts to create automated snapshots of OpenStack volumes.
+The snapshots are deleted after a specified duration interval.
+
+Usage
+-----
+
+First of all install the QEMU Guest Agent package inside the target OpenStack instance. e.g.::
+
+    sudo apt update && sudo apt install qemu-guest-agent
+
+The QEMU Guest Agent is a daemon which allows the creation of consistent volume snapshots while the instance is running.
+
+You will also need an OpenStack openrc file, possibly based on Application Credentials.
+This can be obtained through the OpenStack dashboard, under Identity --> Application Credentials --> Create Application Credential --> set a name and other parameters if needed --> Create Application Credential --> Download openrc file.
+
+
+The following scripts are included in this directory:
+
+- ``volume_snapshots.sh``, which creates the actual snapshots with a set retention interval;
+- ``remove_old_snapshots.sh``, which removes the snapshot for which the retention interval has expired.
+
+Before using these scripts, you will need to edit them and substitute in each the line::
+
+    /home/ubuntu/rcs/app-cred-workplace_snapshots-openrc.sh
+
+with the path of your own openrc file.
+
+
+volume_snapshots.sh
+~~~~~~~~~~~~~~~~~~~
+
+Usage::
+
+    ./volume_snapshot.sh <short_name> <volume ID> <region> [<retain seconds>]
+
+where:
+
+- ``short_name`` is a short identifier for the instance
+- ``volume ID`` is the OpenStack volume UUID
+- ``region`` is the OpenStack region in which the volume is located
+- ``retain seconds`` is the number of seconds for which the snapshot will be retained. The default is 24 hours
+
+The script will perform a volume snapshot and include a metadata parameter with the chosen snapshot duration.
+
+
+remove_old_snapshots.sh
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Usage::
+
+    ./remove_old_snapshots.sh
+
+The script will check the expiration of the snapshots against their creation date and remove the snapshots which have expired.
+
+
+crontab
+-------
 
 Example crontab lines::
 
-- 
GitLab