Opennebula & Bacula
Backing Up Your VM
Alberto García Fernández – Rentalia.com
Who am I?
● Sysadmin @ Rentalia.com
● Lazy by nature
● Automate and forget
linkedin.com/in/albertogarciafdezgithub.com/AlbertoGarciaFdez
Agenda
● Making backups of VM, Why?
● A bit of Bacula
● OpenNebula & Bacula
● Demo
● Questions
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
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
A bit of Bacula
Backup example
OpenNebula & Bacula
FileSet example within Bacula
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
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”
OpenNebula & Bacula
OpenNebula Job
OpenNebula & Bacula
File.sh returns a path
OpenNebula & Bacula
File.sh
OpenNebula & Bacula
Clean.sh
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
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
OpenNebula & Bacula
3) What is the storage id to backup from the VMUsing 0 works for me. Experiment with your own env
OpenNebula & Bacula
Ok ok ok, i'll give a better solution
Questions Time
Thanks for your attention!
[email protected]@rentalia.com
github.com/AlbertoGarciaFdez