ironic.drivers.modules.ilo.boot module

Boot Interface for iLO drivers and its supporting methods.

class ironic.drivers.modules.ilo.boot.IloPXEBoot(*args, **kwargs)[source]

Bases: PXEBoot

clean_up_instance(task)[source]

Cleans up the boot of instance.

This method cleans up the PXE environment that was setup for booting the instance. It unlinks the instance kernel/ramdisk in the node’s directory in tftproot and removes it’s PXE config. In case of UEFI iSCSI booting, it cleans up iSCSI target information from the node.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

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 localboot, it cleans up the PXE config. In case of ‘boot from volume’, it updates the iSCSI info onto iLO and sets the node to boot from ‘UefiTarget’ boot device.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of Ironic ramdisk using PXE.

This method prepares the boot of the deploy or rescue 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.

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.

Raises:

IloOperationError, if some operation on iLO failed.

class ironic.drivers.modules.ilo.boot.IloUefiHttpsBoot(*args, **kwargs)[source]

Bases: BootInterface

capabilities = ['ramdisk_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.

Parameters:

task – A task from TaskManager.

Returns:

None

clean_up_ramdisk(task)[source]

Cleans up the boot of ironic ramdisk.

This method cleans up the environment that was setup for booting the deploy ramdisk.

Parameters:

task – A task from TaskManager.

Returns:

None

get_properties()[source]

Return the properties of the interface.

Returns:

dictionary of <property name>:<property description> entries.

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. It does the following depending on boot_option for deploy:

  • If the boot_option requested for this deploy is ‘local’ or image is a whole disk image, then it sets the node to boot from disk.

  • Otherwise it finds/creates the boot ISO, sets the node boot option to UEFIHTTP and sets the URL as the boot ISO to boot the instance image.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

Raises:

InstanceDeployFailure, if its try to boot iSCSI volume in ‘BIOS’ boot mode.

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of deploy ramdisk using UEFI-HTTPS boot.

This method prepares the boot of the deploy or rescue 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.

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.

Raises:

IloOperationError, if some operation on iLO failed.

validate(task)[source]

Validate the deployment information for the task’s node.

This method validates whether the ‘driver_info’ and/or ‘instance_info’ properties of the task’s node contains the required information for this interface to function.

Parameters:

task – A TaskManager instance containing the node to act on.

Raises:

InvalidParameterValue on malformed parameter(s)

Raises:

MissingParameterValue on missing parameter(s)

validate_inspection(task)[source]

Validate that the node has required properties for inspection.

Parameters:

task – A TaskManager instance with the node being checked

Raises:

MissingParameterValue if node is missing one or more required parameters

Raises:

UnsupportedDriverExtension

validate_rescue(task)[source]

Validate that the node has required properties for rescue.

Parameters:

task – a TaskManager instance with the node being checked

Raises:

MissingParameterValue if node is missing one or more required parameters

class ironic.drivers.modules.ilo.boot.IloVirtualMediaBoot(*args, **kwargs)[source]

Bases: BootInterface

capabilities = ['iscsi_volume_boot', 'ramdisk_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 ejects virtual media. In case of UEFI iSCSI booting, it cleans up iSCSI target information from the node.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

clean_up_ramdisk(task)[source]

Cleans up the boot of ironic ramdisk.

This method cleans up virtual media devices setup for the deploy or rescue ramdisk.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

get_properties()[source]

Return the properties of the interface.

Returns:

dictionary of <property name>:<property description> entries.

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. It does the following depending on boot_option for deploy:

  • If the boot mode is ‘uefi’ and its booting from volume, then it sets the iSCSI target info and node to boot from ‘UefiTarget’ boot device.

  • If not ‘boot from volume’ and the boot_option requested for this deploy is ‘local’ or image is a whole disk image, then it sets the node to boot from disk.

  • Otherwise it finds/creates the boot ISO to boot the instance image, attaches the boot ISO to the bare metal and then sets the node to boot from CDROM.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

Raises:

InstanceDeployFailure, if its try to boot iSCSI volume in ‘BIOS’ boot mode.

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of deploy ramdisk using virtual media.

This method prepares the boot of the deploy or rescue 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.

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.

Raises:

IloOperationError, if some operation on iLO failed.

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, if some information is invalid.

Raises:

MissingParameterValue if ‘kernel_id’ and ‘ramdisk_id’ are missing in the Glance image or ‘kernel’ and ‘ramdisk’ not provided in instance_info for non-Glance image.

validate_inspection(task)[source]

Validate that the node has required properties for inspection.

Parameters:

task – A TaskManager instance with the node being checked

Raises:

MissingParameterValue if node is missing one or more required parameters

Raises:

UnsupportedDriverExtension

validate_rescue(task)[source]

Validate that the node has required properties for rescue.

Parameters:

task – a TaskManager instance with the node being checked

Raises:

MissingParameterValue if node is missing one or more required parameters

class ironic.drivers.modules.ilo.boot.IloiPXEBoot(*args, **kwargs)[source]

Bases: iPXEBoot

clean_up_instance(task)[source]

Cleans up the boot of instance.

This method cleans up the PXE environment that was setup for booting the instance. It unlinks the instance kernel/ramdisk in the node’s directory in tftproot and removes it’s PXE config. In case of UEFI iSCSI booting, it cleans up iSCSI target information from the node.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

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 localboot, it cleans up the PXE config. In case of ‘boot from volume’, it updates the iSCSI info onto iLO and sets the node to boot from ‘UefiTarget’ boot device.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

IloOperationError, if some operation on iLO failed.

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of Ironic ramdisk using PXE.

This method prepares the boot of the deploy or rescue 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.

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.

Raises:

IloOperationError, if some operation on iLO failed.

ironic.drivers.modules.ilo.boot.parse_driver_info(node, mode='deploy')[source]

Gets the driver specific Node deployment info.

This method validates whether the ‘driver_info’ property of the supplied node contains the required information for this driver to deploy images to the node.

Parameters:
  • node – a single Node.

  • mode – Label indicating a deploy or rescue operation being carried out on the node. Supported values are ‘deploy’ and ‘rescue’. Defaults to ‘deploy’, indicating deploy operation is being carried out.

Returns:

A dict with the driver_info values.

Raises:

MissingParameterValue, if any of the required parameters are missing.

ironic.drivers.modules.ilo.boot.prepare_node_for_deploy(task)[source]

Common preparatory steps for all iLO drivers.

This method performs common preparatory steps required for all drivers. 1. Power off node 2. Disables secure boot, if it is in enabled state. 3. Updates boot_mode capability to ‘uefi’ if secure boot is requested. 4. Changes boot mode of the node if secure boot is disabled currently.

Parameters:

task – a TaskManager instance containing the node to act on.

Raises:

IloOperationError, if some operation on iLO failed.