I am running KVM as virtualization engine.
Is there a way to make QEMU/libvirt run a script on the host when a guest is shutdown from within (shutdown -h now)?
I want to be able to run some custom clean-up tasks when a guest is stopped.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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, stopped, or migrated /etc/libvirt/hooks/lxc Executed when an LXC guest is started or stopped