[lxc-users] Fastest way to copy containers

Rory Campbell-Lange rory at campbell-lange.net
Tue Jul 25 17:38:31 UTC 2017


On 25/07/17, Ron Kelley (rkelleyrtp at gmail.com) wrote:
> As far as I know, LXD does not support incremental copies - either
> local or remote (“error: Container ‘blahblah2' already exists”).
> 
> The question I posed earlier was how to copy a container from one LXD
> server to another.  We need to migrate containers to different hosts
> so we can do maintenance on the container servers, and we have lots of
> containers to move.  If we are using BTRFS, “lxc copy” will use btrfs
> send/receive which is very slow (~20MB/sec over a 10G network).  
> 
> The quick work-around is to create a shell container on the remote
> server (lxd init server:blablah2) then use rsync to copy the data.  It
> works much faster than btrfs send/receive.

If you first copy the base image remotely, btrfs send/receive should be
pretty fast for the changes.

However it seesm btrfs send/receive can be slow. See the wiki for more
details:
https://btrfs.wiki.kernel.org/index.php/Design_notes_on_Send/Receive

Also these parameters might help improve things:
https://www.spinics.net/lists/linux-btrfs/msg57590.html

Cheers
Rory




More information about the lxc-users mailing list