I'd like to change a host's display name in vSphere. right now it's displaying the wrong name and I'd like to correct it.
Just to be clear, I'm not talking about changing the hostname/FQDN,
Below blog answers your question:
Also there is VMware KB article for the same :VMware KB: Changing the name of an ESX or ESXi host
If you need script to do the same : Refer: Virtuin: Rename ESXi Hosts in vCenter (Without Losing Historical Data)
Unfortunately, this is not exactly what I'm looking for, though it did help 🙂
The hostname/dns/fqdn are correct - it's the display name that shows up in vSphere inventory that is incorrect.
For example: esxcli system hostname get gives me the correct information. When I use the vsphere client (web/desktop) the host display name is different 😕 and I can't find a way to change it.
I didn't set up this system and I think someone mixed up 2 hosts names when adding the hosts to vCenter/vSphere.
turns out vCenter gives priority to DNS A record over hostname in /etc/hosts
once I changed the A record I had to remove the host from vCenter and then re-add with the new name
You don't need to shutdown anything, do you?
In the period while the host isn't in the vCenter,
it continues operating, and
its VMs could be managed from the host's own web interface.
You can remove it from the inventory with VMs running only if you don't have a distributed service (NSX, vSAN, vSphere Distributed Switch, etc)
If the host is using vSphere Standard Switch it wouldn't be an issue.
I would recommend placing it in maintenance mode and evacuating all its VMs before removing it from inventory, just to be sure.
Edit: I just checked, you can't remove a host from inventory without putting it in maintenance mode first.