[Lxc-users] Creating multiple containers simultaneously

Андрей Григорьев andrew at ei-grad.ru
Mon Nov 28 18:02:27 UTC 2011


Oh, sorry, browser said that it is a binary file, and I believed in it. 
Now I see that it is perl script :-).

28.11.2011 21:53, Ulli Horlacher пишет:
> 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
>
-- 
Andrew





More information about the lxc-users mailing list