[lxc-users] Online container backup

Tamas Papp tompos at martos.bme.hu
Thu Jun 11 07:00:26 UTC 2015



On 06/11/2015 08:51 AM, Narcis Garcia wrote:
> Debian 8 in a single and tratitional ext4 partition.
> My idea is that the backup is a complete container export, to be
> restored in another box if necessary.
>
> Is there some newer LXC repository for Debian as ppa:ubuntu-lxc/daily ?
>
> At this moment, my procedure is:
> $ lxc-stop -n MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /var/lib/lxc/MyGuest
> $ lxc-start -n MyGuest
> but container unavailability is too long.

You were referring to backup.
If you want live migration, use criu, as Fajar told it.
+ rsync:

$ rsync
$ criu
$ rsync delta
$ start

Or you can replace rsync with zfs/btrfs send/receive feature.

> Another procedure, but without stopping container:
> $ cp -aPx /var/lib/lxc/MyGuest /tmp/MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /tmp/MyGuest

Snapshot is keyword, what you're looking for.


tamas


More information about the lxc-users mailing list