Disable compute fanout to scheduler
Now that nothing is using publish_service_capabilities it can be disabled, but not removed in order to not break compute rpcapi backwards compatibility. Part of bp no-compute-fanout-to-scheduler. Change-Id: I80c49c46138fd6ee89cb08ffbbced72ada4de72e
This commit is contained in:
@@ -152,13 +152,14 @@ class SchedulerDependentManager(Manager):
|
|||||||
capabilities = [capabilities]
|
capabilities = [capabilities]
|
||||||
self.last_capabilities = capabilities
|
self.last_capabilities = capabilities
|
||||||
|
|
||||||
@periodic_task.periodic_task
|
|
||||||
def publish_service_capabilities(self, context):
|
def publish_service_capabilities(self, context):
|
||||||
"""Pass data back to the scheduler.
|
"""Pass data back to the scheduler.
|
||||||
|
|
||||||
Called at a periodic interval. And also called via rpc soon after
|
Called at a periodic interval. And also called via rpc soon after
|
||||||
the start of the scheduler.
|
the start of the scheduler.
|
||||||
"""
|
"""
|
||||||
|
#NOTE(jogo): this is now deprecated, unused and can be removed in
|
||||||
|
#V3.0 of compute RPCAPI
|
||||||
if self.last_capabilities:
|
if self.last_capabilities:
|
||||||
LOG.debug(_('Notifying Schedulers of capabilities ...'))
|
LOG.debug(_('Notifying Schedulers of capabilities ...'))
|
||||||
self.scheduler_rpcapi.update_service_capabilities(context,
|
self.scheduler_rpcapi.update_service_capabilities(context,
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ from nova.compute import utils as compute_utils
|
|||||||
from nova.compute import vm_states
|
from nova.compute import vm_states
|
||||||
from nova.conductor import api as conductor_api
|
from nova.conductor import api as conductor_api
|
||||||
from nova.conductor.tasks import live_migrate
|
from nova.conductor.tasks import live_migrate
|
||||||
import nova.context
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova import manager
|
from nova import manager
|
||||||
from nova.objects import instance as instance_obj
|
from nova.objects import instance as instance_obj
|
||||||
@@ -68,16 +67,12 @@ class SchedulerManager(manager.Manager):
|
|||||||
super(SchedulerManager, self).__init__(service_name='scheduler',
|
super(SchedulerManager, self).__init__(service_name='scheduler',
|
||||||
*args, **kwargs)
|
*args, **kwargs)
|
||||||
|
|
||||||
def post_start_hook(self):
|
|
||||||
"""After we start up and can receive messages via RPC, tell all
|
|
||||||
compute nodes to send us their capabilities.
|
|
||||||
"""
|
|
||||||
ctxt = nova.context.get_admin_context()
|
|
||||||
compute_rpcapi.ComputeAPI().publish_service_capabilities(ctxt)
|
|
||||||
|
|
||||||
def update_service_capabilities(self, context, service_name,
|
def update_service_capabilities(self, context, service_name,
|
||||||
host, capabilities):
|
host, capabilities):
|
||||||
"""Process a capability update from a service node."""
|
"""Process a capability update from a service node."""
|
||||||
|
#NOTE(jogo) This is deprecated, but is used by the deprecated
|
||||||
|
# publish_service_capabilities call. So this can begin its removal
|
||||||
|
# process once publish_service_capabilities is removed.
|
||||||
if not isinstance(capabilities, list):
|
if not isinstance(capabilities, list):
|
||||||
capabilities = [capabilities]
|
capabilities = [capabilities]
|
||||||
for capability in capabilities:
|
for capability in capabilities:
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
|
|||||||
|
|
||||||
def update_service_capabilities(self, ctxt, service_name, host,
|
def update_service_capabilities(self, ctxt, service_name, host,
|
||||||
capabilities):
|
capabilities):
|
||||||
|
#NOTE(jogo) This is deprecated, but is used by the deprecated
|
||||||
|
# publish_service_capabilities call. So this can begin its removal
|
||||||
|
# process once publish_service_capabilities is removed.
|
||||||
self.fanout_cast(ctxt, self.make_msg('update_service_capabilities',
|
self.fanout_cast(ctxt, self.make_msg('update_service_capabilities',
|
||||||
service_name=service_name, host=host,
|
service_name=service_name, host=host,
|
||||||
capabilities=capabilities),
|
capabilities=capabilities),
|
||||||
|
|||||||
Reference in New Issue
Block a user