[one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone

kerryhall . kerryhall at gmail.com
Mon Sep 8 12:35:54 PDT 2014


Javier,

Thank you for your help.

I am considering going with the following option (if this is possible)

Run bash script on boot that sets the DHCP_HOSTNAME to the hostname,
removes the NETMASK, IPADDR, and GATEWAY lines from
/etc/sysconfig/network-scripts/ifcfg-eth0, sets the BOOTPROTO to dhcp, and
restarts networking. I have a bash script already that will do this, and it
gives the desired result. I will then simply ignore the IP listed in
sunstone and deal with hostnames only. My script is written in such a way
that it can be run multiple times without issue.

I just need to figure out how to include this bash script and have to run
automatically when a new vm is spun up, but it looks like there should be
plenty of documentation on how to do this.

I am unsure how to use a DHCP client to suggest an IP to the DHCP server,
or if DHCP supports this.

Thanks!!
Kerry

On Mon, Sep 8, 2014 at 1:42 AM, Javier Fontan <jfontan at opennebula.org>
wrote:

> The context packages are meant to be used with static networking. To
> add that parameters to network configuration you can do one of these
> things:
>
> * Create the network configuration in the base images manually and do
> not set network contextualization in OpenNebula so they are not
> overwritten.
> * Modify the context packages to add those parameters [1]
>
> For the third thing there is no way to do it. OpenNebula gets an IP
> from the network pool and assigns it to the NIC. There is no way to
> change it after it is selected and there is no external method of
> selecting the IP. What you can do is configure DHCP so it picks the
> same IP as OpenNebula had selected for the VM. The MAC addresses are
> generated from the MAC prefix and the IP, you can configure DHCP with
> those mac/ip pairs.
>
> MAC = PREFIX + IP in hex
>
> 02:00:0a:00:00:01 = 02:00 + 10.0.0.1 (in hex is 0a:00:00:01)
>
> [1]
> https://github.com/OpenNebula/addon-context-linux/blob/master/base_rpm/etc/one-context.d/00-network#L103-L114
>
> On Sat, Sep 6, 2014 at 12:23 AM, kerryhall . <kerryhall at gmail.com> wrote:
> > Hi folks,
> >
> > I have a small ONE cluster that I am currently setting up on 4.8. I have
> a
> > ethernet network model, and I have added the following line to my
> template:
> >
> > SET_HOSTNAME="$NAME.mydomain.int"
> >
> > So far so good, but I need to be able to do the following three things:
> > 1. set "BOOTPROTO=dhcp" in /etc/sysconfig/network-scripts/ifcfg-eth0 on
> new
> > vms
> > 2. set "DHCP_HOSTNAME="$NAME.mydomain.int" on new vms
> > 3. set the "IP" field in sunstone to vm's IP address provided by DHCP
> >
> > How do I accomplish these items? I was thinking run a bash script on vm
> > startup for items 1 and 2, unless there is a builtin ONE way to do this,
> but
> > what about item 3? Is there just a straight up DHCP networking model I
> can
> > use to make this easier? Does anyone currently use ONE with DHCP?
> >
> > Thanks!!
> > Kerry
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opennebula.org
> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
> >
>
>
>
> --
> Javier Fontán Muiños
> Developer
> OpenNebula - Flexible Enterprise Cloud Made Simple
> www.OpenNebula.org | @OpenNebula | github.com/jfontan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140908/cc50b912/attachment.htm>


More information about the Users mailing list