• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

virtuallyGhetto

  • About
  • Privacy
  • VMware Cloud
  • Home Lab
  • Nested Virtualization
  • Automation
    • VMware Kickstart
    • VMware API/SDK/CLI
    • VMware vMA/VIMA
    • VMware OVF / OVFTOOL
  • Apple Mac
  • VCSA
  • VSAN

dcui

Quick Tip – Easily identify source DHCP server using ESXi DCUI

11/20/2020 by William Lam Leave a 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

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: ESXi, vSphere 6.7, vSphere 7.0 Tagged With: 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.

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:

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

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: Automation, ESXi Tagged With: 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:

1
2
3
4
5
6
7
{
    "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
Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: ESXi, Security, VCSA, vSphere 6.0 Tagged With: dcui, vcenter server appliance, vcsa, vcva

How to restart the ESXi management network via command-line?

01/28/2014 by William Lam 11 Comments

A great question that was brought up on Twitter yesterday by Andreas Peetz who asked the following:

Is there a way to restart the mgmt network in ESXi via a cmd line? You can do this from the DCUI, but I want a script! 

There are a variety of reasons why you would want to restart the Management Network on your ESXi host and usually it is related to troubleshooting or configurations such as renewing the DHCP lease on a particular VMkernel interface. For Andreas, it was renewing the DHCP lease and this is actually a use case I have heard from others before. Currently, the only way to restart the Management Network for your ESXi host is using the DCUI (Direct Console User Interface) either through the console using iLO/iDRAC/etc. or remotely over SSH.

Andreas' question is not a new one and I have heard this ask in the past. I have even inquired about it when I was a customer but was told it was not possible and had to use the DCUI. I was not really satisfied with the answer I provided to Andreas, so I decided to do a bit of digging myself and ping some engineers. Apparently this functionality is actually exposed through a legacy command-line utility called esxcfg-vmknic in the ESXi Shell as well as locally/remotely via the ESXCLI network namespace which is used to manage the VMkernel interface (Thanks to Andres for mentioning ESXCLI method).

There are two flags that this command supports which is to enable and disable a VMkernel interface. This is actually what the DCUI is doing when you ask it to restart the Management Network and is very similar to restarting a service on a UNIX/Linux system, it first shutdowns the service and then starts it back up. Given this information, if you wish to restart the Management Network of your ESXi host you can specify the name of the Management Network portgroup and execute the enable operation immediately after performing the disable operation.

To do this from the command-line, you would add a ; (semi-colon) between the two commands so they are executed one after another to ensure your VMkernel interface is enabled after you have disabled it. Here is an example of the command:

esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: Uncategorized Tagged With: dcui, esxcfg-vmknic, esxi, management interface, management network

How to get rid of "Quicks stats on hostX is not up-to-date" message

09/27/2013 by William Lam 10 Comments

After upgrading my Apple Mac Mini to ESXi 5.5 I noticed the following warning message being displayed after joining my ESXi host to my vCenter Server:

"Quick stats on mini is not up-to-date" 

I have seen this warning message in the past and it usually goes away within a few minutes of connecting to a vCenter Server. However, this time it did not go away and as you can see from the screenshot, I have had my ESXi host up for 4 days now and the message is still there.

UPDATE (9/30) - This looks to be a known issue in vSphere 5.5 and there is a permanent fix which has been documented in the following VMware KB 2061008. Restarting the management service will not prevent the warning message from coming again, please refer to the KB for the solution.

I do not know about you, but I like to have a clean environment and I get annoyed when I see warning/error messages in the UI. From what I can tell, vCenter Server was able to collect the "quick stats" from the ESXi host but perhaps there was a communication problem at some point or just a glitch?

In any case, is is pretty easy to fix the problem, you just need to restart the management service on the ESXi host and this will force a refresh of the stats. You have three ways of doing this:

  1. Restart management service using DCUI connecting to your ESXi console
  2. Restart management service using DCUI via command-line
  3. Restart management service using command-line script

Option 1 is pretty straight forward and both Option 2 and 3 can be performed on the command-line via an SSH session to your ESXi host if you have enabled SSH.

Option 2 - To launch the DCUI, just type "dcui" on the command-line and you will be able to interact with the DCUI as you normally would from the console and restart the management service:

Option 3 - To restart just using the command-line, you can run the following command to restrat the management service:

/sbin/services.sh restart

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: Uncategorized Tagged With: dcui, esxi, management service, quick stats

How to Add a Splash of Remote Color to ESXi Shell

07/23/2011 by William Lam 6 Comments

This morning I noticed a very interesting retweet by fellow vExpert Wil van Antwerpen from another vExpert: Richard Cardona (You may know him as rcardona2k on the VMTN Community Forums) about a neat little trick with the use of remote ESXi Shell (previous known as remote TSM).

For those of you who login remotely via SSH to the ESXi Shell (previously known as unsupported mode and Tech Support Mode) know that you can run the DCUI utility remotely by just typing "dcui". The remote DCUI works just like it does using the direct console, with the exception of displaying the famous yellow and black screen that we are familiar with.

Richard came upon a neat little trick by setting the terminal type to "linux" from the default "xterm" that the yellow and black can be enabled when using the remote DCUI.

Before launching DCUI utility, you will need to run the following command on the ESXi Shell:

export TERM=linux

Next you will just type "dcui" and hit enter

Here is an example of running remote DCUI in color on ESXi 5

Here is an example of running remote DCUI in color on ESXi 4.1

Note: As you can see this is not a new trick in vSphere 5, but has been there since 4.x days but one big change with vSphere 5 is the full resolution of DCUI which many have complained about in the past.

If you are interested in other ways of customizing the DCUI, take a look at this blog post How to add a splash of color to ESXi DCUI Welcome Screen

Don't forget to play some cool soundtrack music when using the DCUI 😉

Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

Filed Under: ESXi, Not Supported Tagged With: dcui, esxi4, esxi5, vSphere 4, vSphere 5

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Services Business Unit (CSBU) at VMware. He focuses on Automation, Integration and Operation for the VMware Cloud Software Defined Datacenters (SDDC)

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Sponsors

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