ironic.conductor.utils.
abort_on_conductor_take_over
(*args, **kwargs)[source]¶Set node’s state when a task was aborted due to conductor take over.
Parameters: | task – a TaskManager instance. |
---|
ironic.conductor.utils.
build_configdrive
(node, configdrive)[source]¶Build a configdrive from provided meta_data, network_data and user_data.
If uuid or name are not provided in the meta_data, they’re defauled to the node’s uuid and name accordingly.
Parameters: |
|
---|---|
Returns: | A gzipped and base64 encoded configdrive as a string. |
ironic.conductor.utils.
cleaning_error_handler
(task, msg, tear_down_cleaning=True, set_fail_state=True)[source]¶Put a failed node in CLEANFAIL and maintenance.
ironic.conductor.utils.
cleanup_after_timeout
(*args, **kwargs)[source]¶Cleanup deploy task after timeout.
Parameters: | task – a TaskManager instance. |
---|
ironic.conductor.utils.
cleanup_cleanwait_timeout
(task)[source]¶Cleanup a cleaning task after timeout.
Parameters: | task – a TaskManager instance. |
---|
ironic.conductor.utils.
cleanup_rescuewait_timeout
(*args, **kwargs)[source]¶Cleanup rescue task after timeout.
Parameters: | task – a TaskManager instance. |
---|
ironic.conductor.utils.
deploying_error_handler
(task, logmsg, errmsg, traceback=False, clean_up=True)[source]¶Put a failed node in DEPLOYFAIL.
Parameters: |
|
---|
ironic.conductor.utils.
fast_track_able
(task)[source]¶Checks if the operation can be a streamlined deployment sequence.
This is mainly focused on ensuring that we are able to quickly sequence through operations if we already have a ramdisk heartbeating through external means.
Parameters: | task – Taskmanager object |
---|---|
Returns: | True if [deploy]fast_track is set to True, no iSCSI boot configuration is present, and no last_error is present for the node indicating that there was a recent failure. |
ironic.conductor.utils.
is_fast_track
(task)[source]¶Checks a fast track is available.
This method first ensures that the node and conductor configuration is valid to perform a fast track sequence meaning that we already have a ramdisk running through another means like discovery. If not valid, False is returned.
The method then checks for the last agent heartbeat, and if it occured within the timeout set by [deploy]fast_track_timeout and the power state for the machine is POWER_ON, then fast track is permitted.
Parameters: | node – A node object. |
---|---|
Returns: | True if the last heartbeat that was recorded was within the [deploy]fast_track_timeout setting. |
ironic.conductor.utils.
node_get_boot_mode
(task)[source]¶Read currently set boot mode from a node.
Reads the boot mode for a node. If boot mode can’t be discovered, None is returned.
Parameters: | task – a TaskManager instance. |
---|---|
Raises: | DriverOperationError or its derivative in case of driver runtime error. |
Raises: | UnsupportedDriverExtension if current driver does not have management interface or get_boot_mode() method is not supported. |
Returns: | Boot mode. One of ironic.common.boot_mode or None
if boot mode can’t be discovered |
ironic.conductor.utils.
node_power_action
(*args, **kwargs)[source]¶Change power state or reset for a node.
Perform the requested power action if the transition is required.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue when the wrong state is specified or the wrong driver info is specified. |
Raises: | StorageError when a failure occurs updating the node’s storage interface upon setting power on. |
Raises: | other exceptions by the node’s power driver if something wrong occurred during the power action. |
ironic.conductor.utils.
node_set_boot_device
(*args, **kwargs)[source]¶Set the boot device for a node.
If the node that the boot device change is being requested for is in ADOPTING state, the boot device will not be set as that change could potentially result in the future running state of an adopted node being modified erroneously.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue if the validation of the ManagementInterface fails. |
ironic.conductor.utils.
node_set_boot_mode
(*args, **kwargs)[source]¶Set the boot mode for a node.
Sets the boot mode for a node if the node’s driver interface contains a ‘management’ interface.
If the node that the boot mode change is being requested for is in ADOPTING state, the boot mode will not be set as that change could potentially result in the future running state of an adopted node being modified erroneously.
Parameters: |
|
---|---|
Raises: | InvalidParameterValue if the validation of the ManagementInterface fails. |
Raises: | DriverOperationError or its derivative in case of driver runtime error. |
Raises: | UnsupportedDriverExtension if current driver does not have vendor interface or method is unsupported. |
ironic.conductor.utils.
node_wait_for_power_state
(task, new_state, timeout=None)[source]¶Wait for node to be in new power state.
Parameters: |
|
---|---|
Raises: | PowerStateFailure if timed out |
ironic.conductor.utils.
power_on_node_if_needed
(task)[source]¶Powers on node if it is powered off and has a Smart NIC port
Parameters: | task – A TaskManager object |
---|---|
Returns: | the previous power state or None if no changes were made |
Raises: | exception.NetworkError if agent status didn’t match the required status after max retry attempts. |
ironic.conductor.utils.
power_state_error_handler
(e, node, power_state)[source]¶Set the node’s power states if error occurs.
This hook gets called upon an exception being raised when spawning the worker thread to change the power state of a node.
Parameters: |
|
---|
ironic.conductor.utils.
provisioning_error_handler
(e, node, provision_state, target_provision_state)[source]¶Set the node’s provisioning states if error occurs.
This hook gets called upon an exception being raised when spawning the worker to do some provisioning to a node like deployment, tear down, or cleaning.
Parameters: |
|
---|
ironic.conductor.utils.
remove_node_rescue_password
(node, save=True)[source]¶Helper to remove rescue password from a node.
Removes rescue password from node. It saves node by default. If node should not be saved, then caller needs to explicitly indicate it.
Parameters: |
|
---|
ironic.conductor.utils.
rescuing_error_handler
(task, msg, set_fail_state=True)[source]¶Cleanup rescue task after timeout or failure.
Parameters: |
|
---|
ironic.conductor.utils.
restore_power_state_if_needed
(task, power_state_to_restore)[source]¶Change the node’s power state if power_state_to_restore is not None
Parameters: |
|
---|
ironic.conductor.utils.
skip_automated_cleaning
(node)[source]¶Checks if node cleaning needs to be skipped for an specific node.
Parameters: | node – the node to consider |
---|
ironic.conductor.utils.
spawn_cleaning_error_handler
(e, node)[source]¶Handle spawning error for node cleaning.
ironic.conductor.utils.
spawn_deploying_error_handler
(e, node)[source]¶Handle spawning error for node deploying.
ironic.conductor.utils.
spawn_rescue_error_handler
(e, node)[source]¶Handle spawning error for node rescue.
ironic.conductor.utils.
validate_instance_info_traits
(node)[source]¶Validate traits in instance_info.
All traits in instance_info must also exist as node traits.
Parameters: | node – an Ironic node object. |
---|---|
Raises: | InvalidParameterValue if the instance traits are badly formatted, or contain traits that are not set on the node. |
ironic.conductor.utils.
validate_port_physnet
(*args, **kwargs)[source]¶Validate the consistency of physical networks of ports in a portgroup.
Validate the consistency of a port’s physical network with other ports in the same portgroup. All ports in a portgroup should have the same value (which may be None) for their physical_network field.
During creation or update of a port in a portgroup we apply the following validation criteria:
If a port’s physical network is None, this indicates that ironic’s VIF attachment mapping algorithm should operate in a legacy (physical network unaware) mode for this port or portgroup. This allows existing ironic nodes to continue to function after an upgrade to a release including physical network support.
Parameters: |
|
---|---|
Raises: | Conflict if the port is a member of a portgroup which is on a different physical network. |
Raises: | PortgroupPhysnetInconsistent if the port’s portgroup has ports which are not all assigned the same physical network. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.