Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
I would definitely not prefer that the vm manage the IP. What I would like to do upon new vm creation: 1. VM gets spun up with BOOTPROTO=dhcp 2. VM gets spun up with DHCP_HOSTNAME=$NAME 3. IP given to the VM by the dhcp server on my network is then the IP that is listed in sunstone for that VM. AFAIK: 1. There is no way to achieve item 1 in ONE out of the box, I have to either write a bash script that gets run on VM spin up, or create an image that does this. 2. I can set the _hostname_ via template, but in order to set DHCP_HOSTNAME again I have to run a bash script on spin up. 3. There is no way to accomplish item 3, outside of writing a bash script that runs on my head node that grabs IP data and dumps it into the database. Certainly this is not preferable. These three items taken all together suggest that including the option to easily support DHCP out of the box would be a nice feature to have. I'm working on a bash script currently for 1 and 2, but for item 3 I am out of luck. I hope that makes sense. Let me know if it doesn't and I would be happy to clarify further. Thank you for your help!! Kerry ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
Quoting kerryhall . (kerryh...@gmail.com): I would definitely not prefer that the vm manage the IP. What I would like to do upon new vm creation: 1. VM gets spun up with BOOTPROTO=dhcp 2. VM gets spun up with DHCP_HOSTNAME=$NAME 3. IP given to the VM by the dhcp server on my network is then the IP that is listed in sunstone for that VM. AFAIK: 1. There is no way to achieve item 1 in ONE out of the box, I have to either write a bash script that gets run on VM spin up, or create an image that does this. You don't need to make a VM contextualized to achieve that. Just configure networking in the image to DHCP. 2. I can set the _hostname_ via template, but in order to set DHCP_HOSTNAME again I have to run a bash script on spin up. Why the DHCP_HOSTNAME? If you have a pre-configured list (all MAC's statically configured in the DHCP server) it will get the correct ip-address. You can set the correct HOSTNAME based on the VM template if you want. 3. There is no way to accomplish item 3, outside of writing a bash script that runs on my head node that grabs IP data and dumps it into the database. Certainly this is not preferable. At this point you've already accomplished point 3: VM has the IP-address listed in OpenNebula. The only thing that you don't have is the VM name in the host specificiation in the DHCP config. You can however, set the hostname in the DHCP configuration (option host-name your-vm-name-here) and configure the hostname (point 2) based on this. This might even be a setting in dhclient / dhcpcd to do that automatically. Then you just have to make sure you give the VM the right IP and the right name (in Sunstone). These three items taken all together suggest that including the option to easily support DHCP out of the box would be a nice feature to have. I'm working on a bash script currently for 1 and 2, but for item 3 I am out of luck. I hope that makes sense. Let me know if it doesn't and I would be happy to clarify further. Thank you for your help!! I might completely misunderstand you, sorry if that's the case. Gr. Stefan -- | BIT BV http://www.bit.nl/Kamer van Koophandel 09090351 | GPG: 0xD14839C6 +31 318 648 688 / i...@bit.nl ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
Quoting kerryhall . (kerryh...@gmail.com): It sounds like it's not really possible for a DHCP client to suggest an IP to the DHCP server. I think I would like to make a feature request: easy DHCP integration. Does my use case make sense? I can clarify further if needed. Why do you want to manage IP's from the VM itself? If you want predictable IP's for your VM's you can use static assignments in DHCP servers. Just prefill an address range with MAC's for future VM's and you're done. Just make sure that the VM gets the right IP in ONE (and therefore the right MAC-address) and off you go. Together with MAC/ARP spoofing protection [1] you can be assured that a VM is only able to use the IP you've configured. Oh, and there already is an integration possible, see [2]. If you really want to manage the DHCP server from the VM itself there are more possibilities (discussed on this list some time ago): [3], and [4,5] including examples. Gr. Stefan [1]: http://docs.opennebula.org/4.8/administration/networking/openvswitch.html#openflow-rules [2]: http://docs.opennebula.org/4.8/administration/networking/router.html [3]: http://lists.opennebula.org/pipermail/users-opennebula.org/2014-May/044932.html [4]: http://mperedim.wordpress.com/2011/02/17/opennebula-dhcpd-contextualization-magic/ [5]: http://blog.nominet.org.uk/tech/2005/12/21/using-omapi-object-management-application-programming-interface/ -- | BIT BV http://www.bit.nl/Kamer van Koophandel 09090351 | GPG: 0xD14839C6 +31 318 648 688 / i...@bit.nl ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
Hello Kerry, I am unsure how to use a DHCP client to suggest an IP to the DHCP server, or if DHCP supports this. The DHCP client can be configured to request a specific IP address from the DHCP server [1]. [1]: http://superuser.com/questions/487607/how-to-request-a-specific-ip-address-from-dhcp-server Best, Valentin Thanks!! Kerry On Mon, Sep 8, 2014 at 1:42 AM, Javier Fontan jfon...@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 . kerryh...@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@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 ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
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 . kerryh...@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@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 ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
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 jfon...@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 . kerryh...@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@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 ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
Re: [one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
It sounds like it's not really possible for a DHCP client to suggest an IP to the DHCP server. I think I would like to make a feature request: easy DHCP integration. Does my use case make sense? I can clarify further if needed. Thanks!! On Mon, Sep 8, 2014 at 12:35 PM, kerryhall . kerryh...@gmail.com wrote: 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 jfon...@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 . kerryh...@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@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 ___ Users mailing list Users@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
[one-users] BOOTPROTO, DHCP_HOSTNAME, and vm IPs in Sunstone
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@lists.opennebula.org http://lists.opennebula.org/listinfo.cgi/users-opennebula.org