[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] How to detect a domain shutdown with as less overheadas possible?



Kip Macy wrote:

In tools/python/xen/xend/XendDomain.py you'll see that reap is called
by onVirq which in turn is a handler registered for xend.virq.
xend.virq is an event-channel used by xend for notifications. It is
set up in tools/python/xen/xend/server/channel.py. In -testing reap
appears to be called as soon as a domain crashes, meaning that
everything is working as it should. In -unstable a guest doesn't get
reaped until 'xm list' gets called awakening xend to the fact that it
has work to do.
There's a bug under bugzilla (#7) about this. It appears xcs is not delivering VIRQs properly.

The DOM_EXC virq won't be delivered for every possible shutdown case either. It's delivered for a crash or for a shutdown (a domain initiated shutdown) but not for a domain destroy.

I've found the best way to detect shutdown reliably is with a polling loop. There's code in xenctld to do just this (and I believe Mike Wray is doing this too in the new Xend).

I've done performance testing with querying every 2 seconds and the overhead is trivial.

As Mark mentioned, there is an event socket for Xend. Be warned though that right now, those event are probably not very reliable.

If you're looking for a cheap solution that can be done with the shell, I'd suggesting grabbing VM-Tools and using the vm-list command to query the flags of a domain. It will have significantly less overhead than xm list.

Regards,
Anthony Liguori

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.