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

Skip to main content

My Subscriptions

Loading

Knowledge Base

Powering off an unresponsive virtual machine on an ESXi host (1004340)

Last Updated: 3/21/2024Categories: How toTotal Views: 184314Language:
English

151 like this article

Subscribe to get an email
newsletter with new updates

151 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

You cannot power off virtual machine on an ESXi host

A virtual machine is unresponsive and cannot be forced off or stopped

You cannot access or unlock files on a virtual machine

After shutting down a virtual machine, vCenter Server shows the virtual machine as running

There is no indication that a virtual machine is shut down

You cannot edit properties in the virtual machine

You see one or more of these errors:

Soap error 999. The operation is not allowed in current state

The attempted operation cannot be performed in the current state (Powered Off)

The request refers to an object that no longer exists or has never existed

Purpose

This article provides steps for shutting down and when necessary, force on an unresponsive virtual machine.

Resolution

If Powering off the virtual machine from vSphere Web Client or Host Client does not work , you must use the command line method.

Determining the virtual machine's location

Determine the host on which the virtual machine is running. This information is available in the virtual machine's Summary tab when viewed in vCenter web client.

There are several methods to power off the non-responsive virtual machine using command line as the following:

Using the ESXi command-line

Using ESXi esxcli commands

Warning: Follow the sections and steps in this article in order.

Using the ESXi command-line

Log in as root to the ESXi using SSH.

Get a list of all registered virtual machines, identified by their VMID and Display Name by running this command:

# vim-cmd vmsvc/getallvms

Example output:

Take note of the impacted virtual machine ID VMID

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

# vim-cmd vmsvc/power.getstate VMID

Example output:

Check if there hanging task on the impacted virtual machine that prevent the machine from powering on by running this command:

# vim-cmd vmsvc/get.tasklist VMID

Example output:

(ManagedObjectReference) [
'vim.Task:haTask-2-vim.VirtualMachine.createSnapshot-182550283',
'vim.Task:haTask-2-vim.VirtualMachine.consolidateDisks-182550274'
]

Run the vim-cmd vimsvc/task_info task_id command to see the task in more detail.

For example using the data from step 5:

$ vim-cmd vimsvc/task_info haTask-2-vim.VirtualMachine.createSnapshot-182550283

vim.TaskInfo) {
dynamicType = <unset>,
key = "haTask-2-vim.VirtualMachine.createSnapshot-182550283",
task = 'vim.Task:haTask-2-vim.VirtualMachine.createSnapshot-182550283',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.createSnapshot",
descriptionId = "VirtualMachine.createSnapshot",
entity = 'vim.VirtualMachine:2',
entityName = "VMware vCenter Server Appliance5-1",
state = "running",
cancelled = false,
cancelable = false,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 50,
reason = (vim.TaskReasonUser) {
dynamicType = <unset>,
userName = "vpxuser",
},
queueTime = "2014-11-09T17:49:01.171933Z",
startTime = "2014-11-09T17:49:01.175521Z",
completeTime = <unset>,
eventChainId = 182550283,
changeTag = <unset>,
parentTaskKey = <unset>,
rootTaskKey = <unset>,
}

The task is hung and needs to be cancelled, use the command:

# vim-cmd vimsvc/task_cancel task_id

Note: Please note that not all tasks can be canceled. For instance, in the example above we see the snapshot task has the cancelable flag set to false (cancelable = false).

Shutdown the virtual machine using the VMID found in Step 3 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

Example output:

Using the ESXi esxcli command

Log in as root to the ESXi using SSH.

Get a list of running virtual machines, identified by World ID and Display Name by running this command:

# esxcli vm process list

Example output:

Take a note of the world ID of the non-responsive virtual machine. For example in step 3 the World ID is 2750434.

Power off the virtual machine from the list by running one of these commands:

# esxcli vm process kill -t=soft -w=WorldID
or
# esxcli vm process kill -t=hard -w=WorldID
or
# esxcli vm process kill -t=force -w=WorldID

Note: These command provide different levels of force to stop the virtual machine:

Soft is the most graceful

Hard performs an immediate shutdown

Force should be used as a last resort

If the VM fails to stop even after running the "esxcli vm process kill" command, evacuate all other VMs off the ESXi host and restart the ESXi itself.

Related Information

VMware Skyline Health Diagnostics for vSphere - FAQ

Unable to Power off a Virtual Machine in an ESXi host

Investigating virtual machine file locks on ESXi hosts

Restarting the Management agents in ESXi

Investigating virtual machine file locks on ESXi

Unable to power off the virtual machine in an ESXi host

Failed to power on virtual machine

Como apagar una máquina virtual que no está respondiendo en un host ESX

ESX ホスト上の反応しない仮想マシンをパワーオフする

Como desligar uma máquina virtual sem resposta em um host ESX

在 ESX 主机上关闭无响应的虚拟机电源

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

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

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant