Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to detect that the guest VM has rebooted and perform an action using libvirt / qemu? The hooks here only support the "start" and "stop" events. I would like to detect if my VM has rebooted.

HOST is running ubuntu 10.04 GUEST is running ubuntu 10.04

share|improve this question

1 Answer 1

The qemu message protocol (QMP) supports a number of asynchronous messages, including one about restart. If you start your qemu instance with a QMP Server it will report a restart. libvirtd uses QMP to manage qemu guests, so you might try setting something like a proxy qmp server up to look for reboot messages. http://wiki.qemu.org/QMP#Asynchronous_message has a little bit more, but the QEMU-KVM source code has the best documentation of events.

share|improve this answer
    
Interesting, I wasn't familiar with QMP. In your answer are you referring to reset event documented at git.savannah.gnu.org/cgit/qemu.git/tree/QMP/qmp-events.txt ? Is this generated if the guest reboots itself (e.g someone logs in and issues the reboot command) or only if QEMU resets the quest (e.g. if a watchdog is set up and the timer expires). –  sciurus May 15 '11 at 1:16
    
I believe it is sent when the guest issues a reboot via ACPI or other hardware method. There is a separate event type for watchdog events (see the very bottom of qmp-events.txt). –  jbleners May 25 '11 at 22:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.