ironic.drivers.modules.autodetect module¶
- class ironic.drivers.modules.autodetect.AutodetectDeploy(*args, **kwargs)[source]¶
Bases:
HeartbeatMixin,DeployInterfaceDeploy interface that auto-detects the appropriate deployment method.
This interface never performs any real work itself: it only resolves which concrete deploy interface should be used and switches the node over to it. The conductor calls switch_interface() at the start of every flow which may act on a node, so by the time any work method would run, a concrete interface is in place. Every method which would otherwise do actual work therefore fails loudly rather than silently doing nothing.
Inherits from HeartbeatMixin so that heartbeats received while autodetect is the active deploy interface (e.g. during inspection) store agent_url in driver_internal_info. Without this, fast-track deployment fails with AgentConnectionFailed because agent_url was never recorded.
- clean_up(task)[source]¶
Clean up the deployment environment for the task’s node.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- deploy(task)[source]¶
Perform a deployment to the task’s node.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- get_properties()[source]¶
Return the properties of the interface.
- Returns:
dictionary of <property name>:<property description> entries.
- prepare(task)[source]¶
Prepare the deployment environment for the task’s node.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- prepare_cleaning(task)[source]¶
Prepare the node for cleaning tasks.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- prepare_service(task)[source]¶
Prepare the node for servicing tasks.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- switch_interface(task)[source]¶
Switch the interface to use for deployment.
This calls supports_deploy() methods of deploy interfaces configured in the ‘autodetect_deploy_interfaces’ option, in order, to determine which interface is supported for the current node/image. The first interface that returns True from supports_deploy() is chosen. If no interfaces are detected as supported, the last interface in the list is chosen as the fallback.
- Raises:
InvalidParameterValue if the interface is not enabled.
- Parameters:
task – A TaskManager instance containing the node to act on.
- take_over(task)[source]¶
Take over management of this task’s node.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- tear_down(task)[source]¶
Tear down a previous deployment on the task’s node.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- tear_down_cleaning(task)[source]¶
Tear down after cleaning is completed.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- tear_down_service(task)[source]¶
Tear down after servicing is completed.
Never reached: the conductor switches to a concrete interface first. See the class docstring.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
InstanceDeployFailure always.
- validate(task)[source]¶
Validate the driver-specific Node deployment info.
This method creates the deploy interface that would be switched to and calls its validate() method.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Raises:
MissingParameterValue if required parameters are missing.