VMware Cloud Community
ctucci
Enthusiast
Enthusiast
Jump to solution

How do I change hostnames of hosts in vCenter for a 2-node vSAN Cluster?

I am creating a Windows AD setup and joined my 2-node vSAN hosts into the domain as well as vCenter, now I want to re-name the hostnames in vCenter for these two hosts in the vSAN cluster from their old hostnames to the new ones.

I am able to change the hostname and domain name/search domain via TCP/IP stack on the hosts but vCenter of course still has the hosts added with old domain name. How do I essentially edit the hostname that vCenter uses to access and work with these hosts?

Cheers,

Chris

1 Solution

Accepted Solutions
ctucci
Enthusiast
Enthusiast
Jump to solution

I had found this KB article before posting (https://kb.vmware.com/s/article/1010821)​ but it didn't fully address if it would work okay for 2-node vSAN and witness appliance so I didn't try it. But, decided to just go for it the other day and it mostly worked. It does involve removing the host from the vSAN cluster, changing management to a standard vSwitch, then removing the host from vCenter, making the hostname changes, re-adding to vCenter as new host and re-adding to the cluster/dVS, changing management back to dVS. vSAN easily detected the existing vSAN VMs and storage even though the hostname changed and it did a quick re-sync and all was fine, however, re-adding the host with new hostname did for some reason remove vmk3 which was my witness vmkernel. It completely got rid of it, so I am guessing its a bug... but took 2 minutes to add vmk3 again, IP it, and re-tag for witness traffic that way host could communicate with witness appliance.

Of course, I did this one host at a time so vSAN stayed up with the other host and witness and I had no down time.

Where the above steps did NOT work was changing the witness appliance hostname. I followed the same exact steps since I figured the witness appliance is just another host to vCenter/vSAN like the other real nodes but it completely messed up the witness link with vSAN. I was able to re-add the witness host (appliance) to vCenter with new hostname but vSAN freaked out and said the witness host was missing from inventory (which is true since it still was looking for old hostname). Problem is, when vSAN is in this mode, it won't let you change or remove the witness. So, I changed the witness host back to original hostname so it was detected again, then had to disable stretched cluster, which removes the witness. Even after that, re-naming the witness again didn't let me select it as new witness when I went to enable stretched cluster again (I guess because it detects it was previously used?) so I had to deploy a whole new witness appliance, which only took 10 minutes. Choose that new witness as witness for cluster, it spent 5 minutes re-syncing objects and everything was back to normal.

Overall, the process was easy once I figured out the above, and worked well, with no downtime to VMs or vSAN storage. Hope this helps someone in the future.

View solution in original post

6 Replies
Deso1ator
Enthusiast
Enthusiast
Jump to solution

I am not sure if this is possible with a vSAN host. A host can be renamed in vCenter by removing, disconnecting, and then adding it back with it's new name. However, I am not sure since this is a vSAN host with only two hosts in the cluster.

Reply
0 Kudos
ctucci
Enthusiast
Enthusiast
Jump to solution

I had found this KB article before posting (https://kb.vmware.com/s/article/1010821)​ but it didn't fully address if it would work okay for 2-node vSAN and witness appliance so I didn't try it. But, decided to just go for it the other day and it mostly worked. It does involve removing the host from the vSAN cluster, changing management to a standard vSwitch, then removing the host from vCenter, making the hostname changes, re-adding to vCenter as new host and re-adding to the cluster/dVS, changing management back to dVS. vSAN easily detected the existing vSAN VMs and storage even though the hostname changed and it did a quick re-sync and all was fine, however, re-adding the host with new hostname did for some reason remove vmk3 which was my witness vmkernel. It completely got rid of it, so I am guessing its a bug... but took 2 minutes to add vmk3 again, IP it, and re-tag for witness traffic that way host could communicate with witness appliance.

Of course, I did this one host at a time so vSAN stayed up with the other host and witness and I had no down time.

Where the above steps did NOT work was changing the witness appliance hostname. I followed the same exact steps since I figured the witness appliance is just another host to vCenter/vSAN like the other real nodes but it completely messed up the witness link with vSAN. I was able to re-add the witness host (appliance) to vCenter with new hostname but vSAN freaked out and said the witness host was missing from inventory (which is true since it still was looking for old hostname). Problem is, when vSAN is in this mode, it won't let you change or remove the witness. So, I changed the witness host back to original hostname so it was detected again, then had to disable stretched cluster, which removes the witness. Even after that, re-naming the witness again didn't let me select it as new witness when I went to enable stretched cluster again (I guess because it detects it was previously used?) so I had to deploy a whole new witness appliance, which only took 10 minutes. Choose that new witness as witness for cluster, it spent 5 minutes re-syncing objects and everything was back to normal.

Overall, the process was easy once I figured out the above, and worked well, with no downtime to VMs or vSAN storage. Hope this helps someone in the future.

Deso1ator
Enthusiast
Enthusiast
Jump to solution

Glad to here you figured it out. I have a question for you. Did you move everything else off of the vDS or only management?

Reply
0 Kudos
ctucci
Enthusiast
Enthusiast
Jump to solution

Only management, but part of the steps above involves putting host into maintenance mode before removing from cluster so the VMs migrated off the host anyway to stay working on the vDS. When the host was added back to vCenter under new hostname, it had to be re-added to the vDS for the other port groups that I did not migrate off prior to removing. I'm assuming if I left VMs running on the host while removing and re-adding after name change, the VMs on the vDS would loose connectivity, but management would not since it went to standard switch.

Reply
0 Kudos
Deso1ator
Enthusiast
Enthusiast
Jump to solution

Gotcha. I see now. Thanks.

Reply
0 Kudos
bluegill72
Contributor
Contributor
Jump to solution

Use the following commands to check the witness status and remove the witness host appliance from vsan.

esxcli vsan cluster get

esxcli vsan cluster remove

Once removed, you can change the witness host from the configure, vsan, fault domains screen in vcenter

Reply
0 Kudos