ESXi Shell : ESXi Shell is a VMware vSphere command-line interface (CLI) for troubleshooting.. ESXi Shell, which was formerly known as Tech Support Mode (TSM), is disabled by default. Only the root user and system administrators can execute system commands using the ESXi Shell.
Commands : It will help you for troubleshooting, maintenance and performance monitoring.
1) services.sh :– The Services.sh passed with a stop, start, or restart flag to perform the operations on all ESXi services.
services.sh restart – It will restart all ESXi services.
2) /etc/init.d :– That script located in /etc/init.d it will use to start or stop the services one at a time. If you just wanted to restart the vCenter Server Agent called vpxa service you have to run the /etc/init.d/vpxa restart . And the services.sh restart will restart all services.
/etc/init.d/vpxa restart – It will restart vCenter Agent on host
cat /etc/chkconfig.db – Displaying current running status of all ESXi services.
3) vmkping :– As you are familiar how the old ‘ping’ command work . But the vmkping Command is little more advance and it will allows you to use the IP stack of the VMkernel to send the ICMP packets through specific interface.
vmkping –I vmk1 192.168.1.10 – It will send the ICMP request to 192.168.1.10 through vmk1 interface .
4) nc :– It will knows as netcat and will use for confirming network connectivity to a certain IP from an ESXi host. While vmkping confirms communication through ICMP, there are times when we want to confirm connection on a specific TCP port (think iSCSI connections on port 3260).
nc –z 192.168.1.11 3260 –It will test the connectivity to 192.168.1.11 on port 3260.
5) vmkfstools :– It will use VMFS volumes and virtual disks via the command line. It will allows you to create, clone, extend, rename and delete VMDK files. In addition to the virtual disk options, you can also create, extend, grow and reclaim blocks from our file systems via vmkfstools.
vmkfstools –i test.vmdk testclone.vmdk – clones test.vmdk to testclone.vmdk
6) ESXTOP :- Esxtop is a command-line tool that gives administrators real-time information about resource usage in a vSphere environment. With esxtop, an administrator can monitor CPU, disk space, memory and network resource usage. The command can be run either directly at the console or remotely, by using a secure shell console.
7) vscsiStats :- When you need to go one step further with your performance monitoring of storage I/O, vscsiStats can be a great help. The vscsiStats command will help you gather a collection of data and metrics that pertain to a VM’s disk I/O workload. In the end, you are basically left with a sample to help you gather the most common I/O size and latency averages. Using vscsiStats can prove to be invaluable when capacity planning or migrating your back end storage as well.
8)vim-cmd – Vim-cmd is a command space that is built over top of the hostd process, allowing the end user to script and command almost every vSphere API. Vim-cmd has a number of sub ESXi commands dealing with different portions of the virtual infrastructure and is very easy to use compared to its counterpart, vimsh.
9) dcui – The VMware Direct User Console Interface (DCUI) is the menu-based option listing that you see when you initially log into an ESXi host. There are many different options available to you from the DCUI, such as root password maintenance, network and maintenance. Sometimes you may only have SSH access to the host, but thankfully, you can still get to the DCUI menu-based system by simply executing dcui from the command line.
10) vm-support – Ever feel like grabbing a complete bundle of all the support and log informationthat you have inside of your ESXi host? That is exactly what vm-support does. This tool is invaluable, and if you have ever been on a support call with VMware, you have probably already ran this.
Thanks hope you like it.
Rajiv Pandey.