Bobcares

How to kill an unresponsive Virtual Machine in VMWare ESXi

by | Dec 11, 2020

Wondering how to kill an unresponsive virtual machine? We can help you with it.

Here at Bobcares, we have seen several such VMWare related errors as part of our Server Management Services for web hosts and online service providers.

Today we will take a look at how to kill the unresponsive Virtual machine.

 

Why does a Virtual machine become unresponsive

Sometimes we see that a certain virtual machine on the VMWare ESXi host freezes and it is impossible to turn off or restart it from the vSphere console by any means.

Moreover, it is not advisable to reboot the entire ESXi host due to a single virtual machine.

If the virtual machine process on the ESXi server freezes, it stops responding to vCenter Reset/Power Off commands. As a result, it returns one of the following errors to any action:

  • Another task is already in progress;
  • The virtual machine might be performing concurrent operations. Actions: Complete the concurrent operation and retry the power-off operation; The virtual machine is in an invalid state;
  • The attempted operation cannot be performed in the current state.

 

How to kill an unresponsive virtual machine

Our Support Engineers manually kill the virtual machine process on the ESXi host from the ESXi Shell or PowerCLI command prompt.

1. First, we determine the hung virtual machine is running on which ESXi host. For that, we find the VM in the vSphere Client interface. The ESXi hostname on which VM is running is specified under the Summary tab in the Related Object >> Host section.

2. Next, we enable the SSH access protocol on the ESXi host. We do it from the vSphere interface. by clicking on the ESXi hostname and go to Configure >> Services >> SSH >> Start.

how to kill an unresponsive virtual machine

3. Now we connect to this host via SSH. After that, we run the below command to list the VMs running on the ESXi host.

esxcli vm process list

From the above command’s result, we copy the “World ID” of the problem virtual machine.

4. Next, we execute the below command to terminate the process of a hung virtual machine.

esxcli vm process kill --type=[soft,hard,force] --world-id=WorldNumber

5. In our example, we are trying to softly stop the VM with the specified ID:

esxcli vm process kill --type=soft -w=20598247

The VM powers off.

6. Now we stop the frozen virtual machine using the PowerCLI. We also check that the VM is running.

get-vm “web1" | select name,PowerStates

7. Then we force to stop the VM process.

stop-vm -kill "web1" -confirm:$false

8. Also, we can stop an unresponsive VMWare virtual machine using the ESXTOP utility.

For that, we open the SSH session, enter the esxtop, press “c” to display CPU resources and then we press SHIFT+V to display only virtual machine processes.

9. Then we press “f” (to select fields to be displayed), “c” (to display the LWID), and then press ENTER.

10. After that, in the Name column, we find the virtual machine to be stopped and note its LWID number.

11. Now, we press the “k” (kill) and enter the LWID number of the virtual machine that we want to force shut down.

12. The last way of VM “hard“ power off is to use the kill tool. This method will stop the VM along with all child processes.

For that, we get the parent process ID of the VM:

ps | grep "web2"

Finally, we kill the VM process.

kill -9 24288473

[Need any further assistance in fixing VMWare errors? – We are here to help you]

 

Conclusion

Today, we saw the solution provided by our Support Engineers to this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF