ops@toolbox:~$ esxcli --help

VMware ESXi Reference

esxcli shell commands, PowerCLI cmdlets and govc CLI one-liners for VMware ESXi and vSphere. Searchable and copy-ready.

πŸ–₯ Host Information

esxcli system version getESXi version and build number
esxcli hardware platform getHardware model, vendor and serial number
esxcli hardware cpu global getCPU socket/core/thread count
esxcli hardware memory getTotal physical memory
esxcli system uptime getHost uptime
esxcli system hostname getHostname and FQDN

⚑ VM Power & Management

esxcli vm process listAll running VMs: World ID, display name, config file
esxcli vm process kill --type soft --world-id WORLDIDGracefully stop a VM (use hard or force if needed)
vim-cmd vmsvc/getallvmsList all registered VMs with their VM IDs
vim-cmd vmsvc/power.on VMIDPower on a VM
vim-cmd vmsvc/power.off VMIDHard power off a VM
vim-cmd vmsvc/power.shutdown VMIDGuest OS shutdown (requires VMware Tools)
vim-cmd vmsvc/power.reboot VMIDGuest OS reboot (requires VMware Tools)
vim-cmd vmsvc/get.summary VMIDVM summary, power state, memory, CPU, IP

πŸ“Έ Snapshots

vim-cmd vmsvc/snapshot.create VMID "Pre-Patch" "Before July patch" 1 1Create snapshot with memory and quiesce
vim-cmd vmsvc/snapshot.get VMIDList all snapshots for a VM
vim-cmd vmsvc/snapshot.revert VMID SNAPID 0Revert to a specific snapshot
vim-cmd vmsvc/snapshot.remove VMID SNAPIDDelete a specific snapshot
vim-cmd vmsvc/snapshot.removeall VMIDDelete ALL snapshots (consolidate), careful!

πŸ’Ύ Storage

esxcli storage filesystem listDatastores: VMFS, NFS, size and free space
esxcli storage core device listAll storage devices and LUNs
esxcli storage core adapter listHBA adapters and drivers
esxcli storage core path listStorage paths and multipathing status
esxcli storage nfs listNFS datastore mounts

🌐 Networking

esxcli network interface listVMkernel (vmk) interfaces
esxcli network ip interface ipv4 getVMkernel interface IP addresses
esxcli network nic listPhysical NICs (vmnic) and link status
esxcli network vswitch standard listStandard vSwitches and port groups
esxcli network ip route ipv4 listVMkernel routing table
esxcli network diag ping --host 8.8.8.8 --interface vmk0Ping from a specific VMkernel interface

πŸ”§ Patching & Maintenance

esxcli software profile getCurrent ESXi image profile and VIB list
esxcli software vib listAll installed VIBs (drivers and patches)
esxcli software vib install -d /vmfs/volumes/datastore/patch.zipInstall patch from depot zip (host must be in maintenance mode)
vim-cmd hostsvc/maintenance_mode_enterEnter maintenance mode
vim-cmd hostsvc/maintenance_mode_exitExit maintenance mode
esxcli system shutdown reboot -d 10 -r "Patching"Reboot host in 10 seconds with reason string

πŸ”— Connect & Session

Connect-VIServer -Server vcenter.example.com -Credential (Get-Credential)Connect to vCenter (prompts for credentials)
Connect-VIServer -Server esxi01.example.comConnect directly to an ESXi host
Disconnect-VIServer -Confirm:$falseDisconnect all sessions
$global:DefaultVIServersShow current active connections

⚑ VM Management

Get-VM | Select Name, PowerState, NumCpu, MemoryGB | Sort NameList all VMs with key properties
Get-VM -Name "MyVM" | Start-VMPower on a VM
Get-VM -Name "MyVM" | Stop-VM -Confirm:$falseHard power off
Get-VM -Name "MyVM" | Restart-VMGuestGuest restart (requires VMware Tools)
Get-VM | Where-Object {$_.PowerState -eq "PoweredOff"}Find all powered-off VMs
Get-VM | Get-VMGuest | Select VmName, IPAddress, OSFullNameVM guest OS and IP (requires Tools)
New-VM -Name "NewVM" -VMHost "esxi01" -Datastore "DS1" -NumCpu 2 -MemoryGB 4 -DiskGB 50Create a new VM

πŸ“Έ Snapshots

New-Snapshot -VM "MyVM" -Name "Pre-Patch" -Description "Before July patches" -Memory -QuiesceCreate snapshot with memory and quiesce
Get-VM | Get-Snapshot | Select VM, Name, Created, SizeGB | Sort VMAll snapshots across all VMs
Get-VM "MyVM" | Get-Snapshot | Remove-Snapshot -Confirm:$falseDelete all snapshots for a VM
Get-VM | Get-Snapshot | Where-Object {$_.Created -lt (Get-Date).AddDays(-7)}Find snapshots older than 7 days, review before deleting

πŸ–₯ Hosts & Infrastructure

Get-VMHost | Select Name, State, Version, NumCpu, @{N='MemGB';E={[math]::Round($_.MemoryTotalGB,0)}} | Sort NameAll ESXi hosts summary
Get-VMHost -Name "esxi01" | Set-VMHost -State MaintenancePut host in maintenance mode
Get-Datastore | Select Name, FreeSpaceGB, CapacityGB, @{N='Used%';E={[math]::Round((1-$_.FreeSpaceGB/$_.CapacityGB)*100,1)}}Datastore usage summary
Get-Cluster | Select Name, HAEnabled, DrsEnabled, DrsModeCluster HA/DRS settings

πŸ”— Setup & Connection

export GOVC_URL=https://user:pass@vcenter.example.com/sdk export GOVC_INSECURE=1Set govc environment variables (bash)
govc aboutTest connection and show vCenter/ESXi version
govc ls /List vCenter inventory root

⚑ VM Operations

govc ls /DC/vmList all VMs in a datacenter
govc vm.info /DC/vm/MyVMVM power state, IP, CPU, memory
govc vm.power -on /DC/vm/MyVMPower on VM
govc vm.power -off -force /DC/vm/MyVMHard power off VM
govc snapshot.create -vm /DC/vm/MyVM -m Pre-PatchCreate snapshot with memory
govc snapshot.tree -vm /DC/vm/MyVMList snapshots for a VM
govc vm.clone -vm /DC/vm/Template -on=false NewVMClone from template (powered off)

πŸ” Find & Report

govc find / -type m -runtime.powerState poweredOffFind all powered-off VMs
govc host.info /DC/host/Cluster/esxi01Host details: CPU, memory, version
govc datastore.info /DC/datastore/DS1Datastore capacity and free space
govc vm.info -json /DC/vm/MyVM | python3 -m json.toolVM info as formatted JSON (great for scripting)

esxcli vs vim-cmd vs PowerCLI vs govc

esxcli and vim-cmd run directly on the ESXi shell and require SSH access to the host. They're useful for direct host troubleshooting and automation without a vCenter. PowerCLI is the official VMware PowerShell module, best for scripting bulk operations against vCenter. govc is an open-source Go CLI for the vSphere API, ideal for Linux/bash environments and CI/CD pipelines where installing PowerShell is inconvenient.

Snapshots are not backups

This is the single most important VMware admin warning. A snapshot captures the delta from the base VMDK. As the VM runs, the delta grows. Large or old snapshots degrade I/O performance and can fill datastores. Always consolidate snapshots (delete them) after completing the work they were created for. Use Veeam, Commvault or VMware Live Recovery for actual backup protection.

Getting govc

Install govc on Linux: curl -L -o - "https://github.com/vmware/govmomi/releases/latest/download/govc_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xvzf - govc. Set GOVC_URL, GOVC_INSECURE=1 and optionally GOVC_USERNAME / GOVC_PASSWORD environment variables.

Related tools

Hyper-V Reference
PowerShell Hyper-V cmdlets: VMs, checkpoints, networking, live migration.
Citrix Reference
CVAD PowerShell and Citrix ADC CLI commands.
Subnet Calculator
IPv4 CIDR with subnet split and find-prefix.