Blog Article:

Rentalia Experiences with OpenNebula and Bacula

Alberto Garcia

Jul 24, 2014

imgRentalia

Hi, we at Rentalia.com have OpenNebula to meet our needs on virtualization, and we use Bacula to make backups of the vm’s disks. I’ll try to explain you how, let me tell you a bit of our environment first.

We have two OpenNebula environments, one’s for production and another for development. We use Puppet inside the vm’s so we don’t have to backup the files inside since they are given by Puppet. However, we have a few vm’s we would like to backup the disk image from, and since we are using Bacula along our system, we used Bacula to make this backups too.

First of all, we are using KVM and qcow2 drivers so we can make use of the “onevm disk-snapshot” capabilities, this way Bacula can invoke this command to make a hot snapshot of the disk. So the idea here  its to let Bacula make a hot snapshot of the target disk, store it, and remove the copy. This is an example job we use:

bacula

As you can see, we use two scripts, which are on the frontend. One script for making the hot snapshot and tell Bacula where it was created, and another for cleaning it after Bacula store it .
If you used Bacula before this is pretty straightforward, maybe the File directive it’s the weird thing here, we are getting the output from a script instead of using a file or dir name.

And this is the main script we use, Prebackup.sh. We give it the name of a vm and it makes a hot snaphot of the target disk, wait for it to finish, and then output the path of the snapshot. Maybe its too simple and doesn’t meet your needs, since there are some lack of logic to decide which is the disk to make the snapshot, we use 0 on onevm disk-snapshot because all of our machines have the image we care on slot 0 but you could change the scripts. For example, with some grep magic you could check if the disk you are going to copy its persistent or not, and its worth make a backup of it.

Once the script make the snapshot, and Bacula store it, Postbackup.sh script erase the copy we dont longer need.

There is some improvements that could be made on this method, the main script could be more intelligent to decide which image to backup and you have to keep some free space to make a room for the snapshot while doing the backup, but its some integration we made between Bacula and OpenNebula that works fine for us and maybe can help you too 🙂

1 Comment

  1. Jose Angel Diaz

    Good work and very clear explained solution!!

    Reply

Trackbacks/Pingbacks

  1. OpenNebula | OpenNebula Newsletter – July 2014 - […] due to the Terradue folks for .NET API to the OpenNebula world. Also, it is very interesting the integration…
  2. OpenNebula | OpenNebula 2014: Year in Review - […] in the data center like IBM Storwize V7000 SAN, salt-cloud, Infiniband (SR-IOV devices), Bacula, Chef Kitchen, .NET API, Nodejs, Cloud-init,  Ansible or The Foreman – just to name…

Submit a Comment

Your email address will not be published. Required fields are marked *