[one-users] Opennebula + DHCP

Ruben S. Montero rubensm at dacya.ucm.es
Sun Nov 28 11:32:18 PST 2010


There are three options to set up networking for a VM:

1.- Use static IPs, i.e hard-coded in the VM image. This is useful for
"well-known" services, but usually people do not use this approach as
it prevents an "install once deploy many" strategy

2.- Use specialized networking VMs,  that runs a DHCP server and
probably any other network related services (DNS, VPN server, routers,
proxy of any kind). This is useful for VM packs, where you define
vnets. Vnets in OpenNebula can be implemented with ebtables (works
out-of-the-box, see [1]) and with VLAN at the switch level (either
setting the vnets before hand, or with a hook to configure the swtich,
e.g. openvswitch)

3.- Context. Context is not just for passing network config parameters
but also for basic service configuration attributes (e.g. ssh keys).
This is  the best approach for stand-alone VMs and probably also for
the virtual network example. It only requires to prepare network configuration
script of the OS to get the IP from the context device.

However, the best approach should be more or less clear depending on
the use-case you are trying to deploy, the networking of your cloud...



[1] http://www.opennebula.org/documentation:rel2.0:nm

2010/11/28 SZÉKELYI Szabolcs <szekelyi at niif.hu>:
> On 2010. November 27. 18:01:24 Steven Timm wrote:
>> I have never used opennebula with a dhcp server but I think you would
>> have either have to use the contextualization scripts to pass in
>> a modified ifcfg-eth0 that calls for DHCP address, or save a special
>> original image that has them already.  Also you would have to configure
>> the onevnet so you knew which range of MAC addresses your machines were
>> going to have.
> Being badly dissatisfied with "contextualization" (there's no ifcfg-eth0 on
> Debian-based systems for example, not mentioning non-GNU/Linux OSes), we
> solved this problem by implementing DHCP on our virtual networks. On VM
> creation, a hook script registers the MAC address and the IP address in the
> DHCP server that assigns it to the VM upon DHCP request. This requires the
> machine running the DHCP server (or a DHCP relay) to have an interface in the
> network used for VMs, but this is usually not a problem as long as you use
> 802.1q tagged virtual networks. This can be implemented for ebtables-based
> vnets as well, but requires a bit tricker setup.
> I can provide you with more deatils or even code if interested, but currently
> I don't have time to make proper redistributable and configurable packages.
> Cheers,
> --
> cc
>> On Sat, 27 Nov 2010, Tim Bordemann wrote:
>> > Hi,
>> >
>> > I'm currently evaluating Opennebula for a university's project.
>> > So far I installed Opennebula and am able to start virtual machines on
>> > the server nodes.
>> > Unfortunately I am not sure, how to configure Opennebula or the virtual
>> > machine template so that the vm gets it's IP address from the
>> > DHCP-server. Could anyone please send me a sample vm template?
>> >
>> > Thanks in advance.
>> > Tim
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opennebula.org
>> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Dr. Ruben Santiago Montero
Associate Professor (Profesor Titular), Complutense University of Madrid

URL: http://dsa-research.org/doku.php?id=people:ruben
Weblog: http://blog.dsa-research.org/?author=7

More information about the Users mailing list