Ruben S. Montero
rsmontero at opennebula.org
Wed Jul 30 04:36:49 PDT 2014
It seems that you are confused about not seeing the IP assigned by
OpenNebula matching the IP assigned by the DHCP server:
1. If the IP addresses are managed by the DHCP server, then you can just
ignore the IP assigned by OpenNebula. It is derived from the MAC and it is
not used in this case by OpenNebula.
if you need to populate the IP of the VM to the VM Template to be queried
through Sunstone or CLI that could be done by onegate or a custom monitor
2. If OpenNebula manages the IPs you can integrate the DHCP server as
explained by Valentin
3. In 4.8 you can define the network as type Ethernet, to express that the
IP is manged externally and get rid of the IP inconsistency you may be
Hope it helps
On Jul 24, 2014 9:37 PM, "kerryhall ." <kerryhall at gmail.com> wrote:
> Thank you for the help!
> Yes, AFAIK the DNS server is configured with a dynamic zone that is
> updated from the DHCP server.
> It sounds like the DHCP server in use is Microsoft DHCP. I would like to
> avoid using the DHCP API if possible, just because I have no experience in
> that area, and seems like a messy solution.
> Thinking about this more, here are the desired steps:
> 1. User spins up vm via web interface.
> 2. Contextualization sets "DHCP_HOSTNAME" to vm name.
> 3. DHCP server gives vm an IP address.
> 4. Sunstone sets the correct IP information in its database.
> I can basically do all this manually by
> 1. Spin up vm
> 2. edit ifcfg-eth0, setting BOOTPROTO and DHCP_HOSTNAME
> 3. restart networking
> So it sounds like I can write a bash script that takes care of 2. and 3.,
> something that runs when the vm is spun up.
> However, I don't know how to manually tell Sunstone what the new, correct
> IP is. Do you know how I could accomplish that?
> I can write a bash or perl script that fixes this manually in MySQL....but
> that seems like a Really Bad Idea. :)
> I'm surprised that OpenNebula doesn't support DHCP out of the box. Seems
> like a common use case. I wonder if I should make a feature request.
> On Wed, Jul 23, 2014 at 10:03 PM, Valentin Bud <valentin.bud at gmail.com>
>> Hello Kerry,
>> When you say "DNS and DHCP are tied into one system on my network" you
>> your DNS server is configured with a dynamic zone that is updated from
>> the DHCP
>> If that is so, I guess you want a VM to acquire a lease from the DHCP
>> server equal
>> to the IP given by OpenNebula to that specific VM. This way it maintains
>> If you populate CONTEXT with NETWORK="YES", the contextualization
>> will do the job of configuring the network. As far as I know it's not
>> possible to "tell"
>> the contextualization packages to leave the network unconfigured. So
>> using this approach
>> would not get you where you want.
>> One way of achieving what you desire is to program a hook that inserts a
>> host in the
>> DHCP server via OMAPI . From the hook you have access to the entire
>> I am assuming you are using ISC DHCP. This would solve the consistency
>> Now the VM needs to be configured for DHCP as you mentioned in your
>> previous E-Mail.
>> For that you can define SET_HOSTNAME in the CONTEXT to have it available
>> in the
>> VM, create a simple (bash) program that reads it and sets ifcfg-eth0
>> accordingly. Put the
>> script in the files datastore and update the context to use it via
>> FILES_DS and INIT_SCRIPTS.
>> For example you name your super script set_dhcp.sh. You can insert in the
>> files datastore 
>> using `oneimage create -d files --name set_dhcp.sh --type CONTEXT
>> Update the template to use it.
>> This way the vmcontext init.d script from the contextualization packages
>> would skip the
>> network configuration, note NETWORK="YES" is missing and it would run the
>> One more thing that comes to mind, SET_HOSTNAME would instruct the
>> vmcontext init
>> script to set the hostname and maybe that's not what you want, maybe you
>> want your VM
>> to set it's hostname from DHCP. In this case use another variable, like
>> in CONTEXT and process it in set_dhcp.sh to configure ifcfg-eth0.
>> You can set DHCP_HOSTNAME=$NAME inside the template. This way the name you
>> give the VM in Sunstone would end up being used.
>> Take the above with a grain of salt, I am sure there are other (better)
>> ways of achieving
>> what you desire.
>> @Diego could you please point me where have you find DHCP in the VNET
>> I have looked over the docs and couldn't find it.
>> : http://ipamworldwide.com/dhcp-api.html
>> : http://docs.opennebula.org/4.6/administration/storage/file_ds.html
>> On Wed, Jul 23, 2014 at 10:45 PM, kerryhall . <kerryhall at gmail.com>
>>> I have managed to figure out how to edit my template (onetemplate update
>>> TEMPLATE_ID) so I can now set the hostname. However, DNS and DHCP are tied
>>> into one system on my network, so I can't perform a dig on my new server
>>> and get the IP back.
>>> I just need to know what lines to add to my template file to get my vms
>>> to use DHCP only. I'm sure it's something really simple, I just can't find
>>> any info here:
>>> If you know how to get DHCP working, please let me know.
>>> Thank you!!
>>> On Tue, Jul 22, 2014 at 3:48 PM, kerryhall . <kerryhall at gmail.com>
>>>> Hi folks,
>>>> I want to configure Open Nebula to contextualize two items for
>>>> DHCP_HOSTNAME=<parameter passed in via ONE web interface, even just
>>>> vm-name would work>
>>>> I need no other networking settings. DHCP on my network handles the
>>>> rest. I have tried manually setting these two parameters in ifcfg-eth0 and
>>>> it looks like it works. (Although the new IP given via DHCP doesn't match
>>>> the original IP)
>>>> Is this possible to do in ONE? If so, where do I start?
>>> Users mailing list
>>> Users at lists.opennebula.org
> Users mailing list
> Users at lists.opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users