ESXi CLI

Useful command line interface collection for the ESXi shell. Only use in lab and never in production environment.

 

Working with VMs

 

List all VMs registered to this host (This reveals the VMID needed for other commands)

Unregister a VM

Register a VM

Get power state of a VM

Power off a VM

Power on a VM

Get snapshot info of a VM

Take snapshot of a VM

Get overview for snapshot troubleshooting

List VMs running on host and get world id

Kill process

Block mapping for VMDK

Blocks not written yet show as “–> [NOMP –“

Networking

 

Capture all traffic on vmnic0

NIC driver/firmware check

NIC Details (Speed, MTU, MAC Address)

vmNIC Details (Names, MTU, MAC address, Netmask, Broadcast, TCP stack)

vmNIC Stats

Unload Driver (example: QLogic driver)

vmNIC ping

List vSwitch settings

List all switchports

vmkernel port Packet Capture Example

Example to capture vmnic traffic

 

Example to capture Rx/Tx on switchport 67108904 of a VM, plus Rx/Tx of vmkernel vmk0

 

Stopping all pktcap-uw processes

 

Test open port and specify source IP address (.42 = source | .41 = target | 8000 = port)

 

Storage

List storage latency in logs (show in microseconds)

SCSI device info

SCSI HBA info

SCSI naa. to datastore mapping info (shows naa, UUID, datastore names)

List SCSI devices

Show all Volumes

Check filesystem with voma (get disk IDs in naa.000000000:1 format with # esxcfg-scsidevs -m)

Perform LUN reset against device (3x to force)

Break LVM lock on device

Storage Rescan

Show partition table of device (list with esxcfg-scscidevs -m)

 

 

Working with Hosts

List all hardware details (Server info, PCI, heap sizes)

Show all licensing infos

List all current tasks on host

Show info about task

Show files/directories using most space

List Modules (such as drivers)

Get Module info (such as drivers)

Examples of listing driver versions

Author: kimbo

Leave a Reply

Your email address will not be published. Required fields are marked *