The nova.cells.messaging Module

Cell messaging module.

This module defines the different message types that are passed between cells and the methods that they can call when the target cell has been reached.

The interface into this module is the MessageRunner class.

class MessageRunner(state_manager)

Bases: object

This class is the main interface into creating messages and processing them.

Public methods in this class are typically called by the CellsManager to create a new message and process it with the exception of ‘message_from_json’ which should be used by CellsDrivers to convert a JSONified message it has received back into the appropriate Message class.

Private methods are used internally when we need to keep some ‘global’ state. For instance, eventlet queues used for responses are held in this class. Also, when a Message is process()ed above and it’s determined we should take action locally, _process_message_locally() will be called.

When needing to add a new method to call in a Cell2Cell message, define the new method below and also add it to the appropriate MessageMethods class where the real work will be done.

action_events_get(ctxt, cell_name, action_id)
action_get_by_request_id(ctxt, cell_name, instance_uuid, request_id)
actions_get(ctxt, cell_name, instance_uuid)

Tell child cells to send us capabilities. This is typically called on startup of the nova-cells service.


Tell child cells to send us capacities. This is typically called on startup of the nova-cells service.

backup_instance(ctxt, instance, image_id, backup_type, rotation)

Backup an instance in its cell.

bdm_destroy_at_top(ctxt, instance_uuid, device_name=None, volume_id=None)

Destroy a BDM at top level cell.

bdm_update_or_create_at_top(ctxt, bdm, create=None)

Update/Create a BDM at top level cell.

build_instances(ctxt, target_cell, build_inst_kwargs)

Called by the cell scheduler to tell a child cell to build instance(s).

bw_usage_update_at_top(ctxt, bw_update_info)

Update bandwidth usage at top level cell.

compute_node_get(ctxt, cell_name, compute_id)

Return compute node entry from a specific cell by ID.

compute_node_get_all(ctxt, hypervisor_match=None)

Return list of compute nodes in all child cells.


Return compute node stats from all child cells.

confirm_resize(ctxt, instance)

Confirm a resize for an instance in its cell.

consoleauth_delete_tokens(ctxt, instance_uuid)

Delete consoleauth tokens for an instance in API cells.

get_host_uptime(ctxt, cell_name, host_name)
get_keypair_at_top(ctxt, user_id, name)

Get Key Pair by name at top level cell.

static get_message_types()
get_migrations(ctxt, cell_name, run_locally, filters)

Fetch all migrations applying the filters for a given cell or all cells.

inject_network_info(ctxt, instance)

Inject networking for an instance in its cell.

instance_delete_everywhere(ctxt, instance, delete_type)

This is used by API cell when it didn’t know what cell an instance was in, but the instance was requested to be deleted or soft_deleted. So, we’ll broadcast this everywhere.

instance_destroy_at_top(ctxt, instance)

Destroy an instance at the top level cell.

instance_fault_create_at_top(ctxt, instance_fault)

Create an instance fault at the top level cell.

instance_update_at_top(ctxt, instance)

Update an instance at the top level cell.

instance_update_from_api(ctxt, instance, expected_vm_state, expected_task_state, admin_state_reset)

Update an instance object in its cell.

live_migrate_instance(ctxt, instance, block_migration, disk_over_commit, host_name)

Live migrate an instance in its cell.


Turns a message in JSON format into an appropriate Message instance. This is called when cells receive a message from another cell.

pause_instance(ctxt, instance)

Pause an instance in its cell.

proxy_rpc_to_manager(ctxt, cell_name, host_name, topic, rpc_message, call, timeout)
reboot_instance(ctxt, instance, reboot_type)

Reboot an instance in its cell.

rebuild_instance(ctxt, instance, image_href, admin_password, files_to_inject, preserve_ephemeral, kwargs)
reset_network(ctxt, instance)

Reset networking for an instance in its cell.

resize_instance(ctxt, instance, flavor, extra_instance_updates, clean_shutdown=True)

Resize an instance in its cell.

resume_instance(ctxt, instance)

Resume an instance in its cell.

revert_resize(ctxt, instance)

Revert a resize for an instance in its cell.

run_compute_api_method(ctxt, cell_name, method_info, call)

Call a compute API method in a specific cell.

service_delete(ctxt, cell_name, service_id)

Deletes the specified service.

service_get_all(ctxt, filters=None)
service_get_by_compute_host(ctxt, cell_name, host_name)
service_update(ctxt, cell_name, host_name, binary, params_to_update)

Used to enable/disable a service. For compute services, setting to disabled stops new builds arriving on that host.

  • host_name – the name of the host machine that the service is running
  • binary – The name of the executable that the service runs as
  • params_to_update – eg. {‘disabled’: True}

the update service object

set_admin_password(ctxt, instance, new_pass)
snapshot_instance(ctxt, instance, image_id)

Snapshot an instance in its cell.

soft_delete_instance(ctxt, instance)
start_instance(ctxt, instance)

Start an instance in its cell.

stop_instance(ctxt, instance, do_cast=True, clean_shutdown=True)

Stop an instance in its cell.

suspend_instance(ctxt, instance)

Suspend an instance in its cell.

sync_instances(ctxt, project_id, updated_since, deleted)

Force a sync of all instances, potentially by project_id, and potentially since a certain date/time.

task_log_get_all(ctxt, cell_name, task_name, period_beginning, period_ending, host=None, state=None)

Get task logs from the DB from all cells or a particular cell.

If ‘cell_name’ is None or ‘’, get responses from all cells. If ‘host’ is not None, filter by host. If ‘state’ is not None, filter by state.

Return a list of Response objects.


Send our capabilities to parent cells.


Send our capacities to parent cells.

terminate_instance(ctxt, instance, delete_type='delete')
unpause_instance(ctxt, instance)

Unpause an instance in its cell.

validate_console_port(ctxt, cell_name, instance_uuid, console_port, console_type)

Validate console port with child cell compute node.

class Response(ctxt, cell_name, value, failure)

Bases: object

Holds a response from a cell. If there was a failure, ‘failure’ will be True and ‘response’ will contain an encoded Exception.

classmethod from_json(ctxt, json_message)
deserialize_remote_exception(data, allowed_remote_exmods)
serialize_remote_exception(failure_info, log_failure=True)

Prepares exception data to be sent over rpc.

Failure_info should be a sys.exc_info() tuple.

Previous topic

The nova.cells.manager Module

Next topic

The nova.cells.opts Module

Project Source

This Page