我有一个在服务器上运行的虚拟机,无法停止或重新启动 - 我不能再登录它,也不能使用VMware服务器控制台停止它。由于其他虚拟机正在运行,因此重启主机不是可行的选择。是否还有其他方法强制停止一台虚拟机?
我有一个在服务器上运行的虚拟机,无法停止或重新启动 - 我不能再登录它,也不能使用VMware服务器控制台停止它。由于其他虚拟机正在运行,因此重启主机不是可行的选择。是否还有其他方法强制停止一台虚拟机?
如果您使用 Linux 操作系统,则可以使用以下命令获取客户机进程:
ps axuw | grep vmware-vmx
正如@Dubas所指出的,您应该能够通过VMD的路径名选出错误的进程
关闭ESXi主机上的虚拟机(1014165) 症状
您遇到以下问题:
You cannot power off an ESXi hosted virtual machine.
A virtual machine is not responsive and cannot be stopped or killed.
Open a console session where the esxcli tool is available, either in the ESXi Shell, the vSphere Management Assistant (vMA), or the location where the vSphere Command-Line Interface (vCLI) is installed.
Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:
esxcli vm process list
Power off one of the virtual machines from the list using 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.
Alternate power off command syntax is: esxcli vm process kill -t [soft,hard,force] -w WorldNumber
Repeat Step 2 and validate that the virtual machine is no longer running.
对于ESXi 4.1版本:
Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:
esxcli vms vm list
Power off one of the virtual machines from the list using this command:
esxcli vms vm kill --type=[soft,hard,force] --world-id=WorldNumber"
基于以下两点考虑,a) @Espo的评论和b) 我只能使用Windows任务管理器……
我登录主机,打开了任务管理器,并在“视图”菜单中将PID列添加到“进程”选项卡中。
我用纸和笔记录了在该系统上正在运行的每一个vmware-wmx.exe进程的PID号码。
使用VMWare控制台,我暂停了出现问题的虚拟机。
当我恢复它后,我就可以识别与我的虚拟机相对应的vmware-vmx进程并杀死它。
到目前为止似乎没有产生任何不良影响。
类似的,但使用WMIC命令行获取进程ID和路径:
WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid
这将创建一个文本文件,其中包含每个进程及其参数。您可以在文件中搜索您的VM文件路径,并获取正确的进程ID以结束任务。
感谢http://windowsxp.mvps.org/listproc.htm提供正确的命令行参数。
对于ESXi 5,您首先需要通过vSphere控制台启用ssh,然后登录并使用以下命令查找进程ID:
ps -c | grep -i "machine name"
您可以通过使用 kill
命令来查找进程 ID 并结束该进程。