Proxmox VE 无法关闭虚拟机的解决方法

一、一般方式:

rm -f /run/lock/qemu-server/lock-101.conf
qm unlock 101
qm stop 101
qm status 101 

二、强行kill掉

在对应的物理机shell中执行命令
ps -ef|grep "/usr/bin/kvm -id 100" |grep -v grep
file
可以看到ID号,然后使用kill id号 直接结束进程

三、如果伴随状态和HA错误(这里可以看到左侧虚拟机上有一个红色的叉叉)

Requesting HA stop for VM 207
service 'vm:207' in error state, must be disabled and fixed first
TASK ERROR: command 'ha-manager crm-command stop vm:207 0' failed: exit code 255

则需要在HA中禁用,执行原文中对应的命令即可
原文连接:https://pve.proxmox.com/pve-docs/chapter-ha-manager.html#ha_manager_error_recovery
原文内容:

Error Recovery

If, after all attempts, the service state could not be recovered, it gets placed in an error state. In this state, the service won’t get touched by the HA stack anymore. The only way out is disabling a service:
# ha-manager set vm:100 --state disabled
This can also be done in the web interface.
To recover from the error state you should do the following:
bring the resource back into a safe and consistent state (e.g.: kill its process if the service could not be stopped)
disable the resource to remove the error flag
fix the error which led to this failures
after you fixed all errors you may request that the service starts again

发表回复

登录... 后才能评论