<div dir="ltr"><div><div><div><div><div>Hello Jaime,<br><br></div>I don't have a hook for that. It was an idea I came up with for this <br></div>particular use case. I don't use DHCP with OpenNebula.<br><br></div>Anyway, good question though. I have made a little bit of research about OMAPI<br>

and how can one use it from different programming languages.<br><br></div>Ruby: <br><a href="https://github.com/pikelly/dhcpIT" target="_blank">https://github.com/pikelly/dhcpIT</a><br>
</div><a href="http://www.ruby-doc.org/gems/docs/e/esxmagicwand-0.1.2/DHCP/Server.html" target="_blank">http://www.ruby-doc.org/gems/docs/e/esxmagicwand-0.1.2/DHCP/Server.html</a><br><br>Python: <br><div><div><div><a href="https://code.google.com/p/pyomapic/" target="_blank">https://code.google.com/p/pyomapic/</a><br>


<a href="https://github.com/jof/pypureomapi" target="_blank">https://github.com/jof/pypureomapi</a><br><br></div><div>Perl:<br><a href="http://search.cpan.org/~jhthorsen/Net-ISC-DHCPd-0.14/lib/Net/ISC/DHCPd/OMAPI.pm">http://search.cpan.org/~jhthorsen/Net-ISC-DHCPd-0.14/lib/Net/ISC/DHCPd/OMAPI.pm</a><br>

<br></div><div>Bash:<br><a href="http://www.jedi.be/blog/2010/12/08/automating-dhcp-management-with-omapi/">http://www.jedi.be/blog/2010/12/08/automating-dhcp-management-with-omapi/</a> (also has a Java example)<br><a href="http://comments.gmane.org/gmane.network.dhcp.isc.dhcp-server/11411">http://comments.gmane.org/gmane.network.dhcp.isc.dhcp-server/11411</a><br>

<br></div><div>Hope it helps :).<br><br></div><div>Best,<br>Valentin<br></div><div><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 12:17 PM, Jaime Melis <span dir="ltr"><<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Valentin,<div><br></div><div>I actually hadn't thought of that, it's a great idea :) You could even map the other context values, not just the IP!</div>

<div><br></div><div>Do you have this hook per chance?</div>

<div><br></div><div>cheers,<br>Jaime</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 10:12 AM, Valentin Bud <span dir="ltr"><<a href="mailto:valentin.bud@gmail.com" target="_blank">valentin.bud@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello Christophe,<br><br></div>If you really want to use DHCP in combination with OpenNebula I suggest you<br>



take a look over omshell [1].<br><br></div>With a simple hook you could enter the required DHCP host entry via OMAPI<br>

</div>and your VM will pick it up at boot.<br><div><div><div><div><div><br>[1]: <a href="http://www.linuxcommand.org/man_pages/omshell1.html" target="_blank">http://www.linuxcommand.org/man_pages/omshell1.html</a><br><br>



</div><div>Best,<br>

</div><div>Valentin<br></div></div></div></div></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 6:46 PM, Ionut Popovici <span dir="ltr"><<a href="mailto:ionut@hackaserver.com" target="_blank">ionut@hackaserver.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>NAT don't have anything how you manage
      your inside network or control'it .. <br>
      DHCP will not masquerade your ip's <br>
      DHCP is Dinamyc Host Control Protocol this way you cand control
      the hosts .. or you can control manualy configuring each host or
      use Conextualization scripts to have ip's form your opennebula
      lesses<br>
      <a href="http://archives.opennebula.org/documentation:rel4.4:cong" target="_blank">http://archives.opennebula.org/documentation:rel4.4:cong</a><br>
      On 5/8/2014 6:31 PM, Christophe Duez wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Owkey like that I know but I thought there was a
        script or something. so that you don't need to type all the IP's<br>
        The problem is that I have only 1 ip-address that has connection
        to the internet.<br>
        this ip is dedicated to a vm running NAT and DHCP so the other
        VM's will get an IP from this VM's DHCP  and can pass through
        the NAT for connection to the outside world.<br>
        <div>having to put all the IP's in the DHCP config file is crazy
          work not?</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote"><div><div>On Thu, May 8, 2014 at 4:41 PM, Ionut
          Popovici <span dir="ltr"><<a href="mailto:ionut@hackaserver.com" target="_blank">ionut@hackaserver.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 bgcolor="#FFFFFF" text="#000000"><div><div>
              <div>
                <div>On 5/8/2014 5:09 PM, Christophe Duez wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">I know of the mac address of opennebula
                    but I don't know how to enter this in a dhcp config
                    file :/</div>
                  <div class="gmail_extra"><br>
                  </div>
                </blockquote>
              </div>
              isc-dehcp-server config .<br>
              /etc/dhcp/dhcpd.conf<br>
              <br>
              subnet 10.200.0.0 netmask 255.255.255.224 {<br>
                range 10.200.0.2 10.200.0.30;<br>
                option domain-name-servers 10.200.0.1;<br>
                option routers 10.200.0.1;<br>
                option broadcast-address 10.200.0.31;<br>
                default-lease-time 600;<br>
                max-lease-time 7200;<br>
              }<br>
              <br>
              host host-2 {<br>
                hardware ethernet 02:00:0a:c8:00:02;<br>
                fixed-address 10.200.0.2;<br>
              }<br>
              host host-3 {<br>
                hardware ethernet 02:00:0a:c8:00:03;<br>
                fixed-address 10.200.0.3;<br>
              }<br>
              host host-4 {<br>
                hardware ethernet 02:00:0a:c8:00:04;<br>
                fixed-address 10.200.0.4;<br>
              }<br>
              <br>
              ............<br>
              <br>
              host host-30 {<br>
               hardware ethernet 02:00:0a:c8:00:1E;<br>
               fixed-address 10.200.0.30;
              </div></div><div>
                <div><br>
                  }<br>
                  <blockquote type="cite">
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote"><div><div>On Thu, May 8, 2014 at
                        3:26 PM, Ionut Popovici <span dir="ltr">
                          <<a href="mailto:ionut@hackaserver.com" target="_blank">ionut@hackaserver.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 bgcolor="#FFFFFF" text="#000000"><div><div>
                            <div>Or you can make you dhcp server with
                              pools and add fixed address via mac <br>
                              Because opennebula use very nice mac
                              asingment based on ip transformed on hexa.<br>
                              Default mac for opennebula is 02:00 and
                              other 4 hexa digits are ip address decimal
                              tranformed on hexa.<br>
                              for ip 10.10.10.10 opennebula will use mac<br>
                              02:00:0a:0a:0a:0a<br>
                              or ip 10.10.0.1 = 02:00:0a:0a:00:01<br>
                              with this you can easy make an dhcp lesses
                              for your networks
                              <div>
                                <div><br>
                                  On 5/8/2014 4:04 PM, Christophe Duez
                                  wrote:<br>
                                </div>
                              </div>
                            </div>
                            </div></div><div><div><div>
                              <div>
                                <blockquote type="cite">
                                  <div dir="ltr">But I need to know how
                                    to do it. not simply install and
                                    work....</div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote">On Thu, May
                                      8, 2014 at 2:58 PM, Гусев Павел <span dir="ltr">
                                        <<a href="mailto:pgusev@qsoft.ru" target="_blank">pgusev@qsoft.ru</a>></span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                        <div>
                                          <div>I think you must us
                                            Virtual Router (from
                                            Marketplace) with DHCP
                                            daemon</div>
                                          <div> </div>
                                          <div>-- <br>
                                            С уважением,</div>
                                          <div>Гусев Павел</div>
                                          <div>Руководитель отдела
                                            системного администрирования</div>
                                          <div> </div>
                                          <div>QSOFT | Ведущий
                                            web-интегратор</div>
                                          <div> </div>
                                          <div>офис 7(495) 771-7363 #110
                                            | моб. 7(926) 850-1108</div>
                                          <div><a href="mailto:pgusev@qsoft.ru" target="_blank">pgusev@qsoft.ru</a>  </div>
                                          <div>Москва, Авангардная
                                            улица, 3  |  <a href="http://qsoft.ru" target="_blank">qsoft.ru</a></div>
                                          <div>San Francisco, 222
                                            Columbus Ave |  <a href="http://qsoftus.com" target="_blank">qsoftus.com</a></div>
                                          <div> </div>
                                          <div> </div>
                                          <div> </div>
                                          <div>08.05.2014, 16:25,
                                            "Christophe Duez" <<a href="mailto:christophe.duez@student.uantwerpen.be" target="_blank">christophe.duez@student.uantwerpen.be</a>>:</div>
                                          <blockquote type="cite">
                                            <div>
                                              <div>
                                                <div>Hello,
                                                  <div>Is it possible
                                                    that a virtual
                                                    DHCP-server gives ip
                                                    addresses to the
                                                    other VM's and that
                                                    OpenNebula will take
                                                    over this ip-address
                                                    in sunstone?<br>
                                                    Because now my dhcp
                                                    gives the new VM an
                                                    IP-address but in
                                                    the sunstone
                                                    interface the VM has
                                                    an other IP given by
                                                    the Virtual Network
                                                    template</div>
                                                  <div> </div>
                                                  <div>can this be
                                                    changed?</div>
                                                  <div>
                                                    <div> </div>
                                                    -- <br>
                                                    <div>Kind regards,
                                                      <div>Duez
                                                        Christophe
                                                        <div>Student at
                                                          University of
                                                          Antwerp :<br>
                                                          <div>Master of
                                                          Industrial
                                                          Sciences:
                                                          Electronics-ICT
                                                          <div>
                                                          <div><br>
                                                          <div>E <a href="mailto:christophe.duez@student.uantwperen.be" target="_blank">christophe.duez@student.uantwperen.be</a></div>
                                                          <div>L <a href="http://www.linkedin.com/pub/duez-christophe/74/7/39" target="_blank">linkedin
duez-christophe</a></div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                            ,
                                            <p>_______________________________________________<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></p>
                                          </blockquote>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                    <br clear="all">
                                    <div><br>
                                    </div>
                                    -- <br>
                                    <div dir="ltr">Kind regards,
                                      <div>Duez Christophe
                                        <div>Student at University of
                                          Antwerp :<br>
                                          <div>Master of Industrial
                                            Sciences: Electronics-ICT
                                            <div>
                                              <div><br>
                                                <div>E <a href="mailto:christophe.duez@student.uantwperen.be" target="_blank">christophe.duez@student.uantwperen.be</a></div>
                                                <div>L <a href="http://www.linkedin.com/pub/duez-christophe/74/7/39" target="_blank">linkedin
                                                    duez-christophe</a></div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                  <pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
</pre>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div></div></div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br><div>
                      <div dir="ltr">M.v.g.<br>
                        Duez Christophe
                        <div><br>
                          T <a href="tel:%2B32497552655" value="+32497552655" target="_blank">+32497552655</a>
                          <div>E <a href="mailto:duez_christophe@hotmail.com" target="_blank">duez_christophe@hotmail.com</a></div>
                          <div>S christophe.duez</div>
                          <div>L <a href="http://www.linkedin.com/pub/duez-christophe/74/7/39" target="_blank">linkedin duez-christophe</a></div>
                        </div>
                      </div>
                    </div></div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div><div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr">M.v.g.<br>
          Duez Christophe
          <div><br>
            T <a href="tel:%2B32497552655" value="+32497552655" target="_blank">+32497552655</a>
            <div>E <a href="mailto:duez_christophe@hotmail.com" target="_blank">duez_christophe@hotmail.com</a></div>
            <div>S christophe.duez</div>
            <div>L <a href="http://www.linkedin.com/pub/duez-christophe/74/7/39" target="_blank">linkedin duez-christophe</a></div>
          </div>
        </div>
      </div></div>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<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><br clear="all"><br>-- <br></div></div><span><font color="#888888"><div dir="ltr">Valentin Bud<div><a href="http://databus.pro" target="_blank">http://databus.pro</a> | <a href="mailto:valentin@databus.pro" target="_blank">valentin@databus.pro</a></div>





</div>
</font></span></div>
<br>_______________________________________________<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><br clear="all"><div><br></div>-- <br></div></div><span class="HOEnZb"><font color="#888888"><div dir="ltr"><div>Jaime Melis<br>Project Engineer<br>OpenNebula - Flexible Enterprise Cloud Made Simple<br>

<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a></div>

</div>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Valentin Bud<div><a href="http://databus.pro" target="_blank">http://databus.pro</a> | <a href="mailto:valentin@databus.pro" target="_blank">valentin@databus.pro</a></div>

</div>
</div>