Mirror LXC server

I currently have an lxc host with about 30 containers which grow periodically.
To backup I use lxc export once a week but this approach creates two problems for me:
extremely slow and in case the server fails (often during backup) I don’t have a quick way to restart the machines.

I was therefore thinking of buying another server on which to install lxc and divide the machines into containers A and B.
At this point I would do a lxc copy of the machines A from server 1 to server 2 and vice versa.
The goal would be to have all the machines on both servers, (in case one fails) but to turn on server 1 only containers A and on server 2 only containers B.

What do you think of this type of approach? Can you bring trouble or confusion in your view?

lxc copy --refresh should work pretty well for that, you’d probably want to pass a few extra arguments to make sure that the copy will never start (-c boot.autostart=false should do it).

1 Like