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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 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:



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).