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

前端之家收集整理的这篇文章主要介绍了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,只需稍加修改即可.

原文链接:https://www.f2er.com/linux/400967.html

猜你在找的Linux相关文章