[libvirt-users] How to trigger a script in a guest after resume? (aka guest system clock incorrect after host reboot with suspended guest)

Nils Toedtmann lists at nils.toedtmann.net
Wed Jul 24 14:07:28 UTC 2013


Hi

Is there a way i can trigger a script within a libvirt guest immediately
after resume? E.g. i don't see any log message that indicates to a guest
that it had been paused and was just woken up.


The problem that i am trying to solve is that when i reboot the host
(pausing all guests), the guests' system clocks are a few minutes late
after resume. The guests RTC (current_clocksource
= kvm-clock) are correct though, so a "hwclock --hctosys" fixed the
offset. I only need to find out how to call hwclock right after resume!


Right now i call hwclock every few minutes, but i'd like to shorten the
window of wrong time. OTOH i'd like to avoid installing ntpd into all
guests, given their perfectly fine RTCs.


On the host i am using CentOS 6.4 with all patches and the packaged
libvirt-0.10.2 and qemu-kvm-0.12.1.2. All guests are Ubuntu 12.04.


/nils.




More information about the libvirt-users mailing list