Skip to content
Snippets Groups Projects
Commit ad7f6bf5 authored by Claudio Pisa's avatar Claudio Pisa
Browse files

update README

parent dfacfc7e
No related branches found
No related tags found
No related merge requests found
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::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment