ESX cheat sheet

List of hosts in the HA cluster

less /etc/opt/vmware/fdm/hostlist

List registered VMs

less /etc/vmware/hostd/vmInventory.xml

vim-cmd commands

vim-cmd vmsvc/getallvmsList VMs registered on the host
vim-cmd vmsvc/reload VMIDForce the host to reload the vmx
vim-cmd vmsvc/power.getstate VMIDGet Power State of the VM
vim-cmd vmsvc/power.shutdown VMIDShutdown the Guest OS
vim-cmd vmsvc/power.off VMIDVM Hard power off
vim-cmd vmsvc/get.tasklist VMIDList VM Tasks
vim-cmd vmsvc/task_info task_idGet more details on the task
vim-cmd vmsvc/task_cancel task_idCancel the task

Kill VM

Using esxcli

esxcli vm process listList all running VM process
esxcli vm process kill -t soft -w WorldIDSoft kill the VM
esxcli vm process kill -t hard -w WorldIDHard kill the VM
esxcli vm process kill -t force -w WorldIDForce kill the VM

From esxtop

Shift + VShow only running VMs
F > C > EnterAdd the LWID (Leader World ID)view
K > enter LWIDKill the process of the unresponsive VM

Comments

Leave a Reply