Changing IP Address of VMware ESX Host
I’ve come into many occasions where I needed to change the IP address of an ESX server. In one ocassion there was tiering a network so the servers were on a different network from the workstations, and in another it was moving the ESX server to a test network where it could not touch the network where it came from. So on both ocassions I spent time talking with VMware Support to help me resolve the issue, and the instructions that they have given me were very simple and straight forward. I wanted to post an entry where I went over those steps, becuase I know I can’t be the only one running into this situation (and constantly forgetting). All you will need to do this is either physical access to the server or SSH access. Note: Because of the changing of the IP address, I suggest you physically be at the server if at all possible.
If your server is ESX 3.X or 4.0 Follow These Steps:
- Log in as root to the ESX host (either using the server or a SSH connection)
- type: service network stop
- Run “esxcfg-vswif” command to change the IP of the hosts:esxcfg-vswif -i NEW_IP_ADDRESS -n MASK_ADDRESS vswif0
- Edit the /etc/sysconfig/network file and change the gateway IP if needed.
- Run the following command to restart the network:service network start
- Add the host back to VirtualCenter using it’s name or by its IP Address.
- Reconnect host to VirtualCenter so you can manage it again with Virtual Center.
Depending on your set up, you may have a virtual center to connect it to, if you don’t you’ll need to get one set up so you can connect the license to the ESX host. Remeber as always make sure you have enough proper licensing to do this and that you are still in proper use of VMware’s licensing.