Computer Tips and Tricks
Get the latest posts via rss

Wednesday, 19 May 2010

Changing the IP Settings and Hostname of an ESX VSphere Console

For all beginner ESX VSphere Administrator newbies:

Changing the IP for the Service Console must be done from the physical console or through a remote console session. If you make changes through a network connection such as SSH, network connectivity to the Service Console disconnects because the Service Console's network interface changes.

To set an IP address:

First logon to the ESX Console

Use the command ifconfig to view current IP Settings.

To set an IP Address and Subnet Mask use:

[root@server root]# esxcfg-vswif -i -n vswif0, where -i is the IP address and -n is the subnet mask.

Note: In this example, vswif0 is the Service Console adapter that is the interface to which you are applying the IP address change.

Once set, you can again use ifconfig check the settings.

Now you need to check that the /etc/hosts file is up to date with the new settings. I found on VSphere this was done automatically. Use VI text editor to view and if needed, to modify it so that it reflects the correct IP address and hostname.

Use: vi /etc/hosts
Pressing i will allow you to edit the file
esc :q will let you quit the editor without saving
esc :wq will quit and save the changes

Now that the IP Address is correct you will need to change the default gateway

To change the default gateway address and if need be the Hostname, edit the /etc/sysconfig/network file in the VI editor and change the GATEWAY and HOSTNAME parameters to the proper values.

Use: vi /etc/sysconfig/network

Pressing i will allow you to edit the file
esc :q will let you quit the editor without saving
esc :wq will quit and save the changes

For the changes to take place, reboot the host or restart the network service with the command:

[root@server root]# service network restart

Note: This command breaks any current network connections to the Service Console.

Should you need to view/check or change the DNS settings the file to view/edit is:

vi /etc/resolv.conf

NOTE: you can use NANO instead of vi, this is another more simpler linux text editor.

Changing the hostname without rebooting

To dynamically change the hostname, run the command:

[root@server root]# hostname newname

Note: This command creates a temporary hostname change. This change is lost when the system is rebooted.

Changing settings in VMware Infrastructure Client

To change the hostname, domain, DNS servers, and default gateway in VMware Infrastructure (VI) Client:

Highlight the ESX host and click the Configuration tab.

Click DNS and Routing.

Click Properties.

To change the hostname, domain, and DNS servers, click the DNS Configuration tab and enter the appropriate values.

Note: Disable VMware High Availability if you do not want virtual machines to failover during the hostname IP change.

Don't forget to change your static entries in DNS and if used, Global Names.

Further Information


Post a Comment