Manual OpenStack Backups
Introduction
Awnix’s ARChive is great at completing backups and retaining project and server data. That being said, there are many pieces to the program that enable ARChive to do its main job of backing up your data.
ARChive - a quick overview of how ARChive completes automatic backups
First, when it’s time for a backup job to run, the ARChive scheduler starts up. After some verification checks, ARChive starts gathering data on the instance to put it into the database for record keeping and future restorations.
Then ARChive quickly moves onto using the Python3 Nova client to create a snapshot of the instance in question. The module in use here is the .snapshot() method specifically. This is where ARChive does the handling of failures that happen because of quotas being over the limit and so on.
This is a very simplified description of how ARChive does it's backups, but I wanted to give some insight on the process of automatic backups for the purpose of contrast.
However, keep reading if you need to know how to do manual Openstack Backups instead of relying on ARChive’s super convenient automatic process.
Prerequisites
Nova Snapshot
Before you start, make sure you are properly authenticated and have enough room to avoid any issues with the creation of a snapshot. Also, the following nova commands are run wherever the nova-api live in your system.
When you run a backup using ARChive, what's actually happening is that it starts off gathering the data of the instance/volume you want to backup and uses the nova client to make a snapshot of the server while it's running.
The basic manual command for doing the same in the code looks like this:
nova image-create <image/snapshot name>
An example of a more realistic version of the command above that the nova-api calls for:
nova --os-auth-url --os-project-id --os-username image-create <image/snapshot name>
Use the nova image-list to see the snapshot you made if the command above succeeds.
Next Steps
Need to keep track of your computer’s temperature? There’s a USB for that! In this guide, we’ll lay out the steps for the installation and configuration of a temper usb sensor on Ubuntu 18.04. Plus, you’ll get the exact file contents you need to copy/paste as you create your files.
Openstack snapshot Commands
In my research, I have seen that using the nova commands for creating snapshots is deprecated, outside of using it in the nova-api of course.
This method uses the openstack client commands and seems more straight forward.
On your openstack ctlr run:
openstack server list
After finding your server
openstack volume snapshot create --volume
After the snapshot is created find it using Horizon or use the openstack cli command below:
openstack volume snapshot list
Ceph Snapshot
If you’re using ceph instead of nova here are some suggested commands.
The rbd ceph command used to create a snapshot:
rbd snap create {pool-name}/{image-name}@{snap-name}
List said snapshot with:
rbd snap ls {pool-name}/{image-name}
Conclusion
It’s always great to know how to backup your data manually. However, it’s definitely easier to enable ARChive as your default to back it up automatically! If you need some help with manual backups, or our awesome ARChive program, just let us know and we’ll make sure you’re properly backed up!