[libvirt-users] Determine state of the guest OS/kernel from host

Hello, Is there a way to determine state of the qemu/kvm guest OS (rebooting/working/hung etc) from the host. I'm not referring to the qemu domain state itself Thanks in advance.
harish

On 03.08.2012 05:46, Harish Patil wrote:
Hello, Is there a way to determine state of the qemu/kvm guest OS (rebooting/working/hung etc) from the host. I'm not referring to the qemu domain state itself
Well, I don't quite understand how would you do this on real host other than looking at its screen. Anyway, libvirt allows mgmt applications to peek into guest memory and dump it. This is how virt-dmesg works [1]. So maybe it would be handful example for you. Michal 1: http://people.redhat.com/~rjones/virt-dmesg/
Thanks in advance.
harish
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

Thanks Michal. Yes I do not have a screen, the host and the guests are running on an embedded device. The real requirement is: Is there a way that I can register with libvirt for the state change notifications in the guest OS? Is it possible? I need to take some actions in the host based on the guest OS state change. Thx
harish
On Thu, Aug 2, 2012 at 11:44 PM, Michal Privoznik <mprivozn@redhat.com>wrote:
On 03.08.2012 05:46, Harish Patil wrote:
Hello, Is there a way to determine state of the qemu/kvm guest OS (rebooting/working/hung etc) from the host. I'm not referring to the qemu domain state itself
Well, I don't quite understand how would you do this on real host other than looking at its screen. Anyway, libvirt allows mgmt applications to peek into guest memory and dump it. This is how virt-dmesg works [1]. So maybe it would be handful example for you.
Michal
1: http://people.redhat.com/~rjones/virt-dmesg/
Thanks in advance.
harish
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

[please don't top-post on technical lists] On 08/03/2012 09:02 AM, Harish Patil wrote:
Thanks Michal. Yes I do not have a screen, the host and the guests are running on an embedded device. The real requirement is: Is there a way that I can register with libvirt for the state change notifications in the guest OS? Is it possible? I need to take some actions in the host based on the guest OS state change.
How would you do this in a network of bare metal machines? You may be better served by setting up actions based on network messages sent by the guest, the way you would with one bare-metal machine reporting to another. Also, this sounds more like something that a guest agent would have to coordinate at a higher level than libvirt, as there is nothing inherent in running qemu that tells libvirt what the guest inside the qemu process is doing. virt-dmesg' ability to peek at guest memory is about the best you will be able to do through libvirt.
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Aug 3, 2012 at 9:49 AM, Eric Blake <eblake@redhat.com> wrote:
[please don't top-post on technical lists]
On 08/03/2012 09:02 AM, Harish Patil wrote:
Thanks Michal. Yes I do not have a screen, the host and the guests are running on an embedded device. The real requirement is: Is there a way that I can register with libvirt for the state change notifications in the guest OS? Is it possible? I need to take some actions in the host based on the guest OS state change.
How would you do this in a network of bare metal machines? You may be better served by setting up actions based on network messages sent by the guest, the way you would with one bare-metal machine reporting to another. Also, this sounds more like something that a guest agent would have to coordinate at a higher level than libvirt, as there is nothing inherent in running qemu that tells libvirt what the guest inside the qemu process is doing. virt-dmesg' ability to peek at guest memory is about the best you will be able to do through libvirt.
Thanks Eric. Understand that there is no such facility at the libvirt level. Do you know whether such notification can be received/trapped at the qemu level itself ? I had once checked that QEVENT_RESET event is emitted when the guest OS reboots.
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 08/03/2012 12:39 PM, Harish Patil wrote:
Is there a way that I can register with libvirt for the state change notifications in the guest OS?
Thanks Eric. Understand that there is no such facility at the libvirt level. Do you know whether such notification can be received/trapped at the qemu level itself ? I had once checked that QEVENT_RESET event is emitted when the guest OS reboots.
Certain guest events such as shutdown ARE detected by qemu, and therefore feed a lifecycle event that you can then monitor via libvirt. We even have an example program shipped in the libvirt sources for tracking all events in the lifecycle of a domain. However, I don't know if a guest reboot is always detected by qemu. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Harish Patil
-
Michal Privoznik