VirtualBacon

Changing the IP address of vCenter Server

Note that this article applies to the Windows version of vCenter server. I have not tested with the vCenter vAppliance.

Just this week I had to move my vCenter server to a different subnet which meant that I had to change the IP address of the server. I also had to move my ESXi hosts at two different sites to new subnets as well. I started off with the hosts which was pretty simple using the DCUI, but things were different when it came to moving the vCenter server. If you've done this before you've probably experienced something similar to the following:

1. Change the IP address of the Windows OS hosting vCenter Server.

2. Watch your vSphere hosts come and go from vCenter. ie. hosts disconnect, you right-click the hosts and select connect, watch host disconnect, repeat.

Not fun. In my case the VMs were not impacted, but I found myself switching the vCenter server IP back to the old one to resolve the issue.

 

Looking into this a little more I found the following article on the VMware Knowledgebase entitled "vCenter Server IP address change causes ESX hosts to disconnect". The article did not work for me exactly as written, but it was close and did point me in the right direction.

 

What worked for me was the following:

1. Add an additional NIC with the new IP to the Windows Server hosting vCenter Server. Place the default gateway on this new interface, remove it form the old one, and add routes to the vSphere host subnets on the interface with the old IP.

2. Connect to vCenter using the vCenter client using the new IP address.

3. From the Administration menu click VirtualCenter Management Server Configuration, click on Runtime Settings, change the vCenter Server Managed IP Address to the new IP address. If you do not do this my experience is that the IP address in this field will be pushed back to the vSphere hosts.

3. For ESXi5 (which is what I use) edit the file /etc/vmware/vpxa/vpxa.cfg, scroll down near the bottom, and change the IP address to the new IP.

4. Once this is done restart the management agents on the host (See KB article "Restarting the Management agents on an ESX or ESXi Server" if needed).

5. Repeat this procedure for each host.

6. When you're all done remove the added routes to the vSphere hosts from the interface with the old IP address.

7. Remove the NIC with the old IP address from the OS.

This whole process may be scriptable using Powershell, but being a PoSH newbie and short on time this is the procedure that I used. It was tedious but I was done within an hour or so.

Before you start make sure to check for any routing changes, new firewall rules that may be required, and so on. I had that ironed out before I started which helped me avoid potential network connectivity issues.

The next step will be to reconfigure the plugins, such as Update Manager, Syslog, Network Core Dump, Autodeploy, etc. Each plugin has an xml file referencing the old IP address. I need to track them all down and change them to the new IP address. For some of these it may not be that simple if this KB article entitled "Changing the vCenter Update Manager IP address and preserving the Update Manager setup" and this KB article entitled "Reconfiguring Update Manager after changing the vCenter Server IP address" are any indication. Hopefully I'll remember to post an update or new post to either confirm that the KB articles solve this new issue, or what I had to do to get them working properly again.

[amazon asin=0470890800&template=iframe image&chan=default]

Website Security Test