From 64e167eb62bd3483b2947ec8de218453c116bd93 Mon Sep 17 00:00:00 2001 From: Yun Mao Date: Mon, 6 Aug 2012 12:37:12 -0400 Subject: Add pluggable ServiceGroup monitoring APIs Summary: * provide a pluggable ServiceGroup monitoring API * refactor the old DB-based implementation to the new API Currently nova compute nodes periodically write to the database (every 10 seconds by default) to report their liveness. This implementation factors out this functionality and make it a set of abstract internal APIs with a pluggable backend implementation. Currently it's named as ServiceGroup APIs. With this effort, we are hopeful to see the following benefits: * We expect to see more backend implementations in addition to the default database-based one, such as ZooKeeper (as described in blueprint zk-service-heartbeat) or rabbitmq heartbeat based. * We expect the code to live in openstack-common so projects other than Nova can take advantage of the internal APIs. * Lay the foundations to use lower overhead heartbeat mechanisms which scale better. * Other than reporting whether a node in a service group is up or down, the code may also be used to query for members. Other parts of the code could also take advantage of the new APIs. One noteable example is the MatchMaker in the rpc library, which may even become redundant. We have been working with Eric at Cloudscaling to see how this fits with the matchmaker. It is likely that this code will need to be used, at least by the peer-to-peer based RPC mechanisms, to implement the new create_worker method. DocImpact: new config options Co-authored-by: Pavel Kravchenco Co-authored-by: Alexey Roytman Change-Id: I51645687249c75e7776a684f19529a1e78f33a41 --- nova/api/ec2/cloud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index aca4ab3b2..ad922118e 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -41,6 +41,7 @@ from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova.openstack.common import timeutils from nova import quota +from nova import servicegroup from nova import utils from nova import volume @@ -196,6 +197,7 @@ class CloudController(object): volume_api=self.volume_api, security_group_api=self.security_group_api) self.keypair_api = compute_api.KeypairAPI() + self.servicegroup_api = servicegroup.API() def __str__(self): return 'CloudController' @@ -273,7 +275,7 @@ class CloudController(object): 'zoneState': ''}) for service in host_services[host]: - alive = utils.service_is_up(service) + alive = self.servicegroup_api.service_is_up(service) art = (alive and ":-)") or "XXX" active = 'enabled' if service['disabled']: -- cgit