微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

linux – KVM可以在主机关闭时自动挂起或关闭guest虚拟机吗?

我们有一个CentOS 5.5 KVM主机,运行各种版本的CentOS以及稍后可能的其他操作系统.

我们希望能够(a)自动向所有guest虚拟机发送ACPI关闭,或者(b)在主机关闭时暂停所有guest虚拟机到磁盘.

有没有一种标准方法可以完成其中任何一种,或者它是一种自己动手的情况?谢谢!

解决方法

是.

virsh shutdown命令(或使用libvirt的“shutdown”的其他实现,如virt-manager)指示客户操作系统干净地关闭.从手册页:

shutdown domain-id

   Gracefully shuts down a domain.  This coordinates with the domain
   OS to perform graceful shutdown,so there is no guarantee that it
   will succeed,and may take a variable length of time depending on
   what services must be shutdown in the domain.

   The exact behavior of a domain when it shuts down is set by the
   on_shutdown parameter in the domain’s XML deFinition.

使用KVM,这应该发送ACPI system_powerdown事件.

在Fedora和RHEL 6中,libvirt-guests init脚本开箱即用,配置为在系统关闭时挂起所有guest虚拟机.然而,这并不是特别神奇,因此可以将其复制到CentOS 5,只需稍加修改即可.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐