Hi,<div><br class="Apple-interchange-newline">You can request a specific IP from the network using NIC/IP [1]. For example:</div><div><br></div><div>NIC = <span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">[</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"> NETWORK_ID="0",</span></div><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"> IP = "</span><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">10.10.10.1</span><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">"</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">]</span></div><div><br></div><div>This can't be parameterized, but you can try to automate it in bash doing a 'onetemplate update' and pipe it to sed to replace the IP. Or write a small ruby script to get the template info, change the IP, and do an instantiate action.</div>
<div><br></div><div><br></div><div>Regards</div><div><br></div><div>[1] <a href="http://opennebula.org/documentation:rel3.6:template#network_section">http://opennebula.org/documentation:rel3.6:template#network_section</a></div>
<div>--<br>Carlos Martín, MSc<br>Project Engineer<br>OpenNebula - The Open-source Solution for Data Center Virtualization<div><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span></div>
<br>
<br><br><div class="gmail_quote">On Thu, Oct 18, 2012 at 7:20 AM, <span dir="ltr"><<a href="mailto:knawnd@gmail.com" target="_blank">knawnd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear community,<br>
<br>
I wonder if there is a way to assign a certain IP address for particular VM created and deployed by 'onetemplate instantiate' command? Right now it looks like IP is chosen randomly from the pool of free IP addresses (leases).<br>
Moreover from time to time I need to create a bunch of identical VMs which differ only by hostnames and corresponding IP addresses.<br>
It seems that the use of 'onetemplate instantiate' command looks reasonable in that case but I don't know how to pass the IP addresses.<br>
<br>
I would assume something like<br>
$ onetemplate instantiate --name vm%i -m 5 --ip 10.10.10.%i<br>
<br>
with the following network definition and contextualization section in template description as below:<br>
NIC=[ NETWORK_ID="0" ]<br>
<br>
CONTEXT=[<br>
HOSTNAME="$<a href="http://NAME.domain.org" target="_blank">NAME.domain.org</a>",<br>
NAMESERVER="$NETWORK[DNS, NETWORK_ID=0 ]" ]<br>
<br>
<br>
I can't use DHCP since venet is used as network devices (I am using OpenVZ hypervisor) and venet doesn't support DHCP.<br>
So I wonder what the possible ways to pass hostname and corresponding IP address to the VM deployment file are to be parsed by deploy script and make a proper OpenVZ config file?<br>
<br>
Iam using OpenNebula 3.6 installed from rpm.<br>
<br>
Regards,<br>
Nikolay.<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/<u></u>listinfo.cgi/users-opennebula.<u></u>org</a><br>
</blockquote></div><br></div>