[one-users] Find the VM IP in the DHCP setup

Javier Fontan jfontan at fdi.ucm.es
Mon Aug 24 11:35:57 PDT 2009


Hello,

The DHCP configuration is basically a long list of mac addresses
matching its IP the way Ruben had explained. It would be much better
to have some kind of DHCP Server - OpenNebula communication so it asks
for IPs as needed but unfortunately I have not found any DHCP Server
that lets you do this (like executing a script that gives the IP). The
perfect solution would be to create an ad hoc DHCP Server but I think
it is out of the project scope (or at least we have other features to
polish or add before addressing it).

Anyway, you can try to create a DHCP configuration that has some mac
addresses to ip correlation to try it out. As soon as I have the
script that generates those lines from an already defined VNet I'll
upload it to the web page.

Bye

On Mon, Aug 24, 2009 at 2:02 AM, Shi Jin<jinzishuai at yahoo.com> wrote:
> Dear Ruben,
>
> I am now ready to try the DHCP server hook up you mentioned earlier.
> Could you please provide some extra information as to how to start with?
> For example, where do I find the code in the svn trunk?
> One thing I am wondering is that is there a way to avoid putting the repeating lines in the dhcp-server configuration files for the IP assignment but to simply specify a MAC-IP rule in it?
>
> Thanks.
> Shi
> --
> Shi Jin, PhD
>
>
> --- On Thu, 6/4/09, Ruben S. Montero <rubensm at dacya.ucm.es> wrote:
>
>> From: Ruben S. Montero <rubensm at dacya.ucm.es>
>> Subject: Re: [one-users] Find the VM IP in the DHCP setup
>> To: "Shi Jin" <jinzishuai at yahoo.com>
>> Cc: users at lists.opennebula.org
>> Date: Thursday, June 4, 2009, 12:17 PM
>> Hi,
>>
>> There are two options:
>>
>> * As you said you can still use the onevnet just to
>> generate the MAC
>> address in a predictable and easy-to-find way. In this
>> case, as you
>> suggest you can use onevm show to get the MAC address.
>>
>> Then, you can easily pre-configure your DHCP server so to
>> give the MAC
>> address generated with OpenNebula for your networks.
>>
>> With your example: ADDRESS = 192.168.1.0 (Please use class
>> C networks)
>> the MAC address are generated in this way:
>> MAC = 00:03:c0:a8:01:01, IP = 192.168.1.1
>> MAC = 00:03:c0:a8:01:02, IP = 192.168.1.2
>> MAC = 00:03:c0:a8:01:03, IP = 192.168.1.3
>> MAC = 00:03:c0:a8:01:04, IP = 192.168.1.4
>> ...
>> MAC = 00:03:c0:a8:01:FE, IP = 192.168.1.254
>>
>> (note that c0:a8:01 == 192.168.1, so you can derive one
>> from the other)
>>
>> If you put that assignments in your DHCP server you are
>> done. (And yes
>> this should be more dynamic, see below...)
>>
>> * You can not set the MAC and let the hypervisor pick one
>> and modify
>> the monitoring scripts to push the MAC in the OpenNebula
>> system; and
>> then get it though onevm show. However if you have a
>> cluster, you have
>> to make sure that the hypervisors are going to generate
>> different MAC
>> address so they do not collide.
>>
>> I strongly recommend you the first one. In particular with
>> the new
>> features in the upcoming OpenNebula release (hopefully by
>> the end of
>> the month), that will allow you to:
>>
>> * Hook in VM creation to add the DHCP entries as the VMs
>> are created
>> * Hook in VM start-up to execute a custom script to isolate
>> the
>> traffic from different networks (at layer 2)
>>
>> We will provide a sample scripts to do this. This
>> functionality is
>> already in trunk if you want to give it a try let us know
>> and we will
>> send you the sample script along with some hints (the
>> documentation
>> for this is not ready yet :(
>>
>> Cheers!
>>
>> Ruben
>>
>> On Wed, Jun 3, 2009 at 6:14 PM, Shi Jin <jinzishuai at yahoo.com>
>> wrote:
>> >
>> > Hi there,
>> >
>> > I am trying to deploy multiple Windows VM using Open
>> Nebula and am successful with it. However, I am troubled at
>> finding out the IP address the Windows VM is using. Of
>> course, I can use virt-mananager or VNC to directly login to
>> the box from the physical node and find out manually.
>> However, I want something more automatic.
>> >
>> > I know there are two ways to setup network in Open
>> Nebula, DHCP and OneVNET. The OneVNET approach requires
>> running a script on the Linux VM, which is not possible for
>> my Windows box and I wouldn't want to impose the user any
>> restrictions in terms of setup their box. So I prefer the
>> DHCP approach.  With control of the DHCP server, in
>> principal I should be able to tell the IP address for any VM
>> given its MAC address. My understanding is that the MAC
>> address is generated randomly in the creation of a VM. It
>> would be nice if command of "onevm show <id>" is able
>> show the MAC address of the NIC.  This is true in the
>> OneVNET scenario but the IP shown is not relevant for me.
>> >
>> > For example, I can setup a VNET with
>> > NAME            = "LAN"
>> > TYPE            = RANGED
>> > BRIDGE          = br0
>> > NETWORK_SIZE    = 32
>> > NETWORK_ADDRESS = 192.168.1.210
>> > And use the template of
>> > NIC = [bridge ="br0",
>> >       network = "LAN"
>> >       ]
>> > This one onevm show will yield something like
>> >    NAME            : winxp
>> >    NIC             :
>> BRIDGE=br0,IP=192.168.1.193,MAC=00:03:c0:a8:01:c1,NETWORK=LAN,VNID=7
>> >
>> > However, the IP does not make sense at all. Instead
>> the dhcp client on WinXp gets an IP of 192.168.1.130.  But
>> I can discard this IP information and check the DHCP server
>> with the MAC address since it is indeed the same MAC address
>> found inside the WinXP VM.
>> >
>> > So my question is that without creating OneVNET (since
>> it is not used at all here), is there a way to show the MAC
>> address of the VM? This should be possible since from the
>> physical node either virt-manager or virsh can tell me that
>> (for example, in the dumped xml file).
>> >
>> > Thank you very much.
>> >
>> > --
>> > Shi Jin, PhD
>> >
>> >
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opennebula.org
>> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>> >
>>
>>
>>
>> --
>> +---------------------------------------------------------------+
>>  Dr. Ruben Santiago Montero
>>  Associate Professor
>>  Distributed System Architecture Group (http://dsa-research.org)
>>
>>  URL:    http://dsa-research.org/doku.php?id=people:ruben
>>  Weblog: http://blog.dsa-research.org/?author=7
>>
>>  GridWay, http://www.gridway.org
>>  OpenNebula, http://www.opennebula.org
>> +---------------------------------------------------------------+
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Javier Fontan, Grid & Virtualization Technology Engineer/Researcher
DSA Research Group: http://dsa-research.org
Globus GridWay Metascheduler: http://www.GridWay.org
OpenNebula Virtual Infrastructure Engine: http://www.OpenNebula.org


More information about the Users mailing list