Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-10 Thread Joshua Randall
We have a particular use case, but we are achieving this using CernVM-FS 
(http://cernvm.cern.ch/portal/filesystem) to supply read-only root filesystems 
to many machines (with local caching), and then aufs or overlayfs (depending on 
the kernel version) to provide write support as others have suggested. 

Josh.

On 10 Jul 2013, at 16:30, Rob Landley r...@landley.net wrote:

 On 07/08/2013 11:22:55 PM, Ajith Adapa wrote:
 Hi,
 
 I would like it know is it possible to create a single rootfs (might  
 be in
 read-only mode) and share it among multiple containers ?
 
 Currently for every container we create its own unique rootfs.
 
 What would be the best place to look in code for using single rootfs  
 across
 multiple containers.
 
 Well, some of us are waiting patiently for:
 
   http://lkml.indiana.edu/hypermail/linux/kernel/1303.1/02476.html
 
 But I'm not sure who to make puppy eyes at.
 
 (One does not simply make puppy eyes at Al Viro.)
 
 Rob
 --
 See everything from the browser to the database with AppDynamics
 Get end-to-end visibility with application monitoring from AppDynamics
 Isolate bottlenecks and diagnose root cause in seconds.
 Start your free trial of AppDynamics Pro today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
 ___
 Lxc-users mailing list
 Lxc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lxc-users



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-10 Thread Niklas Fuchs
This sound really great. I was wondering if anyone uses user namespaces
and shared rootfs?
I got the roblem the skeleton of the ro-root on the host has uid 0 for
the root files, but the guest maps them to nobody, so i cant use shared
rootfs and user namespaces together. I cant think of a better solution
than rsyncinging and uidmapshifting the rootfs for every container.

Bye, Niklas

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-10 Thread Serge Hallyn
Quoting Niklas Fuchs (nkfu...@yahoo.de):
 This sound really great. I was wondering if anyone uses user namespaces
 and shared rootfs?
 I got the roblem the skeleton of the ro-root on the host has uid 0 for
 the root files, but the guest maps them to nobody, so i cant use shared
 rootfs and user namespaces together. I cant think of a better solution
 than rsyncinging and uidmapshifting the rootfs for every container.

Yeah that scenario has occurred to me before.  I think a lightweight
stackable fs which maps uids is going to be desirable.  For a trivial
first implementation it should be easy to do as a fuse fs.  If you
decide to pursue that, please to keep us uptodate!

-serge

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-09 Thread Rob van der Hoeven

 I would like it know is it possible to create a single rootfs (might
 be in read-only mode) and share it among multiple containers ?

At Dotcloud.com they use one basic OS rootfs. For each container they
mount this OS rootfs read-only and use a union file-system (AUFS) to add
a writable layer. Here are some pointers:

PAAS Under the Hood, Episode 3: AUFS
http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-34-a

Lightweight Virtualization with namespaces, cgroups, and unioning
filesystems:
http://blog.dotcloud.com/scale11 (excellent slides!)

Rob.
http://freedomboxblog.nl




--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-09 Thread Walter
Yes, this is possible.

There are multiple approaches, for example:
 1. Creating a snapshot (or outright copy) of a filesystem, then
disposing of it when done.
  (1a) Manually creating a full copy
  (1b) Using a blockstore-provided snapshot facility such as LVM2
 2. Using a snapshot-capable filesystem, and using a snapshot provided
by the filesystem itself (ZFS, BTRFS, etc.)
 3. Mounting read-only, with either of two solutions for writable
portions of the filesystem. This class of solution is very similar to
NFS based root situations (ie. modern PXE-driven diskless network
boot).
  (3a) 'tmpfs' or some other in-memory based write solution where required.
  (3b) Union-mounts.

My advice would be as follows.
 == simplest ==
 (1a) and (1b) are easiest *and* allow the use of arbitrary filesystems.
 == medium hassle==
 (2) is become somewhat common but is more difficult.
 (3b) are more difficult
 == more hassle ==
 (3a) is more hassle up front but is perhaps the neatest solution overall.
 (3b) i have never got working, but should be neat.. it's just not
going to be as widely supported by various kernels out there as (3a)
or (1b).

Personally I use (3a) and (1b).

- Walter

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-09 Thread Vallevand, Mark K
Yes, it's possible.  We do it.  I can't share the code, but I can describe it.

We create a master container using standard lxc-create script with our own 
template and config file.  The template is based on the ubuntu template.  The 
master container is never started.  All subsequent containers share the rootfs 
of the master container.

We use the lxc library to read the master container's config, then fork and 
call lxc_start to run a program in a new container using the config we read.  
But, you should be able to do this with scripts, if that is your choice.

A couple of warnings.  You need to create an empty directory in /var/lib/lxc 
for each container that matches the name specified in the lxc_start call.  You 
must create the containers serially.  This technique will fail if lxc-create is 
called concurrently by different threads or processes.

We are using Ubuntu 12.04 LTS 64-bit.

Regards.
Mark K Vallevand   mark.vallev...@unisys.commailto:mark.vallev...@unisys.com
May you live in interesting times, may you come to the attention of important 
people and may all your wishes come true.
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

From: Ajith Adapa [mailto:ajith.ad...@gmail.com]
Sent: Monday, July 08, 2013 11:23 PM
To: Lxc-users@lists.sourceforge.net
Subject: [Lxc-users] Using common rootfs for multiple containers

Hi,
I would like it know is it possible to create a single rootfs (might be in 
read-only mode) and share it among multiple containers ?
Currently for every container we create its own unique rootfs.
What would be the best place to look in code for using single rootfs across 
multiple containers.

Regards,
Ajith
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] Using common rootfs for multiple containers

2013-07-08 Thread Ajith Adapa
Hi,

I would like it know is it possible to create a single rootfs (might be in
read-only mode) and share it among multiple containers ?

Currently for every container we create its own unique rootfs.

What would be the best place to look in code for using single rootfs across
multiple containers.

Regards,
Ajith
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users