ironic.conductor.manager module¶
Conduct all activity related to bare-metal deployments.
A single instance of ironic.conductor.manager.ConductorManager
is
created within the ironic-conductor process, and is responsible for
performing all actions on bare metal resources (Chassis, Nodes, and Ports).
Commands are received via RPCs. The conductor service also performs periodic
tasks, eg. to monitor the status of active deployments.
Drivers are loaded via entrypoints by the
ironic.common.driver_factory
class. Each driver is instantiated
only once, when the ConductorManager service starts. In this way, a single
ConductorManager may use multiple drivers, and manage heterogeneous hardware.
When multiple ConductorManager
are run on different hosts, they are
all active and cooperatively manage all nodes in the deployment. Nodes are
locked by each conductor when performing actions which change the state of that
node; these locks are represented by the
ironic.conductor.task_manager.TaskManager
class.
A tooz.hashring.HashRing is used to distribute nodes across the set of active conductors which support each node’s driver. Rebalancing this ring can trigger various actions by each conductor, such as building or tearing down the TFTP environment for a node, notifying Neutron of a change, etc.
- class ironic.conductor.manager.ConductorManager(host, topic='ironic.conductor_manager')[source]¶
Bases:
BaseConductorManager
Ironic Conductor manager main class.
- RPC_API_VERSION = '1.61'¶
- add_node_traits(**kwargs)¶
- attach_virtual_media(**kwargs)¶
- change_node_boot_mode(**kwargs)¶
- change_node_power_state(**kwargs)¶
- change_node_secure_boot(**kwargs)¶
- continue_inspection(**kwargs)¶
- continue_node_clean(context, node_id)[source]¶
RPC method to continue cleaning a node.
This is useful for cleaning tasks that are async. When they complete, they call back via RPC, a new worker and lock are set up, and cleaning continues. This can also be used to resume cleaning on take_over.
- Parameters:
context – an admin context.
node_id – the id or uuid of a node.
- Raises:
InvalidStateRequested if the node is not in CLEANWAIT state
- Raises:
NoFreeConductorWorker when there is no free worker to start async task
- Raises:
NodeLocked if node is locked by another conductor.
- Raises:
NodeNotFound if the node no longer appears in the database
- continue_node_deploy(context, node_id)[source]¶
RPC method to continue deploying a node.
This is useful for deploying tasks that are async. When they complete, they call back via RPC, a new worker and lock are set up, and deploying continues. This can also be used to resume deploying on take_over.
- Parameters:
context – an admin context.
node_id – the ID or UUID of a node.
- Raises:
InvalidStateRequested if the node is not in DEPLOYWAIT state
- Raises:
NoFreeConductorWorker when there is no free worker to start async task
- Raises:
NodeLocked if node is locked by another conductor.
- Raises:
NodeNotFound if the node no longer appears in the database
- continue_node_service(context, node_id)[source]¶
RPC method to continue servicing a node.
This is useful for servicing tasks that are async. When they complete, they call back via RPC, a new worker and lock are set up, and servicing continues. This can also be used to resume servicing on take_over.
- Parameters:
context – an admin context.
node_id – the ID or UUID of a node.
- Raises:
InvalidStateRequested if the node is not in SERVICEWAIT state
- Raises:
NoFreeConductorWorker when there is no free worker to start async task
- Raises:
NodeLocked if node is locked by another conductor.
- Raises:
NodeNotFound if the node no longer appears in the database
- create_allocation(**kwargs)¶
- create_node(**kwargs)¶
- create_port(**kwargs)¶
- destroy_allocation(**kwargs)¶
- destroy_node(**kwargs)¶
- destroy_port(**kwargs)¶
- destroy_portgroup(**kwargs)¶
- destroy_volume_connector(**kwargs)¶
- destroy_volume_target(**kwargs)¶
- detach_virtual_media(context, node_id, device_types=None)[source]¶
Detach some or all virtual media devices from the node.
- Parameters:
context – request context.
node_id – node ID or UUID.
device_types – A collection of device type, ones from
ironic.common.boot_devices.VMEDIA_DEVICES
. If not provided, all devices are detached.
- Raises:
UnsupportedDriverExtension if the driver does not support this call.
- Raises:
InvalidParameterValue if validation of management driver interface failed.
- Raises:
NodeLocked if node is locked by another conductor.
- Raises:
NoFreeConductorWorker when there is no free worker to start async task.
- do_node_clean(**kwargs)¶
- do_node_deploy(**kwargs)¶
- do_node_rescue(**kwargs)¶
- do_node_service(**kwargs)¶
- do_node_tear_down(**kwargs)¶
- do_node_unrescue(**kwargs)¶
- do_provisioning_action(**kwargs)¶
- driver_vendor_passthru(**kwargs)¶
- get_boot_device(**kwargs)¶
- get_console_information(**kwargs)¶
- get_driver_properties(**kwargs)¶
- get_driver_vendor_passthru_methods(**kwargs)¶
- get_indicator_state(**kwargs)¶
- get_node_vendor_passthru_methods(**kwargs)¶
- get_node_with_token(**kwargs)¶
- get_raid_logical_disk_properties(**kwargs)¶
- get_supported_boot_devices(**kwargs)¶
- get_supported_indicators(**kwargs)¶
- get_virtual_media(**kwargs)¶
- heartbeat(**kwargs)¶
- inject_nmi(**kwargs)¶
- inspect_hardware(**kwargs)¶
- object_action(context, objinst, objmethod, args, kwargs)[source]¶
Perform an action on a VersionedObject instance.
- Parameters:
context – The context within which to perform the action
objinst – The object instance on which to perform the action
objmethod – The name of the action method to call
args – The positional arguments to the action method
kwargs – The keyword arguments to the action method
- Returns:
A tuple with the updates made to the object and the result of the action method
- object_backport_versions(context, objinst, object_versions)[source]¶
Perform a backport of an object instance.
The default behavior of the base VersionedObjectSerializer, upon receiving an object with a version newer than what is in the local registry, is to call this method to request a backport of the object.
- Parameters:
context – The context within which to perform the backport
objinst – An instance of a VersionedObject to be backported
object_versions – A dict of {objname: version} mappings
- Returns:
The downgraded instance of objinst
- object_class_action_versions(context, objname, objmethod, object_versions, args, kwargs)[source]¶
Perform an action on a VersionedObject class.
- Parameters:
context – The context within which to perform the action
objname – The registry name of the object
objmethod – The name of the action method to call
object_versions – A dict of {objname: version} mappings
args – The positional arguments to the action method
kwargs – The keyword arguments to the action method
- Returns:
The result of the action method, which may (or may not) be an instance of the implementing VersionedObject class.
- remove_node_traits(**kwargs)¶
- set_boot_device(**kwargs)¶
- set_console_mode(**kwargs)¶
- set_indicator_state(**kwargs)¶
- set_target_raid_config(**kwargs)¶
- target = <Target version=1.61>¶
- update_node(**kwargs)¶
- update_port(**kwargs)¶
- update_portgroup(**kwargs)¶
- update_volume_connector(**kwargs)¶
- update_volume_target(**kwargs)¶
- validate_driver_interfaces(**kwargs)¶
- vendor_passthru(**kwargs)¶
- vif_attach(**kwargs)¶
- vif_detach(**kwargs)¶
- vif_list(**kwargs)¶
- ironic.conductor.manager.do_attach_virtual_media(task, device_type, image_url, image_download_source)[source]¶
- ironic.conductor.manager.do_sync_power_state(task, count)[source]¶
Sync the power state for this node, incrementing the counter on failure.
When the limit of power_state_sync_max_retries is reached, the node is put into maintenance mode and the error recorded.
- Parameters:
task – a TaskManager instance
count – number of times this node has previously failed a sync
- Raises:
NodeLocked if unable to upgrade task lock to an exclusive one
- Returns:
Count of failed attempts. On success, the counter is set to 0. On failure, the count is incremented by one
- ironic.conductor.manager.handle_sync_power_state_max_retries_exceeded(task, actual_power_state, exception=None)[source]¶
Handles power state sync exceeding the max retries.
When synchronizing the power state between a node and the DB has exceeded the maximum number of retries, change the DB power state to be the actual node power state and place the node in maintenance.
- Parameters:
task – a TaskManager instance with an exclusive lock
actual_power_state – the actual power state of the node; a power state from ironic.common.states
exception – the exception object that caused the sync power state to fail, if present.