Unable to close the virtual machines on the ESXi host (1014165)
https://kb.vmware.com/s/article/1014165?lang=zh_CN
Disclaimer: This article is Unable to power off a virtual machine on an ESXi host (1014165) translations. Although we will continue to strive to provide the best translation version of this article, but localized content may be outdated. For the latest information, please refer to the English version.
- You can not turn off the power on the ESXi virtual machine hosts
- The virtual machine is not responding and can not be stopped or terminated
This article provides information to stop the virtual machine in the ESXi environment.
Note: This article applies only to ESXi, does not apply to ESX. For ESX host, see Powering OFF ON AN AN Unresponsive ESX Virtual Machine Host (1.00434 million) .
Note: If you try to reason unresponsive virtual machine troubleshooting, usually a good idea to collect performance metrics, and then the virtual machine hangs or crashes to gather more troubleshooting information.
For more information, see:
Use vSphere Client / vSphere Web Client shut down the virtual machine
Try using the normal client off the virtual machine:
- The vSphere Client or vSphere Web Client to connect to VMware vCenter Server or VirtualCenter Server.
- Right-click the virtual machine, and then click off the power. If the power operation fails with the error "other tasks already in progress (Another task is already in progress) ", please wait for the task to complete, or see Powering off a virtual machine fails with the error: Can not power Off: Another task is already in progress (1027040) or vCenter Operation at The Times OUT with error: Operation failed The Task Operating since Another IS in Progress (1.00479 million) .
- If the virtual machine is still running, try to do this directly from the host.
- The vSphere Client or VMware Host Client is connected directly to the host running ESXi virtual machines.
- Right-click the virtual machine and select Power Off.
Note: From the vSphere 6.5, you can enable virtual machine encryption to protect virtual machines and their files.
On a virtual machine if encryption is enabled, you must have a set of cryptographic operation authority, otherwise you will not power off the virtual machine.
For more information about permissions, see the ESXi and vCenter Server 6.5 Documentation of the "prerequisite encryption tasks and the required privileges" section.
Installation Tools vSphere Command-Line Interface
- For ESXi 3.5 host, see Remote Command-Line Interface Installation and Reference Guide "Remote CLI installation and execution."
- For ESXi 4.0 host, see vSphere the Command-Line Interface Installation and Reference Guide "vSphere CLI installed, and execute commands Overview".
- For ESXi 4.1 host, see vSphere the Command-Line Interface Installation and Scripting Guide .
- For ESXi 5.0 host, see vSphere the Command-Line Interface Documentation .
- For ESXi 5.1 host, see vSphere the Command-Line Interface 5.1 Release Notes .
- For ESXi 5.5 host, see vSphere the Command-Line Interface Documentation .
- For ESXi 6.0 host, see vSphere the Command-Line Interface Documentation .
Determining the location of a virtual machine
Use ESXi esxcli command power off the virtual machine
Can be used in a local or remote esxcli
command to close the ESXi 5.x running on the virtual machine is powered or later. For more information, see the vSphere Command-Line Interface Reference the "esxcli vm command" section.
- In providing
esxcli
open position of the tool a console session, the location may be ESXi Shell, vSphere Management Assistant (vMA ) or vSphere Command-Line Interface (vCLI) mounting position. - Run the following command to get a list of running virtual machine (VM by the World ID, UUID, displays the name and
.vmx
path identifies the configuration file):esxcli vm process list
- Run the following command to close the list of virtual machines supply: Note: There are three shutdown methods are available. Soft shutdown is normal shutdown, immediate shutdown hard shutdown, forced shutdown should be used in the case of last resort. Alternatively the shutdown command syntax: Process the kill the esxcli VM -t [ Soft, Hard, Force ] -w WorldNumber
esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber
- Repeat Step 2, verify that the virtual machine is no longer running.
For ESXi 4.1:
- Run the following command to get a list of running virtual machine (VM by the World ID, UUID, shows the path name and logo .vmx configuration file):
the esxcli VMS vm List
- Run the following command to turn off the power on this list a virtual machine:
esxcli vms vm kill --type= [soft,hard,force] --world-id= WorldNumber
Use the command-line utility ESXi vim-cmd off the virtual machine
- On ESXi console, enter Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677) .
- Run the following command to get a list of all registered virtual machines (VMs from the VMID, displays the name and
.vmx
path identifies the configuration file):vim-cmd vmsvc/getallvms
- Run the following command to get the current state of the virtual machine:
vim-cmd vmsvc/power.getstate VMID
- Step 2 obtained using VMID power off the virtual machine, run the following command: Note: If the virtual machine can not be shut down, run the following command: vim-cmd vmsvc / power.off VMID
vim-cmd vmsvc/power.shutdown VMID
Close to the virtual machine sends a signal on the ESXi
Warning: This process can be potentially harmful to the ESXi host. If you fail to identify the correct process ID (PID), and thus terminate the wrong process, it may produce unexpected results. If you are concerned about the following procedure, please submit a support to VMware technical support requests, and indicate the ID of this Knowledge Base article (1,014,165) in the problem description. For more information, see How to Support the Submit A Request .
In ESXi 3.5 and later, you can use the
kill
command to send a signal to the virtual machine running processes and terminate the process.
- On ESXi console, enter Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677) .
- Run the following command to determine whether the virtual machine processes running on the ESXi host:
ps | grep vmx
output is as follows: The return several rows, each process line. Please identify the parent object of the virtual machine process. The first column contains the PID, the second column is the PID of the parent process included. Make sure that you only terminate the parent process. Parent process ID (PID) of each process are listed in the second column, in the present example identified in bold. Writing this number for use in subsequent steps. Warning: Make sure you are specifically identified corresponding to the virtual machine you want to repair the line. If the outside of the virtual machine's virtual machines continue with this procedure, it may lead to other virtual machine downtime.7662 7662 vmx /bin/vmx
7667 7662 vmx /bin/vmx
7668 7662 mks:VirtualMachineName /bin/vmx
7669 7662 vcpu-0:VirtualMachineName /bin/vmxvmx
vmx
- If you list the
vmx
process, run the following command to terminate the process:kill ProcessID
- After waiting for 30 seconds Repeat Step 2 again to check whether the process exists.
- If the process is not terminated, run the following command:
kill -9 ProcessID
- The inspection process again after waiting 30 seconds.
In ESXi 4.x and later, you can use esxtop
the k
command to send a signal to the virtual machine running processes and terminate the process.
- On ESXi console, enter Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677) .
- Run the following command to run the
esxtop
utility:esxtop
- Press c to switch to the CPU resource utilization screen.
- Press Shift + v is defined as the view of the virtual machine. This will be easier to find Leader World ID in step 7.
- Press f to display the field list.
- Add Leader World ID column Press c.
- Press the name of the target virtual machine ID and World Leader (
LWID
) identifies the target virtual machine. - Press k.
- At the
World to kill
prompt, type acquired in step 6 Leader World ID, and then press Enter. - After waiting 30 seconds to verify that the process is no longer listed.
If the above method does not power off the virtual machine, it usually indicates that the underlying infrastructure (e.g. ESXi host or supporting hardware) problems.
If you suspect a problem not turn off ESXi host virtual machines, migrate out of the host all virtual machines unaffected by vMotion, then forced to stop the hosts with a purple diagnostic screen. For more information, see the Using Hardware NMI Facilities to Troubleshoot Unresponsive hosts (1014767) .