[Lxc-users] starting multiple containers running an application using a shell script

Massimo Cafaro massimo.cafaro at unisalento.it
Wed Jun 6 15:44:18 UTC 2012


Dear all,

I am new to lxc and I am using it on Fedora 16.
I need to run a simulation with multiple nodes, each running a p2p application. So far, I have been able to manually start the containers (one for each opened shell), providing a simulated network through the ns-3 simulator, and launching on each container the p2p application. Everything works, but now I need to move from just a few containers to many (hundreds) containers. Therefore, I am trying to write a shell script to automatically start the containers with the application.

However, I am facing various problems. If I start a container in daemon mode, then I am not able to connect through lxc-console, even if I try using a tty and not the console. 

If I start a container using screen, like this

/usr/bin/screen -dmShost-$i /usr/bin/lxc-start -n host-$i
/usr/bin/lxc-wait --name=host-$i --state=RUNNING

then I am not able to start the application.

I have altro tried using lxc-execute, but the application is not started.

Can you please provide me with a very simple shell script starting a few containers in a loop, and running an example application (so that I can test the app is actually running)?

Thank you in advance.
With kind regards,

Massimo Cafaro



- 

*******************************************************************************************************

 Massimo Cafaro, Ph.D.                               Additional affiliations:
 Assistant Professor                                      Euro-Mediterranean Centre for Climate Change
 Dept. of Engineering for Innovation          SPACI Consortium  
 University of Salento, Lecce, Italy             E-mail massimo.cafaro at unisalento.it
 Via per Monteroni                                                     massimo.cafaro at cmcc.it
 73100 Lecce, Italy					                                cafaro at ieee.org
 Voice/Fax  +39 0832 297371 				                        cafaro at acm.org   
 Web     http://sara.unisalento.it/~cafaro                                                                 
       

*******************************************************************************************************






-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1627 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120606/66022140/attachment.bin>


More information about the lxc-users mailing list