[lxc-devel] tracking overlayfs dependencies

Serge Hallyn serge.hallyn at ubuntu.com
Fri Aug 16 12:30:20 UTC 2013


Hi,

snapshotted containers aren't an issue with btrfs, zfs, or lvm.  In
btrfs you can delete the original and the snapshot will continue to
work.  zfs and lvm will both prevent removal of the original while
there are snapshots.

overlayfs doesn't do this.  So we need to teach lxc-delete to do it
for us.

The best I can think of is to add two new 'lxcinternal' lines in a
container configuration.  If I did

	lxc-create -B dir -t ubuntu -n c1
	lxc-clone -s -B overlayfs -o c1 -n c2

then c1 would end up with

	lxcinternal.snapshots = 1

and c2 would have

	lxcinternal.depends = /var/lib/lxc/c1

Then when I made c3 a clone of c2, c1 would have snapshots = 2 and
c3 would have depends = /var/lib/lxc/c1.

I don't particularly like this, but I don't have any better ideas
(after months of letting this percolate).  Does anyone else have
a better idea?  If not I'll go ahead and implement this next week.

thanks,
-serge




More information about the lxc-devel mailing list