Bug 1370936 - RFE: suspend/resume all virtual machines on host suspend/resume
Summary: RFE: suspend/resume all virtual machines on host suspend/resume
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-28 15:53 UTC by Marc Haber
Modified: 2018-07-18 14:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Marc Haber 2016-08-28 15:53:44 UTC
The script tools/libvirt-guests.sh.in is used in distributions to shut down or suspend domains when the host goes down. This works like a charm.

However, currently, KVM has the issue that the host going to _sleep_ sometimes affects the running domains: It sometimes happens that the domains become unresponsive CPU-hogs. It does help to suspend the KVM domains before the host sleeps. systemd provides a mechanism to do that by means of /lib/systemd/system-sleep/.

libvirt-guests.sh contains most of the code needed to suspend all running domains, but it doesn't expose those mechanisms to the public.

Please consider adding a "suspend" and a "resume" option to libvirt-guests.sh that applies the respective operation to all domains even if the selected shutdown operation is "shutdown".

I am willing to provide a patch if you indicate that you would accept it.

Comment 1 Cole Robinson 2016-09-08 14:17:43 UTC
If qemu VMs consume tons of CPU after host suspend/resume, that's a qemu bug that should be fixed. But the feature request is still reasonable IMO, but it wouldn't be something we enable by default. Maybe make it a qemu.conf or libvirtd.conf option that can tie into systemd's suspend inhibitor? There's a related bug at https://bugzilla.redhat.com/show_bug.cgi?id=826044


Note You need to log in before you can comment on or make changes to this bug.