[Lxc-users] Moving lxc containers

Gordon Henderson gordon at drogon.net
Fri Apr 8 09:58:46 UTC 2011


On Sun, 27 Mar 2011, Amit Uttamchandani wrote:

> I'm just wondering what the best way is to move an lxc container? Can I
> just tar the root filesystem and untar it on another system? Or should I
> rsync it over?
>
> I understand that before doing any of the above, the container should be
> shutdown first. However, is there a way to do this while the container
> is running?

I use rsync - the important option is  --numeric-ids.

Typically, I'll do an rsync with the original container running, then 
setup the configs, lxc-create, etc. on the new host, then shutdown the 
live container, do a final rsync to copy any changes, then start it on the 
new host. For most containers I have the down-time is minimal - under a 
minute in some cases.

Gordon




More information about the lxc-users mailing list