[Lxc-users] Create container as clone of host

Fajar A. Nugraha list at fajar.net
Tue Apr 2 21:19:53 UTC 2013


On Tue, Apr 2, 2013 at 7:37 PM, Serge Hallyn <serge.hallyn at ubuntu.com>wrote:

> Quoting Fajar A. Nugraha (list at fajar.net):
>


> > If your changes are NOT kernel-related, then the easy way is if the root
> > filesystem is on a snapshot/clone-capable fs (e.g. btrfs,zfs). Otherwise
> > just use plain tar/rsync/whatever to copy the filesystem. I do NOT
> > recommend using LVM snapshot as (from experience) it's more hassle than
> > what it's worthed.
>
> Hi Fajar,
>
> what do you mean?  Apart from the fact that my systems tend to not start
> out with a spare partition to into a PV :) I've not had trouble.
>
>
Last time I check, you need to estimate how much space the snapshot will
occupy, and you need to keep monitoring its usage so it never goes full. If
the origin LV had lots of writes after the snapshot is created, the
allocated snapshot space will fill up making the snapshot full and
invalidated. At that time it's pretty much good-bye-data-in-the-snapshot.

This is different from btrfs and zfs, where you don't need to pre-allocate
dedicated space for snapshot. Worst-case scenario on a disk full, new
writes will be rejected, but old data will remain intact.



> Since I'm getting ready to implement clone in the C api, if you're
> having trouble I'd like to make sure I fix it while I'm doing so.
>
>
It depends on the usage. Support for LVM snapshots in lxc-clone is great
for testing purposes, but personally I think it should come with a big
"WARNING: always make sure you have enough space reserved for the snapshot,
otherwise you may lose data".

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130403/0a6eda49/attachment.html>


More information about the lxc-users mailing list