I was trying to configure a two node hadoop cluster using ubuntu virtual machines created using VMWare Player [Running on Windows]. The setup worked fine in the beginning, but whenever the network adapter restarted [after VM resume/restart] it used to get a new IP address.

This causes multiple issues, those faced by me were specific to hadoop but any system that requires IP addresses to be entered in some sort of configuration will have to be reconfigured with new IP address each time they change.

Assigning static IP address to each VM is a solution, but I find it a bit time consuming method.There is an easier alternative, that can be done at only one place for all the VMs

VMware networking services running on the host system has a DHCP server, which is responsible for assigning IP addresses to guest machines. When guests are configured to obtain IP address automatically this service assigns them an unused IP from the pool.

Configuration for the DHCP server is maintained in  following file :
 C:\Documents and Settings\All Users\Application Data\VMware\vmnetdhcp.conf

Add one entry for each VM that needs to be given a fix IP address.

host ubuntu {
    hardware ethernet 00:0c:29:c0:2c:58;
    fixed-address 192.168.118.3;


here host [ubuntu] is generally the name of .vmx file of your VM.
hardware ethernet can be found inside .vmx file as value of property "ethernet0.generatedAddress"
fixed-address is the IP address you wish to assign to your VM
 
Once you have entered information for all the nodes, VMWare DHCP service needs to be restarted.
If there are errors in your configuration, service will stop right after the restart. 

Restart networking service on you guest VMs and your VM should get the desired IP address.

If you are finding it difficult to locate correct host and "hardware ethernet" open file vmnetdhcp.leasesX located at "C:\Documents and Settings\All Users\Application Data\VMware\". 
A typical entry looks like this , there will be multiple such entries in the file

lease 192.168.118.142 {
    starts 3 2013/04/24 08:26:35;
    ends 3 2013/04/24 08:56:35;
    hardware ethernet 00:0c:29:c0:2c:58;
    client-hostname "ubuntu";
}


Go back to your VM and check which IP addresses is currently assigned to it. You can easily join this information to get all required parameters.

©2013 Abhijeet Apsunde LinkedIn

4

View comments

Blog Archive
About Me
About Me
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.