OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

19
Opennebula & Bacula Backing Up Your VM Alberto García Fernández – Rentalia.com

Transcript of OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

Page 1: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

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

Who am I?

● Sysadmin @ Rentalia.com

● Lazy by nature

● Automate and forget

[email protected]

linkedin.com/in/albertogarciafdezgithub.com/AlbertoGarciaFdez

Page 3: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

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
Page 5: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

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

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

A bit of Bacula

Backup example

Page 8: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

OpenNebula & Bacula

FileSet example within Bacula

Page 9: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

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

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

OpenNebula & Bacula

OpenNebula Job

Page 12: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

OpenNebula & Bacula

File.sh returns a path

Page 13: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

OpenNebula & Bacula

File.sh

Page 14: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

OpenNebula & Bacula

Clean.sh

Page 15: OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García

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

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

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

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

Questions Time

Thanks for your attention!

[email protected]@rentalia.com

github.com/AlbertoGarciaFdez