linux – KVM:从内部关闭guest虚拟机时运行脚本?

linux – KVM:从内部关闭guest虚拟机时运行脚本?,第1张

概述我正在运行KVM作为虚拟化引擎. 当guest虚拟机从内部关闭时,有没有办法让QEMU / libvirt在主机上运行脚本(shutdown -h now)? 我希望能够在访客停止时运行一些自定义清理任务. libvirt提供了使用 hooks for specific system management的可能性: At present, there are three hook scripts 我正在运行KVM作为虚拟化引擎.

当guest虚拟机从内部关闭时,有没有办法让QEMU / libvirt在主机上运行脚本(shutdown -h Now)?

我希望能够在访客停止时运行一些自定义清理任务.

解决方法 libvirt提供了使用 hooks for specific system management的可能性:
At present,there are three hook scripts that can be called:    /etc/libvirt/hooks/daemon    Executed when the libvirt daemon is started,stopped,or reloads its configuration    /etc/libvirt/hooks/qemu    Executed when a QEMU guest is started,or migrated    /etc/libvirt/hooks/lxc    Executed when an LXC guest is started or stopped
总结

以上是内存溢出为你收集整理的linux – KVM:从内部关闭guest虚拟机时运行脚本?全部内容,希望文章能够帮你解决linux – KVM:从内部关闭guest虚拟机时运行脚本?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/1039415.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存