A few months ago, I was looking for a best way to migrate LXD containers between nodes. Low downtime was the main criterion.
Live migration,based on documentation, can only be done through СRIU, but this technology works very bad.
Therefore, the following method was chosen:
- create an empty LXD container on the destination node;
- rsync container files from source node to destination (without turning off the container);
- import container on the destination server with
lxd import(in order to import container’s configs);
- stop container on source node;
- one more rsync of container files;
- start container on destination node.
This scheme worked fine, but in LXD 4.17, the
lxd import command was removed, and the
lxd recover added instead, but it doesn’t have a similar non-interactive functionality.
Tell me, please, is there any other method for exporting and then importing container configs?
Or are there other ways to migrate containers with little downtime?
Thanks in advance.