最近,部门的一台Xenserver主机突然出现闪断及对其上的虚拟机执行操作均会报错的异常。异常信息如下:

1.     对闪断主机上的vm进行任何操作,提示: 

Internal error: Failure("The ballooning daemon is not running") 

解决方案:

重启 squeezed 服务。

在主机上执行:

service squeeze d restart

2.     启动该服务后,对主机上的VM进行任何操作,均提示:

Cannot forward messages because the host cannot be contacted.  The host may be switched off or there may be network connectivity problems.

通过google查找答案,在一个博客上(http://www.crucial.com.au/blog/2011/03/)发现了解决方案。原文如下:

If this is in fact a state.db corruption in a pool, you can try the following steps to fix the issue:

1.     cd /var/xapi

2.     ls -al  -> check the results of this, usually the state.db will have an old time stamp – the time at which is became corrupted.

3.     mv state.db state.db_bak

4.     service xapi restart

意思是说,这很可能是因为state.db 这个文件损坏造成的。执行上述命令,将原文件备份后,重启xapi服务,这样xenserver会重新生成一个state.db文件,问题解决。

提示一点:服务重启后,之前执行失败的操作似乎都会再次执行。比如,我之前试验了虚拟机的停止迁移等操作,均为成功,但在问题解决后,发现这些虚拟机停的停,迁的迁了。