opennebulaconf2015 2.02 backing up your vm’s with bacula - alberto garcía
TRANSCRIPT
![Page 1: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/1.jpg)
Opennebula & Bacula
Backing Up Your VM
Alberto García Fernández – Rentalia.com
![Page 2: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/2.jpg)
Who am I?
● Sysadmin @ Rentalia.com
● Lazy by nature
● Automate and forget
linkedin.com/in/albertogarciafdezgithub.com/AlbertoGarciaFdez
![Page 3: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/3.jpg)
Agenda
● Making backups of VM, Why?
● A bit of Bacula
● OpenNebula & Bacula
● Demo
● Questions
![Page 4: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/4.jpg)
![Page 5: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/5.jpg)
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
![Page 6: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/6.jpg)
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
![Page 7: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/7.jpg)
A bit of Bacula
Backup example
![Page 8: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/8.jpg)
OpenNebula & Bacula
FileSet example within Bacula
![Page 9: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/9.jpg)
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
![Page 10: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/10.jpg)
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”
![Page 11: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/11.jpg)
OpenNebula & Bacula
OpenNebula Job
![Page 12: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/12.jpg)
OpenNebula & Bacula
File.sh returns a path
![Page 13: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/13.jpg)
OpenNebula & Bacula
File.sh
![Page 14: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/14.jpg)
OpenNebula & Bacula
Clean.sh
![Page 15: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/15.jpg)
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
![Page 16: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/16.jpg)
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
![Page 17: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/17.jpg)
OpenNebula & Bacula
3) What is the storage id to backup from the VMUsing 0 works for me. Experiment with your own env
![Page 18: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/18.jpg)
OpenNebula & Bacula
Ok ok ok, i'll give a better solution
![Page 19: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García](https://reader036.vdocuments.net/reader036/viewer/2022081605/58ede18b1a28abc1508b45b3/html5/thumbnails/19.jpg)
Questions Time
Thanks for your attention!
[email protected]@rentalia.com
github.com/AlbertoGarciaFdez