  
TA的每日心情 | 郁闷 前天 00:24 |
---|
签到天数: 1669 天 [LV.Master]伴坛终老
|
问题:virsh 无法重启或者关闭虚拟机
安装 kvm 虚拟化并且安装客户机之后,通过 virsh shutdown 命令无法关闭客户机,只能通过 virsh destroy 进行强制关闭电源。虽然这也是一种方法,但是直接断电显然有点不妥,并且你并不知道何时会出现一些奇奇怪怪的问题。
原因:少了电源管理模块
shutdown使用发送acpi指令来控制虚拟机的电源,而KVM虚拟机安装linux系统时默认没有安装acpid服务,所以导致不能关闭虚拟机,需要安装acpid。
在两台虚拟机中安装 acpid 服务,并且开启 acpid 服务
等待acpid服务启动之后,即可通过 virsh shutdown 来正常关机。
解决办法:
yum install acpid -y --->安装acpid服务
service acpid start --->启动acpid服务
chkconfig acpid on --->acpid开机自启动
最后再执行virsh reboot和virsh shutdown就可以正常执行了重启和关机了
|
|