Hi Carlos,<br><br>Thanks for your answer.<br>I was wrong using LEASE instead of LEASES. I find it a little bit confusing. I followed your advices and it is indeed much better. <br>Unfortunatly, I've noticed something that looks like a bug in lease management: if I try to create a new vm with a template already used by another running vm (with lease reservation), the vm is not created (as expected), but the lease is freed (not expected).<br>
<br>Tell me what you're thinking about this.<br><br>Here's the way to reproduce:<br>-First, I create a vm from my template, with the following NIC<br>NIC = [ NETWORK_ID = 5,<br> MODEL=virtio,<br> IP=X.X.X.1 ]<br>
When I do a "onevnet show 5", I see that lease associated with this IP is used.<br>-Then, I create another vm from the same template (for test purpose). As expected, the vm is not created, because lease is already in use. At this moment, if I do "onevnet show 5", the lease is not used anymore.<br>
<br>-Finally, because lease has been freed, I'm able to create another vm with the template.<br><br>Best regards.<br>Stephane<br><br><br><div class="gmail_quote">2012/3/20 Carlos Martín Sánchez <span dir="ltr"><<a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Stéphane,<div><br></div><div>I can see some problems with the templates you are pasting:</div><div><br></div><div>- Your VNet template must use the LEASES attribute instead of LEASE, take a look at the examples in the doc. [1]</div>
<div><br></div><div>- Inside VM/NIC, NETWORK_UID must be combined with the NETWORK attribute. If you want to provide the VNET ID, then you need to use the attribute NETWORK_ID [2].</div><div><br></div><div>- In VM/NIC, the MAC must not be set manually if you are requesting a Lease from a VNet. It is also a restricted attribute, what means that your template will only work for oneadmin. Instead, request an specific Lease from your VNet using the IP attribute [3].</div>
<div><br></div><div>Regards</div><div><br></div><div>[1] <a href="http://opennebula.org/documentation:rel3.2:vnet_template" target="_blank">http://opennebula.org/documentation:rel3.2:vnet_template</a></div>
<div>[2] <a href="http://opennebula.org/documentation:rel3.2:template_simple#network_section" target="_blank">http://opennebula.org/documentation:rel3.2:template_simple#network_section</a></div><div>[3] <a href="http://opennebula.org/documentation:rel3.2:template#network_section" target="_blank">http://opennebula.org/documentation:rel3.2:template#network_section</a><br clear="all">
--<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"><div><div>On Mon, Mar 19, 2012 at 4:22 PM, Stéphane Bulot <span dir="ltr"><<a href="mailto:stephane@altern-it.com" target="_blank">stephane@altern-it.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
Hello,<br><br>I'm trying to create and use leases on virtual network. My issue is that I'm not able to associate lease with virtual machines.<br><br>My virtual network template:<br>NAME = "MYNet"<br>TYPE = FIXED <br>
BRIDGE = br191<br>LEASE =[ IP=X.X.X.2,MAC=02:00:0A:01:5B:02]<br>LEASE =[ IP=X.X.X.3,MAC=02:00:0A:01:5B:03]<br>LEASE =[ IP=X.X.X.4,MAC=02:00:0A:01:5B:04]<br><br>Virtual network creation seems to be ok, but If I do a "onevnet show ID -x", I can see that my leases existing in virtual network template, but not as a free lease.<br>
<br>Here is my vm template NIC section:<br>NIC = [ NETWORK_UID=4,<br> MODEL=virtio, <br> MAC=02:00:0a:01:5b:02]<br><br>where NETWORK_UID is the network id defined above.<br><br>After starting VM, lease is still seen as a template.<br>
As I manually create lease with onevnet addleases command, I'm able to see lease as a free lease, but after starting VM, lease is still seen as free lease.<br>
<br>Purpose of using lease is to prevent multiple vm started with same MAC/IP.<br><br>Did I miss something?<br><br clear="all">Thanks in advance <br><span><font color="#888888">-- <br>Stéphane Bulot<br><b><img src="" width="56" height="63"></b><b><br>
</b><i>44, avenue Dumotel<br>94230 CACHAN<br><br>Tél: 01 83 62 06 87<br>Mob: 06 87 02 73 79<br>
web: <a href="http://www.altern-it.com/" target="_blank">http://www.altern-it.fr</a><br>e-mail: <a href="mailto:stephane@altern-it.com" target="_blank">stephane@altern-it.com</a></i><b><br><br></b><br>
</font></span><br></div></div>_______________________________________________<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/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br>Stéphane Bulot<br><b><img src="http://www.altern-it.fr/wp-content/uploads/2011/10/logo-doc.png" width="56" height="63"></b><b><br></b><i>44, avenue Dumotel<br>94230 CACHAN<br>
<br>Tél: 01 83 62 06 87<br>Mob: 06 87 02 73 79<br>
web: <a href="http://www.altern-it.com/" target="_blank">http://www.altern-it.fr</a><br>e-mail: <a href="mailto:stephane@altern-it.com" target="_blank">stephane@altern-it.com</a></i><b><br><br></b><br>