Revision history [back]

The member variable in ZoneManager you're interested in is:

ZoneManager.service_states = {} # { <host> : { <service> : { cap k : v }}}

Look at nova.scheduler.api.get_zone_capabilities() to see how to call the Scheduler to query the ZoneManager (and the related nova.scheduler.manager.get_zone_capabilities() for the server-side counterpart)

That will give you the means to query for the info.

To add the ability for the Service to add a field about when the service was restarted last look at:

nova.manager.SchedulerDependentManager

I'd put a self.started_datetime (or something) in __init__() and initialize it to the UTC time. Tack it into the self.last_capabilities member variable in update_service_capabilities() and it'll get sent to the Schedulers on every update.

Let me know if that makes sense (I think I'm answering the right question? :)

-S