[lxc-users] lxc 1.0.6 / lvm / snapshot and clone

Serge Hallyn serge.hallyn at ubuntu.com
Thu Feb 12 15:08:33 UTC 2015

Quoting Marco (foobar.angus at gmail.com):
> Hi,
> I've some questions for which I couldn't find good answers online and I'd
> like your suggestions.
> OS: Linux/Debian 8 Jessie
> LXC: 1.0.6-6
> Backing store: LVM
> It seems that snapshot clones cannot be done online :
> "lxc-clone -s"  require the original container to be stopped!

Yes.  If you want a live snapshot you can checkpoint with criu.  If you
snapshot disk while userspace is running you can get inconsistent files
in the clone.  (Which will then be reported as bugs against lxc.)

> i.e. : << lxc_container: error: Original container (lxc1) is running >>
> It actually works when I lxc-stop the container.
> ==>This means I cannot do a snapshot of a live container.
> Does this depends on LVM or the same apply for btrfs and zfs?


> BTW, all the online examples I've found regarding "lxc-clone -s" seems to
> assume online clone snapshotting !

Not sure what you mean by "online clone".  but -s does mean snapshot.  If
you omit '-s', then a fully backing store copy (i.e. rsync) will be done.

> ==>What is the difference between "lxc-clone -s" and "lxc-snapshot" ?

lxc-clone creates a new container with the name you specify.
lxc-snapshot uses lxc-clone, but stashes the clone under the
container's directory.

> In any case:
> lxc-snapshot _doesn't_ work at all (in my configuration)
> i.e. :
> > root at deb:~# lxc-snapshot -n lxc1 -o /tmp/mylog
> > lxc-snapshot: lxc1's backing store cannot be backed up.
> > lxc-snapshot: Your container must use another backing store type.
> > lxc-snapshot: Error creating a snapshot
> ==>Again, is it a problem of LVM backing store ?


!commit cdd01be26ea320a8b5be313a864cb553df90c33e
!Author: Serge Hallyn <serge.hallyn at ubuntu.com>
!Date:   Fri Aug 8 15:00:18 2014 +0000
!  Do not allow snapshots of LVM backed containers
!  They don't work right now, so until we fix that, don't allow it.

> And, can I change the working directory of lxc-snapshot at runtime?

not sure what you mean by that.

> If you have any reference to online resource on this subject (lvm/lxc) is
> welcome :)

Based on the commit message (which I don't really remember) it sounds
like it just needs someone to put in the time to fix it.

More information about the lxc-users mailing list