WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Quick Tip - Easily identify source DHCP server using ESXi DCUI

11.20.2020 by William Lam // 1 Comment

While installing the ESXi 7.0 Update 1 on one of my physical system, I happened to be in the "Configure Management Network" section of the ESXi Direct Console UI (DCUI) and noticed something I had never seen before. As shown in the screenshot, it now shows the IP Address of the DHCP server in which ESXi received the DHCP lease.


I had not noticed this before and after asking on Twitter, it looks like this is definitely a new enhancement that was added fairly recently. I did not see this in one of my ESXi 6.7 Update 3 deployments, but it may have came in a later patch but definitely new in ESXi 7.0 or greater. Not only is this a quick and easy way to identify the DHCP server being used but in case you need to track down an unexpected rogue DHCP server running, this will certainly come in handy as pointed out by John.

Trying to get rogue DHCP servers under control?
Remember kids, DHCP Snooping saves lives! https://t.co/FKPgKzI9In

— ⍼ John Nicholson ⍼ (@Lost_Signal) November 20, 2020

Categories // ESXi, vSphere 6.7, vSphere 7.0 Tags // dcui, dhcp

Customizing the ESXi DCUI to show number of VMs

05.24.2016 by William Lam // 7 Comments

Last week there was a question that was posted internally asking if it was possible to customize the ESXi DCUI screen to include the number of Virtual Machines? Although there is nothing out of the box, you can in fact add add almost anything to the DCUI screen by modifying the /etc/vmware/welcome configuration file which I had blogged about several years back on adding a splash of color to the ESXi DCUI. There was even a recent VMware Fling that provides a VIB that applies a variety of DoD STIG implementations, one of which was to update the DCUI screen with some specific text.

However, instead of having to manually edit the file directly on the ESXi host, we also provide an API in the way of an ESXi Advanced Setting called Annotations.WelcomeMessage which can then be updated remotely using anyone of the vSphere SDK/CLIs that you are familiar with.

Here is an example PowerCLI snippet to connect to an ESXi host (you can also do this by connecting to vCenter Server) and extracting all Virtual Machines residing on the host and then updating the DCUI screen with the total number of VMs as well as the names of each VM. Obviously, if you have more than 10 or so VMs, it may not make much sense to actually list them as it will just run off the screen, but this just gives you an example of some of the things you can do leveraging the vSphere API or any other data that you might have at your disposal.

Connect-VIServer -Server 192.168.1.50 -User root -Password vmware123

$vms = Get-View -ViewType VirtualMachine -Property Name

$DCUIString = "{color:yellow}
                {esxproduct} {esxversion}

                Hostname: {hostname}
                IP: {ip}
                
                Virtual Machines: " + $vms.Count + "
{/color}
{color:white}
"

foreach ($vm in $vms) {
    $DCUIString += "`t`t" + $vm.Name + "`n"
}

Set-VMHostAdvancedConfiguration -Name Annotations.WelcomeMessage -Value $DCUIString

Disconnect-VIServer -Confirm:$false

Note: If you wish to only filter out powered on Virtual Machines, you can add the following: -Filter @{"Runtime.PowerState" = "PoweredOn"} to the end of the Get-View command

Here is a screenshot quick screenshot of what this would look like on the DCUI screen of your ESXi host:

displaying_vms_in_esxi_dcui_1
Note: You can actually run the DCUI over SSH, which can be useful for testing purposes without having to directly login to the console remotely. Take a look at this blog post here for more details.

One final thing to be aware of when editing the welcome message on your ESXi host is that it will also be displayed in the ESXi Embedded Host Client login page as shown in the screenshot below. Just something to be aware of in case you plan to make any sensitive information available as this can be seen without needing to login to the ESXi host (just like the DCUI interface).

displaying_vms_in_esxi_dcui_2

Categories // Automation, ESXi Tags // dcui, ESXi, PowerCLI, vSphere API

vCenter Server 6.0 Tidbits Part 6: Customizing VCSA's DCUI

04.21.2015 by William Lam // Leave a Comment

For those of you who have deployed the latest VCSA 6.0, you may have noticed that it now includes a DCUI interface similar to that of ESXi. Just like ESXi, it provides some basic functionality such as network configuration, restarting of the management interface, enabling SSH/Shell access and viewing support logs. For some customers, there is a mandatory requirement in terms of compliance to be able to display a security or warning banner prior to logging into a system which can also include interactive console UI's like the DCUI.

With ESXi, it was possible to customize the DCUI as seen in the screenshot below (more serious customizations are used in customer environments of course). For more details, please take a look at this blog post here.

dcui4
Luckily, with the VCSA 6.0, it is also now possible to customize some of the text on the DCUI interface. However, you will not have complete free range like you did with the ESXi's DCUI interface but will be specific part of the screen. Here is an example of what can be added to the VCSA's DCUI screen:

customizing-vcsa-dcui
There is a section before the IP Address and a section after the IP Address which you can append custom text. This is controlled by the following configuration file located in: /etc/vmware/appliance/dcui.cfg and specifically with the following two variables: CONNECTION_MESSAGE which is the message before the IP Address and CONNECTION_MESSAGE_AFTER_IP for the message after the IP Address.

Here is an example of what the above customization looks like:

{
    "PRODUCT_NAME": "VMware vCenter Server Appliance 6.0",
    "CONNECTION_MESSAGE_BEFORE_IP": "https://",
    "CONNECTION_PORT": "443",
    "CONNECTION_MESSAGE": "\n\t### Message BEFORE IP ###\n",
    "CONNECTION_MESSAGE_AFTER_IP": "\n\n\t### Message AFTER IP ###\n"
}

For the changes to take affect, you will need to reload the DCUI interface which you can do by running the following command:

kill $(ps -ef | grep dcui.py | grep -v grep | awk '{print $2}')

  • vCenter Server 6.0 Tidbits Part 1: What install & deployment parameters did I use?
  • vCenter Server 6.0 Tidbits Part 2: What is my SSO Domain Name & Site Name?
  • vCenter Server 6.0 Tidbits Part 3: Finding all deployed Platform Services Controller
  • vCenter Server 6.0 Tidbits Part 4: Finding all deployed vCenter Servers
  • vCenter Server 6.0 Tidbits Part 5: New method of patching the VCSA
  • vCenter Server 6.0 Tidbits Part 6: Customizing VCSA’s DCUI
  • vCenter Server 6.0 Tidbits Part 7: Connecting to SSO/PSC using JExplorer
  • vCenter Server 6.0 Tidbits Part 8: Useful ldapsearch queries for vmdird
  • vCenter Server 6.0 Tidbits Part 9: Creating & managing SSO users using dir-cli
  • vCenter Server 6.0 Tidbits Part 10: Automating SSO Admin configurations
  • vCenter Server 6.0 Tidbits Part 11: Automate SSO Admin password change
  • vCenter Server 6.0 Tidbits Part 12: New methods of downloading Support Bundles for VCSA / PSC

Categories // ESXi, Security, VCSA, vSphere 6.0 Tags // dcui, vcenter server appliance, VCSA, vcva

  • 1
  • 2
  • 3
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...