[Lxc-users] Automated Mount for every lxc container

Serge Hallyn serge.hallyn at canonical.com
Thu Apr 26 03:41:33 UTC 2012


Quoting Sebastian Bachmann (me at free-minds.net):
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> We are currently migrating from openvz to lxc and now we facing a
> problem which can be solved quickly but this would cause other trouble
> I'm trying to prevent.
> We had in all our VZ Containers a directory mounted from the host,
> which contains configs and shared stuff. This is now really mandatory
> for all containers, so it would be bad if we woudnt have it anymore.
> we solved the problem on the OpenVZ side with a common-mount script
> which gets the VZID from the config file and mounts the stuff into
> /var/lib/vz/root/$VZID/shared/folder
> 
> so we need the same thing for lxc... Otherwise we would have to put in
> the mount path into every lxc config file and for about 30 LXC's this
> would create a mess...
> 
> I found this Post on the mailinglist:
> http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg01204.html

Doesn't look like that's made it in.  Don't remember noticing that patch
before (sorry, Andre), but it looks like a worthwhile feature, +1 from me.

> which says something about excactly what we would need. is this
> feature allready implemented? I couldnt find anything in the man page
> that it would...
> 
> with this feature we could write a common-config file which is
> included into every lxc config and could work, beside one fact: how
> does the common script know where to mount? Is is possible to use
> variables inside the config? so is the lxc.rootfs also a variable, i
> can use in my config?

Assuming you mean to replace the $rootfs in the mount target spot,
don't!  Just use the relative pathname.  I.e.

lxc.mount.entry = proc    proc   proc    nodev,noexec,nosuid 0 0
lxc.mount.entry = /shared shared none    bind 0 0

> thanks a lot, maybe someone has come up with a solution allready!
> 
> sebastian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iQEcBAEBAgAGBQJPmFbLAAoJEAhgHfpCPcybyAoH/3e2Zj2GbOVxaO0OWDigBvaT
> wvIPPAYqMONt5hmLZnYDZuBttHaLMcx9JWCNQB8wCaB4gS54XPoAXDvlNjiFfUN7
> lZvs+PnuBl6ODvawGRjTCtQK1zzZQQmqwq5MMB/2Sk6uOz024Uk7AJrBSprAZvbQ
> BcsFewEhzVNmS33vTsg3DY7/2jSYFeWJq7wZHIiSkBfoBR0XjKKxPQxSh7p82BBg
> gPf1+0VGCgEU6yuMXUuLKv6Z9WZzUvNr27hSOFq+w5UHXFeihK17bpDprSjWX4xT
> xITjni7Z/616l9uhzZmR5aI0WWBKz9U3C4gcY2n03SRuCOE00VciLBORofY1cYo=
> =5Q1Q
> -----END PGP SIGNATURE-----
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users




More information about the lxc-users mailing list