VirtualBacon

Changing the IP address of vCenter Server

Posted on February 27, 2012

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]

Posted by Peter

Comments (0) Trackbacks (0)
  1. Sorry – my previous comment was incomplete…
    I have a simpler solution that worked rather well:
    1. Change the management IP address in the vCenter itself: Administration \ vServer Settings \ Runtime Settings: make it the new IP address you’re expecting after the move
    2. Wait for the settings to propagate to your hosts – you’ll know it’s working when the hosts start disappearing from vCenter
    3. If they don’t, restart the management agents on the hosts:
    – ssh to the host
    – restart hostsd and vpxd
    – You can monitor /etc/vmware/vpx.conf for the change in management IP
    4. Once all hosts are offline in vcenter, shutdown the VC, move it to whatever network and re-IP the VC with the management IP.
    5. Restart the VC

    Once the VC is back online, your hosts will automatically have the correct details and connect to VC

    Asaf

  2. I have a simpler solution that worked rather well:
    1. Change the management IP address in the vCenter itself: Administration \ vServer Settings \ Runtime Settings
    2. Wait for the settings to propagate to your hosts – you’ll know it’s working when the hosts start disappearing from vCenter
    3. If they don’t, restart the management agents on the hosts:

    Asaf

  3. Hi Pedro,

    You simply add the route the way you would any other route, but reference the IP address of the old interface. So if the new vCenter server IP is 10.0.2.10 for example, and the old vCenter server IP is 10.0.1.0, and the ESXi hosts are on 10.0.1.0/24, then add a route to 10.0.1.0 255.255.255.0 with a gateway of 10.0.1.10 . This is necessary since you change the default gateway to the new network interface and remove it from the old one. Keep in mind that this was necessary on my configuration as one subnet was behind a firewall and asymmetric was an issue. For syntax to modify the route table Technet is a pretty good reference.

  4. HI, I´m going to make the change in my VC ( 5.1) but the first point you said: add routes to the new subnets with the old interface, and I know how to do it with the “route add” command, but, how do you make it with the old interface??

    regards!


Trackbacks are disabled.

Website Security Test