WilliamLam.com

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

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

Categories // Uncategorized Tags // 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

Categories // Uncategorized Tags // dcui, ESXi, management service, quick stats

How to Add a Splash of Remote Color to ESXi Shell

07.23.2011 by William Lam // 7 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 😉

Categories // ESXi, Not Supported Tags // dcui, ESXi 5.0, vSphere 4.0, vSphere 5.0

  • « Previous Page
  • 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