The nova.cells.rpcapi Module

Client side of nova-cells RPC API (for talking to the nova-cells service within a cell).

This is different than communication between child and parent nova-cells services. That communication is handled by the cells driver via the messaging module.

class CellsAPI

Bases: object

Cells client-side RPC API

API version history:

  • 1.0 - Initial version.

  • 1.1 - Adds get_cell_info_for_neighbors() and sync_instances()

  • 1.2 - Adds service_get_all(), service_get_by_compute_host(),

    and proxy_rpc_to_compute_manager()

  • 1.3 - Adds task_log_get_all()

  • 1.4 - Adds compute_node_get(), compute_node_get_all(), and

    compute_node_stats()

  • 1.5 - Adds actions_get(), action_get_by_request_id(), and

    action_events_get()

  • 1.6 - Adds consoleauth_delete_tokens() and validate_console_port()

... Grizzly supports message version 1.6. 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.6.

  • 1.7 - Adds service_update()

  • 1.8 - Adds build_instances(), deprecates schedule_run_instance()

  • 1.9 - Adds get_capacities()

  • 1.10 - Adds bdm_update_or_create_at_top(), and bdm_destroy_at_top()

  • 1.11 - Adds get_migrations()

  • 1.12 - Adds instance_start() and instance_stop()

  • 1.13 - Adds cell_create(), cell_update(), cell_delete(), and

    cell_get()

  • 1.14 - Adds reboot_instance()

  • 1.15 - Adds suspend_instance() and resume_instance()

  • 1.16 - Adds instance_update_from_api()

  • 1.17 - Adds get_host_uptime()

  • 1.18 - Adds terminate_instance() and soft_delete_instance()

  • 1.19 - Adds pause_instance() and unpause_instance()

  • 1.20 - Adds resize_instance() and live_migrate_instance()

  • 1.21 - Adds revert_resize() and confirm_resize()

  • 1.22 - Adds reset_network()

  • 1.23 - Adds inject_network_info()

  • 1.24 - Adds backup_instance() and snapshot_instance()

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

  • 1.25 - Adds rebuild_instance()
  • 1.26 - Adds service_delete()
  • 1.27 - Updates instance_delete_everywhere() for instance objects

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

  • 1.28 - Make bdm_update_or_create_at_top and use bdm objects
  • 1.29 - Adds set_admin_password()

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

  • 1.30 - Make build_instances() use flavor object

  • 1.31 - Add clean_shutdown to stop, resize, rescue, and shelve

  • 1.32 - Send objects for instances in build_instances()

  • 1.33 - Add clean_shutdown to resize_instance()

  • 1.34 - build_instances uses BlockDeviceMapping objects, drops

    legacy_bdm argument

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

  • 1.35 - Make instance_update_at_top, instance_destroy_at_top

    and instance_info_cache_update_at_top use instance objects

  • 1.36 - Added ‘delete_type’ parameter to terminate_instance()

  • 1.37 - Add get_keypair_at_top to fetch keypair from api cell

VERSION_ALIASES = {'juno': '1.29', 'kilo': '1.34', 'havana': '1.24', 'grizzly': '1.6', 'icehouse': '1.27'}
action_events_get(ctxt, instance, action_id)
action_get_by_request_id(ctxt, instance, request_id)
actions_get(ctxt, instance)
backup_instance(ctxt, instance, image_id, backup_type, rotation)
bdm_destroy_at_top(ctxt, instance_uuid, device_name=None, volume_id=None)

Broadcast upwards that a block device mapping was destroyed. One of device_name or volume_id should be specified.

bdm_update_or_create_at_top(ctxt, bdm, create=None)

Create or update a block device mapping in API cells. If create is True, only try to create. If create is None, try to update but fall back to create. If create is False, only attempt to update. This maps to nova-conductor’s behavior.

build_instances(ctxt, **kwargs)

Build instances.

bw_usage_update_at_top(ctxt, uuid, mac, start_period, bw_in, bw_out, last_ctr_in, last_ctr_out, last_refreshed=None)

Broadcast upwards that bw_usage was updated.

call_compute_api_method(ctxt, cell_name, method, *args, **kwargs)

Make a call to a compute API method in a certain cell.

cast_compute_api_method(ctxt, cell_name, method, *args, **kwargs)

Make a cast to a compute API method in a certain cell.

cell_create(ctxt, values)
cell_delete(ctxt, cell_name)
cell_get(ctxt, cell_name)
cell_update(ctxt, cell_name, values)
compute_node_get(ctxt, compute_id)

Get a compute node by ID in a specific cell.

compute_node_get_all(ctxt, hypervisor_match=None)

Return list of compute nodes in all cells, optionally filtering by hypervisor host.

compute_node_stats(ctxt)

Return compute node stats from all cells.

confirm_resize(ctxt, instance, migration, host, reservations, cast=True)
consoleauth_delete_tokens(ctxt, instance_uuid)

Delete consoleauth tokens for an instance in API cells.

get_capacities(ctxt, cell_name=None)
get_cell_info_for_neighbors(ctxt)

Get information about our neighbor cells from the manager.

get_host_uptime(context, host_name)

Gets the host uptime in a particular cell. The cell name should be encoded within the host_name

get_keypair_at_top(ctxt, user_id, name)
get_migrations(ctxt, filters)

Get all migrations applying the filters.

inject_network_info(ctxt, instance)

Inject networking for an instance.

instance_delete_everywhere(ctxt, instance, delete_type)

Delete instance everywhere. delete_type may be ‘soft’ or ‘hard’. This is generally only used to resolve races when API cell doesn’t know to what cell an instance belongs.

instance_destroy_at_top(ctxt, instance)

Destroy instance at API level.

instance_fault_create_at_top(ctxt, instance_fault)

Create an instance fault at the top.

instance_info_cache_update_at_top(ctxt, instance_info_cache)

Broadcast up that an instance’s info_cache has changed.

instance_update_at_top(ctxt, instance)

Update instance at API level.

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

Update an instance in its cell.

This method takes a new-world instance object.

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

Pause an instance in its cell.

This method takes a new-world instance object.

proxy_rpc_to_manager(ctxt, rpc_message, topic, call=False, timeout=None)

Proxy RPC to a compute manager. The host in the topic should be encoded with the target cell name.

reboot_instance(ctxt, instance, block_device_info, reboot_type)

Reboot an instance in its cell.

This method takes a new-world instance object.

rebuild_instance(ctxt, instance, new_pass, injected_files, image_ref, orig_image_ref, orig_sys_metadata, bdms, recreate=False, on_shared_storage=False, host=None, preserve_ephemeral=False, kwargs=None)
reset_network(ctxt, instance)

Reset networking for an instance.

resize_instance(ctxt, instance, extra_instance_updates, scheduler_hint, flavor, reservations, clean_shutdown=True)
resume_instance(ctxt, instance)

Resume an instance in its cell.

This method takes a new-world instance object.

revert_resize(ctxt, instance, migration, host, reservations)
service_delete(ctxt, cell_service_id)

Deletes the specified service.

service_get_all(ctxt, filters=None)

Ask all cells for their list of services.

service_get_by_compute_host(ctxt, host_name)

Get the service entry for a host in a particular cell. The cell name should be encoded within the host_name.

service_update(ctxt, 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.

Parameters:
  • 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}
set_admin_password(ctxt, instance, new_pass)
snapshot_instance(ctxt, instance, image_id)
soft_delete_instance(ctxt, instance, reservations=None)

Soft-delete an instance in its cell.

This method takes a new-world instance object.

start_instance(ctxt, instance)

Start an instance in its cell.

This method takes a new-world instance object.

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

Stop an instance in its cell.

This method takes a new-world instance object.

suspend_instance(ctxt, instance)

Suspend an instance in its cell.

This method takes a new-world instance object.

sync_instances(ctxt, project_id=None, updated_since=None, deleted=False)

Ask all cells to sync instance data.

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

Get the task logs from the DB in child cells.

terminate_instance(ctxt, instance, bdms, reservations=None, delete_type='delete')

Delete an instance in its cell.

This method takes a new-world instance object.

unpause_instance(ctxt, instance)

Unpause an instance in its cell.

This method takes a new-world instance object.

validate_console_port(ctxt, instance_uuid, console_port, console_type)

Validate console port with child cell compute node.

Previous topic

The nova.cells.rpc_driver Module

Next topic

The nova.cells.scheduler Module

Project Source

This Page