VMware ESX / ESXi Command Line List

Although most of the below have appeared in earlier posts I thought it would be good to list of common ones I use.

List running VM’s on a host

powershell
esxcli vm process list

List all the Virtual Machines on a VMware ESXi Host

powershell
vm-support -V

List all mounted scsi id’s

powershell
esxcfg-scsidevs -m

List all volumes

powershell
esxcfg-volume -l

Force mount a volume

powershell
esxcfg-volume -M  or

Find certain words in vmkernel log

powershell
grep "vmkernel:" /var/log/messages | grep "keyword"

Find all VMs that have snapshots in ESX

powershell
find /vmfs/volumes/ -name "*delta*" -type f -print0 | xargs -0 du --human-readable --total

Find all VMs that have snapshots in ESXi

powershell
find /vmfs/volumes/ -name "*delta*" -type f -print0 | xargs -0 du -h

Restart VMware ESX Service Management Agents

powershell
service mgmt-vmware restart

Restart VMware ESXi Service Management Agents

powershell
/sbin/services.sh restart

List network cards in ESXi

powershell
esxcfg-nics -l

List all the vswitches

powershell
esxcfg-vswitch -l

Comments