[lxc-devel] Overlayfs multiple lower layers support in LXC
Serge Hallyn
serge.hallyn at ubuntu.com
Thu Jun 4 14:02:22 UTC 2015
Quoting Tobby Banerjee (tobby at flockport.com):
> Hi All,
>
> Overlayfs was merged 3.18 and overlayfs in 4.0.4 adds support for multiple
> lower layers.
>
> Current LXC snapshot can so single layers, is there any plan to support
> mulitple lower layers?
I saw that in the kernel git log, but didn't have immediately plans for
writing that patch. Definately would like to see the functionality,
patches appreciated. Though the existing (rather ugly) code ought to
be cleaned up to make it digestible. Maybe define a fs layer (not sure
if we want to generalize it beyond overlayfs), define a 'layer_on' hook,
instantiate one fs_layer for each requested overlay layer, and stack
them at final mount time. Rather than the current too-hardcoded building
of the mount options string.
The alternative btw is to use https://github.com/xemul/mosaic
> The main advantage I see is you can do snapshot of base OS and then add an
> app and snapshot that, and these 2 can be your seed container. You then
> mount the rootfs of base OS and delta0 of snapshot1 with 2 overlays lower
> layers as the rootfs of your deploy container.
>
> I have put together a small script that does exactly that including a
> pre-mount hook for the 2 lower overlayfs layers and it seems to work well
> enough.
>
> The limitation of one lower layer is if you want to deploy 5 apps across
> lets say 50 containers, then having a single level snapshot will force you
> to have 5 base level OS containers for each of the apps. With 2 lower
> layers you can have a single base OS container and 5 overlay snapshots for
> each of the apps.
>
> Thanks
>
> Tobby
> www.flockport.com
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
More information about the lxc-devel
mailing list