VMware - Virtual Machine Commands
List Registered VMs(vCLI only)
# vmware-cmd -l
Register a VM(vCLI only)
# vmware-cmd -s register /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
Get VM Power State(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
getstate
Power on a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx start
Shut Down a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx stop
[ soft | hard ]
Power off a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx stop
[ soft | hard ]
Reset a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx reset
[ soft | hard ]
Suspend a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx suspend
[ soft | hard ]
Resume a VM(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx resume
[ soft | hard ]
Get ESXi Host Platform Information (vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
getproductinfo [ product | platform | build | majorversion | minorversion ]
Get VM Uptime (vCLI only)
vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
getuptime
Get VMware Tools Status (vCLI only)
#vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
gettoolslastactive
0 = Not installed/Not running
1 = Normal
5 = Intermittent Heartbeat
100 = No heartbeat. Guest operating system might have stopped responding
Create VM Snapshot (vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
createsnapshot <name> <desc> <quiesce> <memory>
quiesce = Quiesce filesystem w/VMware Tools [ 0 | 1]
memory = Include memory state in snapshot [0 | 1]
Check if VM Has a Snapshot(vCLI only)
#vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
hassnapshot
Revert to VM Snapshot(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
revertsnapshot
Commit VM Snapshot(vCLI only)
# vmware-cmd /vmfs/volumes/<volume name>/<vm>/<vm>.vmx
removesnapshot
Forcibly Stop a VM with ESXCLI
# esxcli vm process list
# esxcli vm process list kill --type [ soft | hard | force ] -w
<worldId>
soft = similiar to kill or kill - SIGTERM
hard = smiliar to kill -9 or kill -SIGKILL
force = use as a last resort