esxcli command help

List mounted datastores:

esxcli storage filesystem lists

Shutdown or Reboot the ESXi Host:

esxcli system shutdown <poweroff|reboot> --delay 10 --reason "Just Poweroff"

 

Advertisements

Restore ESXi Connectivity when “Management Network” is deleted

Today one of my friends accidentally deleted the “Management Network” Port Group on a ESXi. Here’s what I did to restore the network connectivity to the ESXi host:

Steps:

  1. Login to the DCUI of the ESXi host in question
  2. In the DCUI go to “Troubleshooting Options” and “Enable ESXi Shell”
  3. Press “Alt + F1” for logging in via the ESXi Shell
  4. After Logging in execute the following commands to restore the connectivity.

In our case the “Management Network” Port Group, was deleted so first we have to recreate the “Management Network” Port Group:

esxcfg-vswitch -A "Management Network" vSwitch0

After the “Management Network” is recreated, add a VMKernel Interface to the just created “Management Network” Port Group:

esxcfg-vmknic -a -i 10.20.30.x -n 255.255.255.0 "Management Network"

Logout from the shell. Go back to DCUI [Alt + F2]. Logout from DCUI and Relogin and test “Management Network” connectivity.

That’s all.

Windows String Search (commandline)

In case, you are looking for a quick string search within files on a Windows machine, you can use the “findstr” tool:

E.g.:

findstr /i /s "my_string_abc"  <folder path>

In the abve example, we use the following modifiers:
/i indicates do a case insensitive search

and

/s search in sub directories

using * instead of <folder path>  would search for all files from the current folder and below.

You can also find additional information about findstr at  http://ss64.com/nt/findstr.html