ESXi is the technology that sits at the basic level of virtualization when using VMWare products. Be it a standalone ESXi host or one managed through vCenter, as a virtualization administrator or system administrator you must get familiar with the a few basic commands which can help in troubleshooting.
But, first thing’s first – In order to start using these commands via SSH, you need to enable SSH. To do this, on each host, using the WebClient you can follow these steps:
On standalone hosts:
1) Select the host and go to manage
2) Select the SSH Service
3) Start the service
On vCenter-managed hosts:
1) Select the host
2) Go to Configure
3) Go to Security Profile
4) Under Services, click Edit and start the SSH Service
The following part will provide some of the basic commands you can use for troubleshooting
Identifying Hostname, IP, and ESXi version:hostname
[will return the name of the host]
hostname -i
[will return the IP of the host]
vmware -l
[will return the release level information]
vmware -v
[will return the version info for vmkernel]
esxcli system version get
[will return the ESXi build and version numbers]
Basic directory navigation when connected via SSH:ls -l
[returns the directory structure with details]
pwd
[returns the present working directory]
cd
[changes directory]
date
[returns date and time]
Getting a list of all the installed VIBs (vSphere Installation Bundle) packages:esxcli software vib list
[will return the list of VIBs installed]
Put the host in Maintenance Mode for disruptive troubleshootingesxcli system maintenanceMode set –enable true
[ will place the host in Maintenance Mode and evacuate all VMs]
Check if the firewall is enabled on ESXi:esxcli network firewall get
[will return the state of the firewall]
Get installation time and date, for the ESXi OS:esxcli system stats installtime get
[returns the installation time and date]
Monitoring ESXi load with details:esxtop
[will open the default view of the esxtop]
For the esxtop, i will write a separate article as its a very powerful tool, but to get you started, pressing h will get you to the help menu, pressing c will get you to the CPU load view, pressing m will get you to the memory load view and pressing n will get you to the network load view.
Finding a command based on a keyword:esxcli esxcli command list | grep
network
[will return all commands that contain the word network]
Click on this link for ESXi Commands – Hardware Commands
Click on this link for ESXi Commands – System Commands
Click on this link for ESXi Commands – Network Commands
Click on this link for ESXi Commands – VM Commands
Click on this link for ESXi Commands – Storage Commands