Skip to content

Instantly share code, notes, and snippets.

@Roliga
Roliga / hibernate-vm
Created April 14, 2020 12:00
Hibernate libvirt VM on host shutdown/sleep.
#!/bin/bash
#
# Usage: hibernate-vm NAME
#
# Hibernates the VM specified in NAME and waits for it to finish shutting down
#
if virsh dompmsuspend "$1" disk; then
echo "Waiting for domain to finish shutting down.." >&2