ironic.drivers.modules.pxe module

PXE Boot Interface

class ironic.drivers.modules.pxe.PXEBoot[source]

Bases: ironic.drivers.modules.pxe_base.PXEBaseMixin, ironic.drivers.base.BootInterface

capabilities = ['iscsi_volume_boot', 'ramdisk_boot', 'ipxe_boot', 'pxe_boot']
clean_up_instance(task)[source]

Cleans up the boot of instance.

This method cleans up the environment that was setup for booting the instance. It unlinks the instance kernel/ramdisk in node’s directory in tftproot and removes the PXE config.

Parameters

task – a task from TaskManager.

Returns

None

prepare_instance(task)[source]

Prepares the boot of instance.

This method prepares the boot of the instance after reading relevant information from the node’s instance_info. In case of netboot, it updates the dhcp entries and switches the PXE config. In case of localboot, it cleans up the PXE config.

Parameters

task – a task from TaskManager.

Returns

None

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of Ironic ramdisk using PXE.

This method prepares the boot of the deploy or rescue kernel/ramdisk after reading relevant information from the node’s driver_info and instance_info.

Parameters
  • task – a task from TaskManager.

  • ramdisk_params – the parameters to be passed to the ramdisk. pxe driver passes these parameters as kernel command-line arguments.

Returns

None

Raises

MissingParameterValue, if some information is missing in node’s driver_info or instance_info.

Raises

InvalidParameterValue, if some information provided is invalid.

Raises

IronicException, if some power or set boot boot device operation failed on the node.

validate(task)[source]

Validate the PXE-specific info for booting deploy/instance images.

This method validates the PXE-specific info for booting the ramdisk and instance on the node. If invalid, raises an exception; otherwise returns None.

Parameters

task – a task from TaskManager.

Returns

None

Raises

InvalidParameterValue, if some parameters are invalid.

Raises

MissingParameterValue, if some required parameters are missing.

class ironic.drivers.modules.pxe.PXERamdiskDeploy[source]

Bases: ironic.drivers.modules.agent.AgentDeploy

deploy(task)[source]

Perform a deployment to a node.

Perform the necessary work to deploy an image onto the specified node. This method will be called after prepare(), which may have already performed any preparatory steps, such as pre-caching some data for the node.

Parameters

task – a TaskManager instance.

Returns

status of the deploy. One of ironic.common.states.

prepare(task)[source]

Prepare the deployment environment for this node.

Parameters

task – a TaskManager instance.

Raises

NetworkError: if the previous cleaning ports cannot be removed or if new cleaning ports cannot be created.

Raises

InvalidParameterValue when the wrong power state is specified or the wrong driver info is specified for power management.

Raises

StorageError If the storage driver is unable to attach the configured volumes.

Raises

other exceptions by the node’s power driver if something wrong occurred during the power action.

Raises

exception.ImageRefValidationFailed if image_source is not Glance href and is not HTTP(S) URL.

Raises

exception.InvalidParameterValue if network validation fails.

Raises

any boot interface’s prepare_ramdisk exceptions.

validate(task)[source]

Validate the driver-specific Node deployment info.

This method validates whether the properties of the supplied node contain the required information for this driver to deploy images to the node.

Parameters

task – a TaskManager instance

Raises

MissingParameterValue, if any of the required parameters are missing.

Raises

InvalidParameterValue, if any of the parameters have invalid value.