ESX 5 Esxcli Cheat Sheet
ESX 5 Esxcli Cheat Sheet
While working on various ESXi related issue I found strong need to get familiar with ESXi
commands. In this article I am going to show the basic usage of those commands with output.
esxcfg-* commands are also available for same purpose but I found esxcli command more
useful for my use.
I have issued these commands on ESXi 5.5.0. Covering System and Hardware Part here.
***********************************SYSTEM********************************
*************
How to check the Load on server ? we can also use “uptime” for same
******************************************HARDWARE*********************
********************
CPU:1
Id: 1
Package Id: 0
Family: 6
Model: 60
Type: 0
Stepping: 3
Brand: GenuineIntel
Core Speed: 3400060000
Bus Speed: 66000000
APIC ID: 0x1
Node: 0
L2 Cache Size: 262144
L2 Cache Associativity: 8
L2 Cache Line Size: 64
L2 Cache CPU Count: 2
L3 Cache Size: 8388608
L3 Cache Associativity: 16
L3 Cache Line Size: 64
L3 Cache CPU Count: 2
How to check the physical memory present ?
~ # smbiosDump.
How Many NIC are present on server? Another command to do same work ~ # esxcfg-
nics -l
~ # for i in `esxcli network nic list | awk ‘{print $1}’ | sed ‘1,2d’`
> do
> esxcli network nic stats get -n $i
> done
vmk1
Name: vmk1
MAC Address: 00:50:56:6f:57:99
Enabled: true
Portset: vSwitch1
Portgroup: StorageNW
Netstack Instance: defaultTcpipStack
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 50331652
vmk2
Name: vmk2
MAC Address: 00:50:56:78:eb:70
Enabled: true
Portset: vSwitch2
Portgroup: VMkernel
Netstack Instance: defaultTcpipStack
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 67108868
*******************************VSwitch*****************************
vSwitch1
Name: vSwitch1
Class: etherswitch
Num Ports: 1536
Used Ports: 4
Configured Ports: 128
MTU: 1500
CDP Status: listen
Beacon Enabled: false
Beacon Interval: 1
Beacon Threshold: 3
Beacon Required By:
Uplinks: vmnic1
Portgroups: VMkernel
How to check the port Groups present on server ?
~ # esxcfg-vswitch -l
Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch0 1536 5 128 1500 vmnic0
Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch1 1536 4 128 1500 vmnic1
Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch2 1536 4 128 1500 vmnic2
******************************ISCSI information
******************************
**************************Storage*************************
You can directly access command line in ESXi 5.x either through the console (so called ESXi
Shell) or SSH, but you need to first enable it through vSphere Client (Configuration ->
Security Profile -> Services -> ESXi shell / SSH -> Options -> Start) or console menu (F2 ->
login as user with root privileges -> Troubleshooting Options -> Enable ESXi Shell / Enable
SSH).
Show services on the host and their default state upon boot (on/off)
cat /etc/chkconfig.db
* in the following commands replace <vmid> with virtual machine ID obtained by running
the previous command
vim-cmd vmsvc/power.getstate <vmid> - show power state of a VM
vim-cmd vmsvc/power.shutdown <vmid> - shutdown a VM (shutdown guest)
vim-cmd vmsvc/power.reset <vmid> - reset a VM
vim-cmd vmsvc/power.off <vmid> - power off a VM
vim-cmd vmsvc/power.on <vmid> - power on a VM
vim-cmd vmsvc/power.reboot <vmid> - reboot a VM
vim-cmd vmsvc/get.summary <vmid> - get summary information for a VM
vim-cmd hostsvc/net/info
Provides information about hypervisor networking
chkconfig -l
Shows daemons running on hypervisor. Can also be used for configuration.
esxtop
Same as linux top for vmware
vmkerrcode -l
List of vmkernel errors
esxcfg-info
Lists a LOT of information about the esx host
esxcfg-nics -l
Lists information about NIC's. Can also be used for configuration.
esxcfg-vswitch -l
Lists information about virtual switching. Can also be used for configuration.
dcui
Provides console screen to ssh session
vsish
Vmware interactive shell
decodeSel /var/log/ipmi_sel.raw
Read System Event Log of server