ESXi 6.5: change the host name in the “new” vSphere HTML5 Web Client, or using DHCP option 12
Posted by jpluimers on 2019/03/06
With the removal of the C# based Windows vSphere Client in ESXi 6.5, the vSphere HTML5 Web Client is the way to go.
It doesn’t cover all functionality yet, and some functionality is in different places in the UI, so below the steps to change the hostname.
Since I prefer a central location of name and address management, I’ve also documented on how to do this with DHCP option 12.
Oh: I’m not alone in finding the changed place
Before I begin, some background reading on DHCP Options as I plan to do more with that in the future:
A bit of history
The HTML5 client started a long time ago as [WayBack] vSphere HTML5 Web Client Fling – VMware vSphere Blog which by now is named [WayBack] vSphere HTML5 Web Client and continues to be available as a separate OVA outside of the ESXi release cycle:
“We will continue delivering this Fling on a regular basis even with the released supported version of the vSphere Client, so we hope that most of you will continue to use the Fling and update it weekly so that we can get your feedback about our direction.”
I like the new direction as it’s way more portable than both the Windows only C# vSphere Client and the other web client which is still there but based on Flash.
Some of the historic links:
- [WayBack] Goodbye vSphere Client for Windows (C#) – Hello HTML5 – VMware vSphere Blog
- [WayBack] Download URLs for VMware vSphere Client (2089791) | VMware KB
This article provides vSphere Client download URLs. Note: The vSphere Client is no longer available starting with vSphere 6.5.- [WayBack] In VMware vSphere 6.5, missing functions in speedy HTML5 Web UI leaves us saddled with vSphere Web Client (Flash), C# Client still connects to hosts, but not to vSphere | TinkerTry IT @ Home
Note the trick there to use the Windows vSphere Client 6.0.0.2 to connect to ESXi 6.5 fails on my ESXi 6.5.0update1 installation:
Change the hostname
Note: if you have a cluster, remove the ESXi machine from it first!
From the console
This is easy, as explained by [WayBack] Changing the name of an ESX or ESXi host (1010821) | VMware KB:
esxcli system hostname get # verify existing name and domain
esxcli system hostname set --host=hostname
esxcli system hostname set --fqdn=domainname
From the Windows vSphereClient
This has been working until ESXi 6.0; these are the steps:
- Attach and logon to a host
- Select the
Configuration
tab - Select
DNS and Routing
underSoftware
- Click on the
Properties...
in the top right - In the dialog, edit the value for
Name
forhostname
(and maybeDomain
fordomainname
) - Press the
OK
button to close the dialog
From the vSphere HTML5 Web Client
This works on ESXi 6.5 and up:
- Attach and logon to the host
- From the
Navigator
on the left, choose theNetworking
entry - On the top, choose the
TCP/IP stacks
tab - In the
Name
column, choose theDefault TCP/IP Stack
entry - Click the
Actions
button, then theEdit Settings
option - Choose the entry
Manually configure the settings for this TCP/IP stack
- Configure the values
Host name
(and maybeDomain name
) - Press the
Save
button
Note you can shortcut steps 1-4 by going to this URL on your ESXi host: https://192.168.71.91/ui/#/host/networking/netstacks/defaultTcpipStack (just replace the IP address): one of the big benefits of this kind of web-interface is bookmarkable URLs.
Through DHCP
I didn’t realise you could this until I read [WayBack] Configure hostname via DHCP – Ingmar Verheij, and remembered I did a similar thing to be able to configure DHCP at all for my APC managed power distribution units: APC 7xxx models, DHCP Option 43 and Mikrotik DHCP servers.
If your router supports DHCP Option 12, then you can configure it to return the hostname based on the MAC address of the management network interface at the ESXi host.
In addition, you can do the same for your domain name using DHCP option 15:
Sometimes makes sense, for instance if you have more fixed DHCP leases, or if you use your DHCP server as a central place to configure IP addresses.
In my case, this goes through [WayBack] Manual:IP/DHCP Server – DHCP Options – MikroTik Wiki.
So I added this option in the Winbox GUI:
Note you need single quotes around theESXi-X10SRH-CF
as otherwise you get the “Unknown data type! (6)” error (you get the same error when using double quotes"ESXi-X10SRH-CF"
):
Then I added that option to the static DHCP entry for the MAC address
Now it was just waiting for the lease to refresh, then the ESXi server like magic changes its name at https://192.168.71.91/ui/#/host/networking/netstacks/defaultTcpipStack
I could have done the Mikrotik shell as well:
/ip dhcp-server option
add code=12 name=Option-X10SRH-CF value="'ESXi-X10SRH-CF'"
/ip dhcp-server lease
add address=192.168.71.91 client-id=1:c:c4:7a:aa:97:42 comment=\
"SuperMicro X10SRH-CF - LAN1" dhcp-option=Option-X10SRH-CF mac-address=\
0C:C4:7A:AA:97:42 server=dhcp_lan
–jeroen
Leave a Reply