Saturday, March 22, 2014

Useful ESXi CLI Commands

Various ESXi 5.x Commands to Gather Information
System
List all VMs (VM name, vmx file, world ID, etc)
     #> esxcli vm process list
List all VMs (VM name, vmx file, guest OS, hardware version, etc)
     #> vim-cmd vmsvc/getallvms
Show hostname (hostname, FQDN and domain)
     #> esxcli system hostname get
Show ESXi version and build
     #> esxcli system version get
Show abbreviated ESXi version and build
     #> vmware -v
Show hardware info (name, vendor, serial number, etc)
     #> esxcli hardware platform get
Show CPU info (cores, vCPU, hyperthreading, etc)      #> esxcli hardware cpu global get
Show memory info
     #> esxcli hardware memory get
Show load
     #> esxcli system process stats load get

Settings
Show current system time
     #> esxcli system time get
Show DNS servers
     #> esxcli network ip dns server list

Network
List nics and info
     #> esxcfg-nics -l
Another way to list nics and info
     #> esxcli network nic list
List vswitch connected to the management console

     #> esxcfg-vswitch -l
List vswitches
     #> esxcli network vswitch standard list

Show default route
     #> esxcfg-route -l

List VMs and their network
     #> esxcli network vm list

List portgroups
     #> esxcli network vswitch standard portgroup list

Show ARP table
     #> esxcli network ip neighbor list

Show active TCP/IP connections
     #> esxcli network ip connection list


Storage Adapters
List storage adapters
     #> esxcli storage core adapter list
List fiber channel adapters
     #> esxcli storage san fc list


Volumes
List volumes (VMFS, NAS, VFAT)
     #> esxcli storage filesystem list
Show the number of volumes
     #> ls -F /vmfs/volumes | grep \@$ | wc -l

Show snapshots, if any
     #> esxcli storage vmfs snapshot list (show SNAPSHOTS, if any)


Misc
Show Dell OpenManage info, if installed
     #> esxcli software vib list | grep -i openmanage