<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi, I have this problem and I tried that solution, but how do you do
    to configure the VM image to use DHCP, is it in the context scripts?<br>
    Thanks,<br>
    <br>
    Leonardo<br>
    <br>
    El 30/11/2010 8:24, Manish Sapariya escribió:
    <blockquote cite="mid:4CF4A6C7.1060505@gslab.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <font size="+1"><tt>+1<br>
          This is exactly what I do. The downside for<br>
          me is that I do not control the DHCP server<br>
          and it brings its own problems, mostly operational.</tt></font>
      <br>
      <pre class="moz-signature" cols="72">Thanks and Regards,
Manish</pre>
      <br>
      On 11/30/2010 5:36 AM, <a moz-do-not-send="true"
        class="moz-txt-link-abbreviated"
        href="mailto:Carsten.Friedrich@csiro.au">Carsten.Friedrich@csiro.au</a>
      wrote:
      <blockquote
cite="mid:439139C994945E41B9886BE89789549B0292A0F410@EXNSW-MBX05.nexus.csiro.au"
        type="cite">
        <pre wrap="">There is (at least) one more, which I think is the most general and easy to run once set up, if: 

* You want the VMs to be part of your general network.
* You have a DHCP server in your general network.
* You have a fixed set of addresses you want to VMs to use and which are not used by any other machines on the network.

Then:

* Create a bridge on all cloud nodes with the same name (e.g. br0) and bind the NICs on each server to it.
* Create a OpenNebula virtual network with fixed, free addresses like:
NAME = "Small network"
TYPE = FIXED

BRIDGE = br0
LEASES = [ IP="x.y.z.65"]
LEASES = [ IP="x.y.z.66"]
LEASES = [ IP="x.y.z.67"]
LEASES = [ IP="x.y.z.72"]
LEASES = [ IP="x.y.z.73"]
...
...

* Add entries to your DHCP server binding the MAC address OpenNebula will generate for the VM to the corresponding fixed IP. (the MAC address will be a configurable prefix + the IP address in hex).
* Configure your VM images to use DHCP.

Now, when you start a VM, it will get a MAC address from OpenNebula (no context necessary) and then an IP address from your DHCP server. 

Carsten


-----Original Message-----
From: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.opennebula.org">users-bounces@lists.opennebula.org</a> [<a moz-do-not-send="true" class="moz-txt-link-freetext" href="mailto:users-bounces@lists.opennebula.org">mailto:users-bounces@lists.opennebula.org</a>] On Behalf Of Ruben S. Montero
Sent: Monday, 29 November 2010 6:32
To: SZÉKELYI Szabolcs
Cc: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a>
Subject: Re: [one-users] Opennebula + DHCP

Hi

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...

Cheers

Ruben

[1] <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opennebula.org/documentation:rel2.0:nm">http://www.opennebula.org/documentation:rel2.0:nm</a>

2010/11/28 SZÉKELYI Szabolcs <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:szekelyi@niif.hu"><szekelyi@niif.hu></a>:
</pre>
        <blockquote type="cite">
          <pre wrap="">On 2010. November 27. 18:01:24 Steven Timm wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">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.
</pre>
          </blockquote>
          <pre wrap="">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


</pre>
          <blockquote type="cite">
            <pre wrap="">On Sat, 27 Nov 2010, Tim Bordemann wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">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
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
</pre>
            </blockquote>
          </blockquote>
          <pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>

</pre>
        </blockquote>
        <pre wrap="">

</pre>
      </blockquote>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
</pre>
    </blockquote>
  </body>
</html>