The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,778 other followers

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 [WayBackvSphere HTML5 Web Client Fling – VMware vSphere Blog which by now is named [WayBackvSphere 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:

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 [WayBackChanging 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:

  1. Attach and logon to a host
  2. Select the Configuration tab
  3. Select DNS and Routing under Software
  4. Click on the Properties... in the top right
  5. In the dialog, edit the value for Name for hostname (and maybe Domain for domainname)
  6. Press the OK button to close the dialog

From the  vSphere HTML5 Web Client

This works on ESXi 6.5 and up:

  1. Attach and logon to the host
  2. From the Navigator on the left, choose the Networking entry
  3. On the top, choose the TCP/IP stacks tab
  4. In the Name column, choose the Default TCP/IP Stack entry
  5. Click the Actions button, then the Edit Settings option
  6. Choose the entry Manually configure the settings for this TCP/IP stack
  7. Configure the values Host name (and maybe Domain name)
  8. 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 [WayBackConfigure 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 [WayBackManual:IP/DHCP Server – DHCP Options – MikroTik Wiki.

So I added this option in the Winbox GUI:


Note you need single quotes around the ESXi-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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: