Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Rory Campbell-Lange
On 25/07/17, Ron Kelley (rkelley...@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


___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Ron Kelley
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.


-Ron





 
On Jul 25, 2017, at 11:11 AM, Rory Campbell-Lange  
wrote:

On 25/07/17, Andrey Repin (anrdae...@yandex.ru) wrote:
>> I am trying to copy sites from one LXD to another - both running BTRFS.
>> The normal “lxc copy” command uses btrfs send/receive which is terribly
>> slow.
> 
> btrfs send/receive is fast, when you send incremental copies of partitions.
> And of course it will be slower than rsync, since it works on a different
> level.

Are you copying to a btrfs seed image? In other words, if you made the
container from a base image, and then have snapshotted that base image
again as a copy target, the send/receive process should be very fast.

On the other hand for an initial image, it would be better to do a btrfs
snapshot assuming that the images are on the same volume. That should be
basically instantaneous.

Rory
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Rory Campbell-Lange
On 25/07/17, Andrey Repin (anrdae...@yandex.ru) wrote:
> > I am trying to copy sites from one LXD to another - both running BTRFS.
> > The normal “lxc copy” command uses btrfs send/receive which is terribly
> > slow.
> 
> btrfs send/receive is fast, when you send incremental copies of partitions.
> And of course it will be slower than rsync, since it works on a different
> level.

Are you copying to a btrfs seed image? In other words, if you made the
container from a base image, and then have snapshotted that base image
again as a copy target, the send/receive process should be very fast.

On the other hand for an initial image, it would be better to do a btrfs
snapshot assuming that the images are on the same volume. That should be
basically instantaneous.

Rory
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Andrey Repin
Greetings, Ron Kelley!

> I am trying to copy sites from one LXD to another - both running BTRFS.
> The normal “lxc copy” command uses btrfs send/receive which is terribly
> slow.

btrfs send/receive is fast, when you send incremental copies of partitions.
And of course it will be slower than rsync, since it works on a different
level.

> As an aside; I think LXD should allow the user to specify which copy tool
> to leverage when doing the copying.  Is that possible?

I think there's a difference between copying within the same host and between
different hosts.


-- 
With best regards,
Andrey Repin
Tuesday, July 25, 2017 17:21:19

Sorry for my terrible english...
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Ron Kelley
Sorry, typo on my part.  Definitely “lxc init” does not show this option.

Thanks again for the pointer!



On Jul 25, 2017, at 8:39 AM, Fajar A. Nugraha  wrote:

On Tue, Jul 25, 2017 at 7:23 PM, Ron Kelley mailto:rkelley...@gmail.com>> wrote:
Thanks Fajar.

Interesting, I have not seen/used “lxd init” yet.  

It's 'lxc init'. 'lxd init' is something entirely different :)
 
The output of “lxc -h” does not show the init command.  Guess it must be a 
super-admin command since it is hidden :-)



I recall stephane(?) mention this command a long time ago. Worst-case scenario, 
'lxc launch' and 'lxc stop --force' should pretty much do the same thing, since 
the difference is whether the container is started or not :)

The key point here is 'use the smallest image available'. And then (when it's 
stopped) overwrite it (or in my case, replace it with send/receive from another 
dataset)

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Fajar A. Nugraha
On Tue, Jul 25, 2017 at 7:23 PM, Ron Kelley  wrote:

> Thanks Fajar.
>
> Interesting, I have not seen/used “lxd init” yet.
>

It's 'lxc init'. 'lxd init' is something entirely different :)


> The output of “lxc -h” does not show the init command.  Guess it must be a
> super-admin command since it is hidden :-)
>
>

I recall stephane(?) mention this command a long time ago. Worst-case
scenario, 'lxc launch' and 'lxc stop --force' should pretty much do the
same thing, since the difference is whether the container is started or not
:)

The key point here is 'use the smallest image available'. And then (when
it's stopped) overwrite it (or in my case, replace it with send/receive
from another dataset)

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Ron Kelley
Thanks Fajar.

Interesting, I have not seen/used “lxd init” yet.  The output of “lxc -h” does 
not show the init command.  Guess it must be a super-admin command since it is 
hidden :-)

-Ron





 
On Jul 25, 2017, at 8:18 AM, Fajar A. Nugraha  wrote:

On Tue, Jul 25, 2017 at 7:11 PM, Ron Kelley mailto:rkelley...@gmail.com>> wrote:
Greetings all,

I am trying to copy sites from one LXD to another - both running BTRFS.  The 
normal “lxc copy” command uses btrfs send/receive which is terribly slow.  
Since rsync works much, much faster, is there a quick way to create the 
container “shell” on the remote server (and register it with LXD) and then 
manually rsync the data over?


probably 'lxc init', choosing the smallest available container (e.g. 
images:alpine/3.5). 
 
As an aside; I think LXD should allow the user to specify which copy tool to 
leverage when doing the copying.  Is that possible?


The intention was probably 'to use storage-specific method, which should be 
much faster' (which is true with zfs).

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Fajar A. Nugraha
On Tue, Jul 25, 2017 at 7:11 PM, Ron Kelley  wrote:

> Greetings all,
>
> I am trying to copy sites from one LXD to another - both running BTRFS.
> The normal “lxc copy” command uses btrfs send/receive which is terribly
> slow.  Since rsync works much, much faster, is there a quick way to create
> the container “shell” on the remote server (and register it with LXD) and
> then manually rsync the data over?
>
>
probably 'lxc init', choosing the smallest available container (e.g.
images:alpine/3.5).


> As an aside; I think LXD should allow the user to specify which copy tool
> to leverage when doing the copying.  Is that possible?
>
>
The intention was probably 'to use storage-specific method, which should be
much faster' (which is true with zfs).

-- 
Fajar
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Fastest way to copy containers

2017-07-25 Thread Ron Kelley
Forgot to mention, both servers running LXD 2.15 on Ubuntu 16.04



On Jul 25, 2017, at 8:11 AM, Ron Kelley  wrote:

Greetings all,

I am trying to copy sites from one LXD to another - both running BTRFS.  The 
normal “lxc copy” command uses btrfs send/receive which is terribly slow.  
Since rsync works much, much faster, is there a quick way to create the 
container “shell” on the remote server (and register it with LXD) and then 
manually rsync the data over?

As an aside; I think LXD should allow the user to specify which copy tool to 
leverage when doing the copying.  Is that possible?


Thanks.

-Ron

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

[lxc-users] Fastest way to copy containers

2017-07-25 Thread Ron Kelley
Greetings all,

I am trying to copy sites from one LXD to another - both running BTRFS.  The 
normal “lxc copy” command uses btrfs send/receive which is terribly slow.  
Since rsync works much, much faster, is there a quick way to create the 
container “shell” on the remote server (and register it with LXD) and then 
manually rsync the data over?

As an aside; I think LXD should allow the user to specify which copy tool to 
leverage when doing the copying.  Is that possible?


Thanks.

-Ron
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users