[Lxc-users] Creating multiple containers simultaneously

Ulli Horlacher framstag at rus.uni-stuttgart.de
Mon Nov 28 17:53:13 UTC 2011


On Mon 2011-11-28 (18:40), Roberto Aloi wrote:

> I'm currently dealing with a pool of LXC containers which I use for
> sand-boxing purposes. Sometimes, when re-creating one of the
> containers in the pool I obtain the following error:
> 
> Error: "CREATE CONTAINER container-5\ndebootstrap is
> /usr/sbin/debootstrap\nCache repository is busy.\nfailed to install
> ubuntu natty ...
> 
> My interpretation of the problem is that rebooting several containers
> at the same time can be problematic - e.g. because they are trying to
> access the cache repository at the same time -. Assuming my
> interpretation is correct, is there a way to create multiple
> containers at the same time?

You mix up creating with booting.
You ceate new containers with debootstrap and running debootstrap several
times at the same time is not a good idea. 

My approach is another: I create ONCE an Ubuntu template (*) which I can
then clone as much as I want. Example:


root at vms1:/lxc# lxc -l
container              disk (MB)    RAM (MB)   start-PID    status
bunny                          -           0           0   running
fex                            -           0           0   stopped
ubuntu                         -           0           0   stopped
vmtest8                        -           0           0   running

root at vms1:/lxc# lxc -C vmtest1

root at vms1:/lxc# lxc -l
container              disk (MB)    RAM (MB)   start-PID    status
bunny                          -           0           0   running
fex                            -           0           0   stopped
ubuntu                         -           0           0   stopped
vmtest1                        -           0           0   stopped
vmtest8                        -           0           0   running



> Also, the creation time for the first container is pretty high (~8
> minutes)

I can create Ubuntu untainers in less than 3 seconds with my methode.

(*) http://fex.rus.uni-stuttgart.de/lxc-ubuntu

-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/
REF: <CAB=dftrK_SQXvpo77bDc+kqoKu5Hoc33HcOq_0e+H9CBuncTsA at mail.gmail.com>




More information about the lxc-users mailing list