[one-users] Assigning fixed IP's to VM's

Jaime Melis j.melis at fdi.ucm.es
Wed Oct 7 06:51:28 PDT 2009


Hi cmasmas

bridge name     bridge id               STP enabled     interfaces
> eth0            8000.001e373597bc       no              peth0
>

you should have in your network template then:
BRIDGE = eth0

I think I do need to specity a MAC-IP pair. Each VM must have the same IP,
> always, even if they are restarted.
>

Follow these steps:

   - enable saving: "SAVE = yes" in the vm template file.
   - contextualize the VM with the vmcontext scripts (follow the guide Tino
   showed you)
   - stop the vm with onevm stop <vmid>
   - resume the vm whenever you want with onevm resume <vmid>

As you can see you don't need DHCP. OpenNebula will generate the MAC, the
vmcontext script running in your vms will grab the MAC and configure the IP
accordingly. Since the MAC address won't change, the IP won't change either,
even if you reboot the vm. By doing 'stop', you create a checkpoint and you
can resume it later.

regards,
Jaime

On Wed, Oct 7, 2009 at 11:39 AM, cmasmas cmasmas <cmasmas10 at gmail.com>wrote:

>
>
> 2009/10/5 Jaime Melis <j.melis at fdi.ucm.es>
>
>> Hi cmasmas,
>
>
> First of all, thanks for your answer.
>
>
>
>
>
>
>
>> This parameter is actually very important. The way hypervisors work is to
>> create a tun/tap device and to attach to it a bridge. The whole point of
>> this is to permit your vm to be in the same network as the the selected
>> device of the host. Execute 'brctl show' to see what bridges you have.
>>
>
> bridge name     bridge id               STP enabled     interfaces
> eth0            8000.001e373597bc       no              peth0
>
>
>
>> Regarding the network template, I would suggest that you didn't specify
>> the MAC for each IP, like this:
>>
>> *LEASES = [IP=192.168.2.2]
>> LEASES = [IP=192.168.2.3]*
>>
>
> I think I do need to specity a MAC-IP pair. Each VM must have the same IP,
> always, even if they are restarted.
>
> Maybe what I'm trying to do is not possible. I wanted to create a small
> network of 5-6 VM's to do some testing. I don't need access to Internet, but
> only the communication between the VM's. In a previous mail, I said about
> the problem with the DHCP server @ University.
> So, is it possible what I need without a DHCP server?
>
> Thanks again, and sorry if I'm not clear.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20091007/f256e250/attachment-0001.htm>


More information about the Users mailing list