This repository contains a few useful tools to manage your instances on OpenStack. It was written to support our backup needs in an environment created to run volatile services.
WARNING: we use snapshots as a way to create crash consistent backups. These
backups may not include all data. Any data not sync
'd to disk may be lost.
Read more about crash consistent vs. application consistent.
Configure your OpenStack cloud(s). The example and default is based on Fuga.
- Copy
clouds.yaml.example
toclouds.yaml
and fill in your details. - Copy
secure.yaml.example
tosecure.yaml
and fill in your password.
We suggest you run this from a virtualenv.
virtualenv -p python3 env
. env/bin/activate
pip install -r requirements.txt
./snapshot.py
This takes two optional arguments:
--include
can be used to specify servers that you want to include. Specify multiple times to include more servers.--exclude
can be used to exclude servers from making snapshots. Specify multiple times to exclude more servers.
It will create a snapshot of all servers by default.
openstack volume snapshot list
./restore.py --snapshot <id> --volume <name>
These scripts were written using Python 3.6. Other versions may work but are untested.
Sorry, this code doesn't come with tests yet.