How to use Bacula and live snapshot’s capabilities on OpenNebula to make backups of your virtual machines and store them.
Author Biography
Automate all the things! I love using any tool to make things to work automagically.
2. Who am I?
● Sysadmin @ Rentalia.com
● Lazy by nature
● Automate and forget
alberto.garcia.fernandez.it@gmail.com
linkedin.com/in/albertogarciafdez
github.com/AlbertoGarciaFdez
3. Agenda
● Making backups of VM, Why?
● A bit of Bacula
● OpenNebula & Bacula
● Demo
● Questions
4.
5. Why
● I do Continuous Delivery (Puppet)
● I use some Golden/Master images too
Images that won't change (completed projects)
Slow to deploy services
● Machines without Continuous Delivery
Dev machines
● Making backups is always a great idea
6. A bit of Bacula
http://bacula.org/
● Backup solution
Fetch, compress and store data across your network
● RunScript Directive
Make use of scripts at different states of the backup
● Get file paths from script
Set the backup target from a script at running time
9. OpenNebula & Bacula
We want automatic backups from VM disk images
● We have to glue the pieces – from OpenNebula
➢ onevm disk-saveas – live backup of running VM's
➢ oneimage show – retrieve new image id
➢ oneimage delete – erase the copy
10. OpenNebula & Bacula
We want automatic backups from VM disk images
● We have to glue the pieces – from Bacula
➢ Client = $OpenNebula_Frontend
➢ We get acces to the cli from Bacula connection
➢ File = “|copy_this.sh vm_(id|name)”
➢ Which returns new image path
➢ ClientRunAfterJob = “Clean.sh”
15. OpenNebula & Bacula
Problems arise
1) Bacula connects as root but we need oneadmin
Using 'su' within scripts or bacula directives OR
Adding "-u oneadmin -g oneadmin" default/bacula-fd
2) Wait for READY status on new image
Otherwise, bacula will fetch an incomplete copy
3) What is the storage id to backup from the VM
In our case it's always 0 but you can use any
parameter to identify the correct disk
Type = OS seems logic
16. OpenNebula & Bacula
1) Bacula connects as root but we need oneadmin
/etc/default/bacula-fd
2) Wait for READY status on new image
/var/lib/one/File.sh
17. OpenNebula & Bacula
3) What is the storage id to backup from the VM
Using 0 works for me. Experiment with your own env