Life is a journey, not a race!

enjoy the journey

Changing the hostname of an ESX or ESXi host

 

 

before I start, there is Important notes you have take care:

 

-If the management network of the ESX/ESXi host is on a vSphere Distributed Switch, migrate the network to a vSphere Standard Switch before proceeding.

 

-If the ESX/ESXi host is a part of a VSA cluster, do not remove the host from inventory.

 

-If ESXi host is a part of a vSAN cluster, the node in maintenance mode may still be primary or backup node in vSAN cluster, and you must manually drag the ESXi host out of the cluster to remove it from the cluster.

 

 

then start directly to change name like:

 

 

 

  1. If the ESX host is part of a cluster, drag it out of the cluster to remove it from the cluster.
  2. If the ESX host is managed by VirtualCenter/vCenter, disconnect and remove the ESX host from the vCenter.
  3. Make the modifications in your DNS environment to reflect the correct name and IP association for the new name.
  4. Log in as root to the console of ESX host.
  5. Using a text editor, change the name and domain name, if applicable, of the host in these files:
     

/etc/hosts

/etc/sysconfig/network
 

Run this command:

esxcfg-advcfg -s ESXi_FQDN /Misc/hostname

where ESXi_FQDN is the new FQDN hostname for the ESX host.

Reboot the ESX host.

Join the ESX host to VirtualCenter/vCenter Server and clusters.

 

 

or 

 

 

  1. If the ESXi host is part of a cluster, first enter the Maintenance mode to remove it from the cluster.
  2. If the ESXi host is managed by VirtualCenter/vCenter Server, disconnect and remove the ESXi host from the vCenter Server.
  3. Connect to the host directly with a vSphere Client.
  4. Click ESXi host.
  5. Click the Configuration tab.
  6. Click DNS and Routing.
  7. Click Properties.
  8. In the DNS Configuration tab, edit the Name field. Change anything else that is necessary in your environment.
  9. Click OK.
  10. Join the ESX host to VirtualCenter/vCenter Server and clusters.

 

 

or 

 

 

  1. If the ESXi host is part of a cluster, first enter the Maintenance mode to remove it from the cluster.
  2. If the ESXi host is managed by VirtualCenter/vCenter Server, disconnect and remove the ESXi host from the vCenter Server.
  3. Connect to the host directly with a vSphere Client and select the ESXi host
  4. Select Configure - TCP/IP configuration
  5. Select the Default TCP/IP Stack, and then click the Edit button
  6. Set hostname and Domain Click OK.
  7. Join the ESX host to VirtualCenter/vCenter Server and clusters

 

or 

 

  1. If the ESXi host is part of a cluster, first enter the Maintenance mode to remove it from the cluster.
  2. If the ESXi host is managed by VirtualCenter/vCenter Server, disconnect and remove the ESXi host from the vCenter Server.
  3. Connect to the ESXi Shell  please see Using ESXi Shell in ESXi 5.x, 6.x and 7.x
  4. Run the below command, the switch host would be used IP and the switch for fully qualified domain name (FQDN).:

       esxcli system hostname set --host=hostname
       esxcli system hostname set --fqdn=fqdn

   5. 
Join the ESX host to VirtualCenter/vCenter Server and clusters

 

 

enjoy it!

Hadi

 

 

vExpert Badge