To suspend a VM on host shutdown you will need to configure the following file
Set the following options (which are located throughout the configuration file).
ON_BOOT=start START_DELAY=5 ON_SHUTDOWN=suspend
You might not want to use START_DELAY=5, but I would rather the virtual machines start up with a little staggering rather than concurrently.
The libvirt-guests service also needs to be enabled and started.
systemctl start libvirt-guests systemctl enable libvirt-guests
You will now be able to reboot the host machine to install updates etc. and the virtual machines will be suspended and restored rather than shutdown interrupting their jobs.Tags: autostart, kvm, libvirt-guests, restore, suspend, vm, vps