Lxd backup server

Hi All,

I have question regarding lxd backups. I have a spare server and want a lxd backup server.

What would be the way to go. offcourse i use linux tooling to backup my files. However in a case where my server would die i want to be up and running in minimum of down time.

What are your recommendations? can it be done with a spare lxd server?

kind regards,

Chris

Hi Chris,

Please take a look at this page as it may answer your questions:

https://linuxcontainers.org/lxd/docs/master/backup/

Hi Thomas,

I saw this page indeed. What would be your approach to do this? To be able to be online as fast as possible?

Hi!

Try this (https://www.cyberciti.biz/faq/how-to-backup-and-restore-lxd-containers/)

I use this too

lxc export && lxc import
or
lxc snapshot && lxc restore

Else you can take a look at this solution ( But I didn’t use it)
https://github.com/cloudrkt/lxdbackup

Regards.

You can also use another LXD server and then use lxc copy <instance> <remote>: --refresh to sync the instance to another server.

1 Like

Hi Tomp,

When i do it with an backup lxd server. lxc copy instance remote: --refresh

wil it do incremental or copy all data over the network every time?

Can i also do somthing like zfs replication? while the machines are running. with databases and stuff?

The idea of --refresh is that it does incremental copies.
Mostly it uses rsync over the LXD API to do the sync.

But depending on the source/target storage pool types it also supports using the underlying native optimized transfer mechanisms, and these rely on having snapshots (using lxc snapshot <instance>) to transfer the differences from.

See https://github.com/lxc/lxd/pull/11323#discussion_r1094333583 for more info.

ok thanks,

I was thinking. if i do the following will it work?

i want to install a second seperate host with lxd installed. I then want to replicate my zfs torage pools to the second lxd machine.

When my first machine goes offline i then yust start up the lxd machines in the second host.

will this work? or am i thinking the wrong way?