[one-users] opennebula: lease creation and usage

Stéphane Bulot stephane at altern-it.com
Fri Mar 23 04:17:20 PDT 2012


Hi Carlos,

Thanks for your answer.
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.
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).

Tell me what you're thinking about this.

Here's the way to reproduce:
-First, I create a vm from my template, with the following NIC
NIC = [ NETWORK_ID = 5,
        MODEL=virtio,
        IP=X.X.X.1 ]
When I do a "onevnet show 5", I see that lease associated with this IP is
used.
-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.

-Finally, because lease has been freed, I'm able to create another vm with
the template.

Best regards.
Stephane


2012/3/20 Carlos Martín Sánchez <cmartin at opennebula.org>

> Hi Stéphane,
>
> I can see some problems with the templates you are pasting:
>
> - Your VNet template must use the LEASES attribute instead of LEASE, take
> a look at the examples in the doc. [1]
>
> - 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].
>
> - 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].
>
> Regards
>
> [1] http://opennebula.org/documentation:rel3.2:vnet_template
> [2]
> http://opennebula.org/documentation:rel3.2:template_simple#network_section
> [3] http://opennebula.org/documentation:rel3.2:template#network_section
> --
> Carlos Martín, MSc
> Project Engineer
> OpenNebula - The Open-source Solution for Data Center Virtualization
> www.OpenNebula.org | cmartin at opennebula.org | @OpenNebula<http://twitter.com/opennebula><cmartin at opennebula.org>
>
>
>
> On Mon, Mar 19, 2012 at 4:22 PM, Stéphane Bulot <stephane at altern-it.com>wrote:
>
>> Hello,
>>
>> 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.
>>
>> My virtual network template:
>> NAME = "MYNet"
>> TYPE = FIXED
>> BRIDGE = br191
>> LEASE =[ IP=X.X.X.2,MAC=02:00:0A:01:5B:02]
>> LEASE =[ IP=X.X.X.3,MAC=02:00:0A:01:5B:03]
>> LEASE =[ IP=X.X.X.4,MAC=02:00:0A:01:5B:04]
>>
>> 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.
>>
>> Here is my vm template NIC section:
>> NIC = [ NETWORK_UID=4,
>>         MODEL=virtio,
>>         MAC=02:00:0a:01:5b:02]
>>
>> where NETWORK_UID is the network id defined above.
>>
>> After starting VM, lease is still seen as a template.
>> 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.
>>
>> Purpose of using lease is to prevent multiple vm started with same MAC/IP.
>>
>> Did I miss something?
>>
>> Thanks in advance
>> --
>> Stéphane Bulot
>> ***
>> **44, avenue Dumotel
>> 94230 CACHAN
>>
>> Tél: 01 83 62 06 87
>> Mob: 06 87 02 73 79
>> web: http://www.altern-it.fr <http://www.altern-it.com/>
>> e-mail: stephane at altern-it.com**
>>
>> *
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>>
>


-- 
Stéphane Bulot
***
**44, avenue Dumotel
94230 CACHAN

Tél: 01 83 62 06 87
Mob: 06 87 02 73 79
web: http://www.altern-it.fr <http://www.altern-it.com/>
e-mail: stephane at altern-it.com**

*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120323/5b611cac/attachment-0003.htm>


More information about the Users mailing list