Duplicity is a very nifty backup tool written in Python that supports a wide array of remote storages. It has been dubbed “the rsync of networking”, with good reason (among others, because it is based on librsync). It is packaged for most flavors of Linux. Among the supported remote storages for backup, we find:
* S/FTP
* SCP
* Amazon S3
* Cloudfiles, the Rackspace cloud storage
Support for Cloudfiles means it should be possible to use duplicity for backups on Openstack-based cloud storage providers like Cloudwatt. Unfortunately duplicity’s Cloudfiles plugin relies upon a soon-to-be deprecated Rackspace library that supports v1 authentication only. Unfortunately most cloud storages based on Swift, Openstack’s object storage service, are generally plugged to Keystone for authentication, which needs to be patched to support v1 queries (see for example
http://www.zmanda.com/blogs/?p=1002). This meant duplicity couldn’t be used out of the box with most Openstack cloud storage services … So we decided to submit a Swift plugin to the duplicity project: https://code.launchpad.net/~mhu-s/duplicity/swiftbackend This plugin is waiting for a merge in the main branch, but in the meantime, it is completely usable. Update (08/22/2013): the code has been merged in duplicity’s 0.6x series ! To install this version, follow these steps:
* clone the code with “bzr branch lp:~mhu-s/duplicity/swiftbackend”
* if you don’t have them, install the development files for librsync and python. On debian and ubuntu, it is done with “sudo apt-get install librsync-dev python-dev”
* the plugin also requires the swiftclient and keystoneclient libraries: “sudo apt-get install python-swiftclient python-keystoneclient”
* install duplicity: “cd swiftbackend && sudo python dist/setup.py install”
You can now use duplicity to backup your files to a Swift based storage. You need to define the following environment variables :
- SWIFT_USERNAME: your username, in the form tenant:user
- SWIFT_PASSWORD: your password
- SWIFT_AUTHURL: for Cloudwatt, it would be https://identity.fr0.cloudwatt.com:443/v2.0
- SWIFT_AUTHVERSION: for keystone authentication, set it to 2
Once they are set, doing a backup is as straightforward as usual:
duplicity /directory/to/backup swift://container_name
Restoration is just as easy:
duplicity swift://container_name /directory/to/restore
Duplicity’s man page contains more information for fine tuning. There is also a wealth of tutorials and howtos about duplicity on the Internet, so nothing can stop you from deploying your perfect backup solution using OpenStack as your storage backend !