The ironic.drivers.modules.iscsi_deploy Module

class ironic.drivers.modules.iscsi_deploy.ISCSIDeploy[source]

Bases: ironic.drivers.base.DeployInterface

PXE Deploy Interface for deploy-related actions.

clean_up(task)[source]

Clean up the deployment environment for the task’s node.

Unlinks TFTP and instance images and triggers image cache cleanup. Removes the TFTP configuration files for this node. As a precaution, this method also ensures the keystone auth token file was removed.

Parameters:task – a TaskManager instance containing the node to act on.
deploy(*args, **kwargs)[source]

Start deployment of the task’s node.

Fetches instance image, creates a temporary keystone token file, updates the DHCP port options for next boot, and issues a reboot request to the power driver. This causes the node to boot into the deployment ramdisk and triggers the next phase of PXE-based deployment via VendorPassthru.pass_deploy_info().

Parameters:task – a TaskManager instance containing the node to act on.
Returns:deploy state DEPLOYWAIT.
execute_clean_step(task, step)[source]

Execute a clean step asynchronously on the agent.

Parameters:
  • task – a TaskManager object containing the node
  • step – a clean step dictionary to execute
Raises:

NodeCleaningFailure if the agent does not return a command status

Returns:

states.CLEANWAIT to signify the step will be completed asynchronously.

get_clean_steps(task)[source]

Get the list of clean steps from the agent.

Parameters:task – a TaskManager object containing the node
Raises NodeCleaningFailure:
 if the clean steps are not yet available (cached), for example, when a node has just been enrolled and has not been cleaned yet.
Returns:A list of clean step dictionaries. If bash ramdisk is used for this node, it returns an empty list.
get_properties()[source]
prepare(task)[source]

Prepare the deployment environment for this task’s node.

Generates the TFTP configuration for PXE-booting both the deployment and user images, fetches the TFTP image from Glance and add it to the local cache.

Parameters:task – a TaskManager instance containing the node to act on.
prepare_cleaning(task)[source]

Boot into the agent to prepare for cleaning.

Parameters:task – a TaskManager object containing the node
Raises NodeCleaningFailure:
 if the previous cleaning ports cannot be removed or if new cleaning ports cannot be created
Returns:states.CLEANWAIT to signify an asynchronous prepare.
take_over(task)[source]
tear_down(*args, **kwargs)[source]

Tear down a previous deployment on the task’s node.

Power off the node. All actual clean-up is done in the clean_up() method which should be called separately.

Parameters:task – a TaskManager instance containing the node to act on.
Returns:deploy state DELETED.
tear_down_cleaning(task)[source]

Clean up the PXE and DHCP files after cleaning.

Parameters:task – a TaskManager object containing the node
Raises NodeCleaningFailure:
 if the cleaning ports cannot be removed
validate(task)[source]

Validate the deployment information for the task’s node.

Parameters:task – a TaskManager instance containing the node to act on.
Raises:InvalidParameterValue.
Raises:MissingParameterValue
class ironic.drivers.modules.iscsi_deploy.InstanceImageCache[source]

Bases: ironic.drivers.modules.image_cache.ImageCache

class ironic.drivers.modules.iscsi_deploy.VendorPassthru[source]

Bases: ironic.drivers.modules.agent_base_vendor.BaseAgentVendor

Interface to mix IPMI and PXE vendor-specific interfaces.

continue_deploy(*args, **kwargs)[source]

Method invoked when deployed with the IPA ramdisk.

This method is invoked during a heartbeat from an agent when the node is in wait-call-back state. This deploys the image on the node and then configures the node to boot according to the desired boot option (netboot or localboot).

Parameters:
  • task – a TaskManager object containing the node.
  • kwargs – the kwargs passed from the heartbeat method.
Raises:

InstanceDeployFailure, if it encounters some error during the deploy.

pass_bootloader_install_info(*args, **kwargs)[source]

Accepts the results of bootloader installation.

This method acts as a vendor passthru and accepts the result of the bootloader installation. If bootloader installation was successful, then it notifies the bare metal to proceed to reboot and makes the instance active. If the bootloader installation failed, then it sets provisioning as failed and powers off the node.

Parameters:
  • task – A TaskManager object.
  • kwargs

    The arguments sent with vendor passthru. The expected kwargs are:

    'key': The deploy key for authorization
    'status': 'SUCCEEDED' or 'FAILED'
    'error': The error message if status == 'FAILED'
    'address': The IP address of the ramdisk
    
pass_deploy_info(*args, **kwargs)[source]

Continues the deployment of baremetal node over iSCSI.

This method continues the deployment of the baremetal node over iSCSI from where the deployment ramdisk has left off.

Parameters:
  • task – a TaskManager instance containing the node to act on.
  • kwargs – kwargs for performing iscsi deployment.
Raises:

InvalidState

validate(task, method, **kwargs)[source]

Validates the inputs for a vendor passthru.

If invalid, raises an exception; otherwise returns None.

Valid methods: * pass_deploy_info * pass_bootloader_install_info

Parameters:
  • task – a TaskManager instance containing the node to act on.
  • method – method to be validated.
  • kwargs – kwargs containins the method’s parameters.
Raises:

InvalidParameterValue if any parameters is invalid.

Project Source

This Page