How do I configure KVM to suspend/restore virtual machines when the host is rebooted?


To suspend a VM on host shutdown you will need to configure the following file

vi /etc/sysconfig/libvirt-guests

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
Last update:
2014-12-17 15:18
Author:
Chris Burton
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags