Add Host to vCenter Fails With 'The name "hostname" already exists.'

Recently a colleague had an issue where they were unable to add a newly built ESXi 4.1 server to vCenter; it failed with the message ‘The name “hostname” already exists.’ However, at first glance in vCenter the hostname didn’t exist.

The vCenter vpxd log contained more info, an error below:

Found host with duplicate IP x.x.x.x: host-xxxxx

You can track down the hostname from the host-xxxxx info with PowerCLI


Get-VMHost | Where-Object {$\_.id -eq 'HostSystem-host-xxxxx'} | Format-Table Name,ID

Once you have the hostname, track it down in the Host table in the vCenter database and examine the IP address recorded. In this case the IP address in the database did not match the IP address of the Management Network of the ESXi host in vCenter.

Turned out the host had been built from a DHCP address, given a static IP after being taken to a remote site, but not removed from vCenter before the IP change. Removing the host from vCenter and adding back in resolved the issue.