5 ways to troubleshoot unresponsive virtual machine in ESXi host
Let’s discuss 5 different ways to troubleshoot unresponsible virtual machine in ESXi host using various command line tools.
Troubleshooting unresponsive virtual machine using ESXCLI
esxcli vm process list
You need to copy the World ID of the unresponsive virtual machine. Let’s take an example, Unresponsive virtual machines are App-1 & App-2 and respective world ID is 1281357 and 604966. I can use the below ESXCLI command to kill the virtual machine
esxcli vm process kill --type=soft -w=WorldID
Troubleshooting unresponsive virtual machine using vim-cmd
What is vim-cmd?
vim-cmd is a vSphere CLI tool available with ESXi host. vim-cmd can be used to perform various activities in a VMware environment. vim-cmd is (virtual infrastructure management) command. The vim-cmd is associated with the vSphere API – it’s built on top of the hostd which implements the APIs.
How to use vim-cmd to power of unresponsive virtual machine
You need to first get the list of all virtual machines running on the ESXi host using the getallvms command
vim-cmd vmsvc/getallvms
Once you got the list of running VM’s on the ESXi host, you need note down the vmid of the unresponsive virtual machine. Run the vim-cmd power.getstate to get the power state of the virtual machine and vim-cmd power off command to power off the problematic virtual machine with the help of vmid.
vim-cmd vmsvc/power.getstate vmid vim-cmd vmsvc/power.off vmid
Troubleshoot unresponsive virtual machine using ESXTOP
ESXTOP is the utility available with ESXi host. Which helps to examine real-time resource usage ESXi hosts. esxtop can only be used for the local ESX machine. There are 3 different types of Modes available in esxtop such as Interactive Mode, Batch Mode, and Replay Mode. Let’s see how to stop unresponsive virtual machine using ESXTOP command.
Login to ESXi host using SSH and type the command “ESXTOP”. Press Shift+v to change the ESXtop view to virtual machines.
Press f to add or remove the fields and Press c to add the Leader World ID (LWID) column to the view. Press any key to return to the main menu.
Note down the LWID (Leader WorldID) of the unresponsive virtual machine. Press k and Type LWID of the unresponsive virtual machine to kill the unresponsive virtual machine. In my Example, My unresponsive virtual machine is App-1 and LWID is 1453107
Troubleshoot unresponsive virtual machine using PowerCLI
PowerCLI is one of the favorite remote command line tools for many administrators. It simply allows you to automate a lot of day to day tasks. Let’s see how to power off the virtual machine using one-liner PowerCLI command. Stop-vm is to power off the virtual machine and -Kill parameter helps to kill the unresponsive virtual machine.
stop-vm -kill "vmname" -confirm:$false
Troubleshoot unresponsive virtual machine using Kill command
Kill word looks forcefully to us. That’s why it is in the last of the list. Kill command always use to kill the process. The virtual machine is also a series of process in the ESXi host. Execute the below command
ps | grep "Vmname"
Once you got the process ID of the virtual machine. Execute the below command to kill the virtual machine forcefully
kill -9
I hope this is informative for you. Thanks for Reading !! Be social and share it in social media using social media plugins, if you feel worth sharing it.