ironic.conductor.deployments module

Functionality related to deploying and undeploying.

ironic.conductor.deployments.apply_automatic_lessee(task)[source]

Apply a automatic lessee to the node, if applicable

First of all, until removed next cycle, we check to see if CONF.automatic_lessee was explicitly set “False” by an operator – if so, we do not apply a lessee.

When CONF.conductor.automatic_lessee_source is instance: - Take the lessee from instance_info[project_id] (e.g. as set by nova)

When CONF.conductor.automatic_lessee_source is request: - Take the lessee from request context (e.g. from keystone)

When CONF.conductor.automatic_lessee_source is none: OR the legacy CONF.automatic_lessee is explicitly set by an operator to False (regardless of lessee_source) - Don’t apply a lessee to the node

Parameters:

task – a TaskManager instance.

Returns:

True if node had a lessee applied

ironic.conductor.deployments.continue_node_deploy(task)[source]

Continue deployment after finishing an async deploy step.

This function calculates which step has to run next and passes control into do_next_deploy_step. On the first run, deploy steps and templates are also validated.

Parameters:

task – a TaskManager instance with an exclusive lock

ironic.conductor.deployments.do_next_deploy_step(task, step_index)[source]

Do deployment, starting from the specified deploy step.

Parameters:
  • task – a TaskManager instance with an exclusive lock

  • step_index – The first deploy step in the list to execute. This is the index (from 0) into the list of deploy steps in the node’s driver_internal_info[‘deploy_steps’]. Is None if there are no steps to execute.

ironic.conductor.deployments.do_node_deploy(task, conductor_id=None, configdrive=None, deploy_steps=None)[source]

Prepare the environment and deploy a node.

ironic.conductor.deployments.execute_step_on_child_nodes(task, step)[source]

Execute a requested step against a child node.

Parameters:
  • task – The TaskManager object for the parent node.

  • step – The requested step to be executed.

Returns:

None on Success, the resulting error message if a failure has occurred.

ironic.conductor.deployments.start_deploy(task, manager, configdrive=None, event='deploy', deploy_steps=None)[source]

Start deployment or rebuilding on a node.

This function does not check the node suitability for deployment, it’s left up to the caller.

Parameters:
  • task – a TaskManager instance.

  • manager – a ConductorManager to run tasks on.

  • configdrive – a configdrive, if requested.

  • event – event to process: deploy or rebuild.

  • deploy_steps – Optional deploy steps.

ironic.conductor.deployments.validate_deploy_steps(task)[source]

Validate the deploy steps after the ramdisk learns about them.

ironic.conductor.deployments.validate_node(task, event='deploy')[source]

Validate that a node is suitable for deployment/rebuilding.

Parameters:
  • task – a TaskManager instance.

  • event – event to process: deploy or rebuild.

Raises:

NodeInMaintenance, NodeProtected, InvalidStateRequested, BootModeNotAllowed