The nova.cells.rpc_driver Module

Cells RPC Communication Driver

class CellsRPCDriver(*args, **kwargs)

Bases: nova.cells.driver.BaseCellsDriver

Driver for cell<->cell communication via RPC. This is used to setup the RPC consumers as well as to send a message to another cell.

One instance of this class will be created for every neighbor cell that we find in the DB and it will be associated with the cell in its CellState.

One instance is also created by the cells manager for setting up the consumers.

send_message_to_cell(cell_state, message)

Use the IntercellRPCAPI to send a message to a cell.

start_servers(msg_runner)

Start RPC servers.

Start up 2 separate servers for handling inter-cell communication via RPC. Both handle the same types of messages, but requests/replies are separated to solve potential deadlocks. (If we used the same queue for both, it’s possible to exhaust the RPC thread pool while we wait for replies.. such that we’d never consume a reply.)

stop_servers()

Stop RPC servers.

NOTE: Currently there’s no hooks when stopping services to have managers cleanup, so this is not currently called.

class InterCellRPCAPI

Bases: object

Client side of the Cell<->Cell RPC API.

The CellsRPCDriver uses this to make calls to another cell.

API version history:

1.0 - Initial version.

... Grizzly supports message version 1.0. So, any changes to existing methods in 2.x after that point should be done such that they can handle the version_cap being set to 1.0.

VERSION_ALIASES = {'grizzly': '1.0'}
send_message_to_cell(cell_state, message)

Send a message to another cell by JSON-ifying the message and making an RPC cast to ‘process_message’. If the message says to fanout, do it. The topic that is used will be ‘CONF.rpc_driver_queue_base.<message_type>’.

class InterCellRPCDispatcher(msg_runner)

Bases: object

RPC Dispatcher to handle messages received from other cells.

All messages received here have come from a sibling cell. Depending on the ultimate target and type of message, we may process the message in this cell, relay the message to another sibling cell, or both. This logic is defined by the message class in the nova.cells.messaging module.

process_message(_ctxt, message)

We received a message from another cell. Use the MessageRunner to turn this from JSON back into an instance of the correct Message class. Then process it!

target = <Target version=1.0>

Previous topic

The nova.cells.opts Module

Next topic

The nova.cells.rpcapi Module

Project Source

This Page