Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Unable to Power off a Virtual Machine in an ESXi host (1014165)

Last Updated: 6/22/2021Categories: How toTotal Views: 150486Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

76 like this article

Subscribe to get an email
newsletter with new updates

76 people found this helpful Please provide article feedback:

Learn how VMware Skyline Advisor and Skyline Health Diagnostics work together to provide proactive intelligence and self-service log analysis.

Use Skyline Advisor to avoid issues before they occur across VCF, vSphere, vSAN, NSX, vROps & Horizon. Skyline Findings are based on top KBs, VMSAs/CVEs and design best practices.

Use Skyline Health Diagnostics to root cause vSphere & vSAN logs when an issue occurs. Skyline Health Diagnostic Findings are based on top KBs and VMSA/CVEs. You can use the Skyline Health Diagnostics tool in online or offline mode.

If you require additional help from technical support, please use Skyline Advisor to initiate a Log Assist to reduce time to upload logs. TSEs can also initiate logs to reduce effort.

Symptoms

Unable to power off the virtual machine in an ESXi host.

A virtual machine is not responsive and cannot be stopped or killed.

Purpose

This article provides information on stopping virtual machines in an ESXi environment.

Note: If you are attempting to troubleshoot the cause of an unresponsive virtual machine, it is usually preferable to collect performance metrics and then either suspend or crash the virtual machine to collect additional troubleshooting information.

For more information, see:

Troubleshooting a virtual machine that has stopped responding: VMM and Guest CPU usage comparison (1017926).

Troubleshooting a virtual machine that has stopped responding (1007819).

Resolution

Solution when Unable to power off a virtual machine in an ESXi host:

Warning: Follow the sections and steps in this article in order. Do not skip a section or step, as each step may have an impact on the virtual machine.

Powering off the virtual machine using the vSphere Client/vSphere Web Client

Using the ESXi esxcli command to power off a virtual machine

Using esxtop to kill a virtual machine

Using the ESXi command-line utility vim-cmd to power off the virtual machine

Powering off the virtual machine using the vSphere Client/vSphere Web Client

Attempt to power off the virtual machine gracefully using the client:

Connect the vSphere Client or vSphere Web Client to VMware vCenter Server.

Right-click the virtual machine and click Power off. If the power operation fails with Another task is already in progress, wait for the task to complete or see Powering off a virtual machine fails with the error: Cannot power Off: Another task is already in progress (1027040) or vCenter operation times out with the error: Operation failed since another task is in progress (1004790).

If the virtual machine remains running, attempt the same operation from the ESXi host directly.

Connect the vSphere Client or VMware Host Client directly to the ESXi host running the virtual machine.

Right-click on the virtual machine and select Power off.

Note: From vSphere 6.5, you can enable Virtual Machine Encryption to protect virtual machine and its files.

If encryption is enabled on the virtual machine then you must have a set of Cryptographic Operations privileges failing which you will not be able to power off the virtual machine.

For more information on the Privileges, see Prerequisites and Required Privileges for Encryption Tasks section in the ESXi and vCenter Server 6.5 Documentation.

If the virtual machine cannot be powered off gracefully using the client, use one of the command-line options.

Using the ESXi esxcli command to power off a virtual machine

The esxcli command can be used locally or remotely to power off a virtual machine running on ESXi 5.x or later.

Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file by running this command:

esxcli vm process list

Power off the virtual machine from the list by running this command:

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

Notes:

Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.

Repeat Step 2 and validate that the virtual machine is no longer running.

Using esxtop to kill a virtual machine

You can use the k command in esxtop to send a signal to, and kill, a running virtual machine process.

On the ESXi console, enter Tech Support mode and log in as root.

Run the esxtop utility by running this command:

esxtop

Press c to switch to the CPU resource utilization screen.

Press Shift+v to limit the view to virtual machines. This may make it easier to find the Leader World ID in step 7.

Press f to display the list of fields.

Press c to add the column for the Leader World ID.

Identify the target virtual machine by its Name and Leader World ID (LWID).

Press k.

At the World to kill prompt, type in the Leader World ID from step 7, and press Enter.

Wait 30 seconds and validate that the process is no longer listed.

Using the ESXi command-line utility vim-cmd to power off the virtual machine

On the ESXi console, enter Tech Support mode and log in as root.

Get a list of all registered virtual machines, identified by their VMID, Display Name, and path to the .vmx configuration file by running this command:

vim-cmd vmsvc/getallvms

Get the current state of a virtual machine by running this command:

vim-cmd vmsvc/power.getstate VMID

Shutdown the virtual machine using the VMID found in Step 2 and run this command:

vim-cmd vmsvc/power.shutdown VMID

Note: If the virtual machine fails to shut down, run this command:

vim-cmd vmsvc/power.off VMID

Note: If the above procedures did not resolve the issue and the ESXi host is responsive, it may need to be rebooted to put the virtual machine in a powered-off state. You could migrate all the virtual machines to other ESXi with vMotion to avoid downtime.

Related Information

VMware Skyline Health Diagnostics for vSphere - FAQ
Powering off an unresponsive virtual machine on an ESXi host
Troubleshooting virtual machine power on task hangs
Failed to power on virtual machine
Sending signals on ESXi to power off the virtual machine

A virtual machine can be halted from the command line by sending signals to the process.

Warning: This procedure is potentially hazardous to the ESXi host. If you do not identify the appropriate process ID (PID) and kill the wrong process, it may have unexpected results. If you are not comfortable with the following procedure, file a support request with VMware Technical Support and note this Knowledge Base article ID (1014165) in the problem description. For more information, see How to Submit a Support Request.

You can use the kill command to send a signal to, and terminate, a running virtual machine process.

On the ESXi console, enter Tech Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677).

Determine if the virtual machine process is running on the ESXi host by running this command:

ps | grep vmx

The output appears similar to:

7662 7662 vmx /bin/vmx
7667 7662 vmx /bin/vmx
7668 7662 mks:VirtualMachineName /bin/vmx
7669 7662 vcpu-0:VirtualMachineName /bin/vmx

Several rows are returned, one for each vmx process. Identify the parent vmx process for the target virtual machine. The first column contains the PID, and the second contains the parent's PID. Ensure you terminate only the parent process. The parent Process ID (PID) for each process is listed in the second column, identified in this example in bold. Take note of this number for use in the following steps.

Caution: Ensure that you identify the line specific only to the virtual machine you are attempting to repair. If you continue this process for a virtual machine other than the one in question, you can cause downtime for the other virtual machine.

If the vmx process is listed, terminate the process by running this command:

kill ProcessID

Wait 30 seconds and repeat step 2 to check for the process again.

If it is not terminated, run this command:

kill -9 ProcessID

Wait 30 seconds and check for the process again.

If a virtual machine cannot be powered off using any of these methods, it usually indicates a problem with the underlying infrastructure, such as the ESXi host or its backing hardware.

If a problem is suspected with the ESXi host that is preventing the shutdown of virtual machines, vMotion all unaffected virtual machines off the host, and force the host to halt with a purple diagnostic screen. For more information, see Using hardware NMI facilities to troubleshoot unresponsive hosts (1014767).

For more information, see:

vCenter operation times out with the error: Operation failed since another task is in progress

Troubleshooting a virtual machine that has stopped responding

Using hardware NMI facilities to troubleshoot unresponsive hosts

Troubleshooting a virtual machine that has stopped responding: VMM and Guest CPU usage comparison

Powering off a virtual machine fails with the error: Cannot power Off: Another task is already in progress

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)Portuguese (European)JapaneseSpanishEnglishGerman

Attachments

Additional Resources

No results for undefined

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

Related Versions:

VMware vSphere ESXi 7.0.0

VMware vSphere ESXi 6.7

VMware vSphere ESXi 6.5

VMware vSphere ESXi 6.0

VMware vSphere ESXi 5.5

Take Our Survey

Support Assistant