Allow multiple API services to single manager

It is assumed we should only run a single manager, which ideally can be
failed over to run on any of the three controllers in a simple HA setup.
However, the API is currently targeting the manager with a matching
value for CONF.host. So if you run a single manager process, you must
run a single API service on the same host.

Currently the RPC target always includes the local hostname in its
target. If we remove that, we instead target the host agnostic queue,
similar to nova-conductor and nova-scheduler.

This means three APIs can target the single running manager process.

NOTE: the manager still has its target include its CONF.host value
correctly, such that all the usual RPC queues are setup, but for now we
stop using the host specific queue.

Change-Id: Id78662b996e1a2d1820d86444428dc0e34f084fb
This commit is contained in:
John Garbutt 2024-06-07 10:16:13 +01:00 committed by Pierre Riteau
parent c80d519998
commit 57eda87875
3 changed files with 12 additions and 1 deletions

View File

@ -29,6 +29,12 @@ RPC_API_VERSION = '1.0'
def get_target():
return messaging.Target(topic=CONF.manager.rpc_topic,
version=RPC_API_VERSION,
namespace='manager.api')
def get_service_target():
return messaging.Target(topic=CONF.manager.rpc_topic,
version=RPC_API_VERSION,
server=CONF.host,

View File

@ -71,7 +71,7 @@ class ManagerService(service_utils.RPCServer):
"""
def __init__(self):
target = manager.get_target()
target = manager.get_service_target()
super(ManagerService, self).__init__(target)
self.plugins = self._get_plugins()
self.resource_actions = self._setup_actions()

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Allow multiple Blazar API services to run against a single Blazar manager
service.