[Reprint] VMWare official website: can not turn off virtual machines on the ESXi host (1014165)

Unable to close the virtual machines on the ESXi host (1014165)

https://kb.vmware.com/s/article/1014165?lang=zh_CN

  


Last Updated: 4/17/2019Categories: How to
 Symptoms

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
 
 Purpose

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:

 
 Resolution
Warning: Please perform the operations described in each section and each step in the sequence. Do not skip where a section or step, because each step may have an impact on the virtual machine.
 

Use vSphere Client / vSphere Web Client shut down the virtual machine

Try using the normal client off the virtual machine:

  1. The vSphere Client or vSphere Web Client to connect to VMware vCenter Server or VirtualCenter Server.
  2. 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) .
  3. If the virtual machine is still running, try to do this directly from the host.
  4. The vSphere Client or VMware Host Client is connected directly to the host running ESXi virtual machines.
  5. 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.

The power of the virtual machine if you use this client can not close properly, use the following command line options.
 

Installation Tools vSphere Command-Line Interface

Some procedures in this article use the vSphere Command-Line Interface (vCLI). Make sure you have installed vCLI, before proceeding.
Note: For ESXi 4.x, ESXi 5.x and ESXi 6.0, you can access the remote command line interface from vSphere Management Assistant (vMA). If you prefer to use this tool, see the vSphere Command-Line Interface Installation and Reference Guide  "Installing vMA vMA and run from the command."  
 

Determining the location of a virtual machine

Determine which virtual machines are running on the host. This information is available on the Summary tab in the VI Client virtual machine. Subsequent commands will be executed on the ESXi host is currently running the virtual machine or remote reference will be the host.


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.

  1. 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.
  2. 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
     
  3. 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





     
  4. Repeat Step 2, verify that the virtual machine is no longer running.


For ESXi 4.1:

  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
     
  2. 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

  1. On ESXi console, enter Support mode and log in as root. For more information, see  Tech Support Mode for Emergency Support (1003677) .
  2. 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
     
  3. Run the following command to get the current state of the virtual machine:

    vim-cmd vmsvc/power.getstate VMID
     
  4. 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

From the command line to send a signal through the process to stop the virtual machine.

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.
  1. On ESXi console, enter Support mode and log in as root. For more information, see  Tech Support Mode for Emergency Support (1003677) .
  2. 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/vmx


    vmxvmx


     
  3. If you list the  vmx process, run the following command to terminate the process:

    kill ProcessID
     
  4. After waiting for 30 seconds Repeat Step 2 again to check whether the process exists.
  5. If the process is not terminated, run the following command:

    kill -9 ProcessID
     
  6. 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.

  1. On ESXi console, enter Support mode and log in as root. For more information, see  Tech Support Mode for Emergency Support (1003677) .
  2. Run the following command to run the  esxtop utility:

    esxtop
     
  3. Press c to switch to the CPU resource utilization screen.
  4. Press Shift + v is defined as the view of the virtual machine. This will be easier to find Leader World ID in step 7.
  5. Press f to display the field list.
  6. Add Leader World ID column Press c.
  7. Press the name of the target virtual machine ID and World Leader ( LWID) identifies the target virtual machine.
  8. Press k.
  9. At the  World to kill prompt, type acquired in step 6 Leader World ID, and then press Enter.
  10. After waiting 30 seconds to verify that the process is no longer listed.
Note: If the above process does not resolve the issue, and the ESX \ ESXi host responds, you may need to reboot the virtual machine can be put off.
 
 Related Information

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) .

Unable to power off the virtual machine in an ESXi host
 
 Request a Product Feature
To request a new product feature, please contact your VMware representative.

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/10972187.html