<div dir="ltr">Hi Serge,<div>The script is a separate tool with a few built-in conventions to make creating containers much easier (only for centos right now)</div><div><br></div><div><b><u>Here is the usage information:</u></b></div>
<div><div>Description: create multiple centos containers.</div><div>usage: ./create_containers.sh <options></div><div>  -n: number of containers to be created</div><div>  -s: the start number</div></div><div><br></div>
<div><div><b><u>Example</u></b>:</div><div><div class=""><code class="">./create_containers.sh -n </code><code class="">5</code> <code class="">-s </code><code class="">111<br><br></code></div></div></div><div>This will create 5 containers, and their name and ip addresses will be set as follows:</div>
<div><table class=""><thead><tr class=""><th class=""><div class="">container name</div></th><th colspan="1" class=""><div class="">fqdn</div></th><th class=""><div class="">ip address</div></th></tr></thead><tbody class=""><tr>
<td class="">lxc111</td><td class=""><a href="http://lxc111.example.com">lxc111.example.com</a></td><td class="">192.168.122.111</td></tr><tr><td class="">lxc112</td><td class=""><a href="http://lxc112.example.com">lxc112.example.com</a></td>
<td class="">192.168.122.112</td></tr><tr><td class="">lxc113</td><td class=""><a href="http://lxc113.example.com">lxc113.example.com</a></td><td class="">192.168.122.113</td></tr><tr><td class="">lxc114</td><td class="">
<a href="http://lxc114.example.com">lxc114.example.com</a></td><td class="">192.168.122.114</td></tr><tr><td class="">lxc115</td><td class=""><a href="http://lxc115.example.com">lxc115.example.com</a></td><td class="">192.168.122.115</td>
</tr></tbody></table></div><div><br></div><div>The ip addresses and hostname mapping are set in the /etc/hosts in all the containers.</div><div><br></div><div>I will send the patch accordingly. Thanks!</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Mar 12, 2014 at 11:40 AM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">Quoting Mingjiang Shi (<a href="mailto:mrjewes@gmail.com">mrjewes@gmail.com</a>):<br>
> Hi All,<br>
> I use the Linux container to build test environment for my project, so I<br>
> made the following enhancements to the centos templates to make it easier<br>
> for me.<br>
> 1. Added option to not expire the root password<br>
<br>
</div>yes please.<br>
<div class=""><br>
> 2. Added option to copy my host ssh public key to the container so that I<br>
> can ssh the my containers without using password<br>
<br>
</div>yes please.<br>
<div class=""><br>
> 3. Added option to set static IP to the container<br>
<br>
</div>Should be fine.<br>
<div class=""><br>
> 4. Added a script to create a bunch of containers and setup the hosts files<br>
> so that they can be accessed via hostname.<br>
<br>
</div>I don't understand where this fits into the template.  Are you intending<br>
this as a separate tool or a part of the template?  Please send it<br>
separately and we can discuss.<br>
<div class=""><br>
> All the above changes are disabled by default, i.e. one need to pass extra<br>
> option to enable them.<br>
><br>
> Let me know if those changes can be contributed back to upstream.  Thanks!<br>
<br>
</div>Definately.  Please sent patches with a Signed-off-by to the lxc-devel<br>
mailing list, and we'll gratefully review.<br>
<br>
-serge<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks<br>-Mingjiang
</div>