ironic.drivers.modules.redfish.boot module

class ironic.drivers.modules.redfish.boot.RedfishHttpsBoot(*args, **kwargs)[source]

Bases: BootInterface

A driver which utilizes UefiHttp like virtual media.

Utilizes the virtual media image build to craft a ISO image to signal to remote BMC to boot.

This interface comes with some constraints. For example, this interface is built under the operating assumption that DHCP is used. The UEFI Firmware needs to load some base configuration, regardless. Also depending on UEFI Firmware, and how it handles UefiHttp Boot, additional ISO contents, such as “configuration drive” materials might be unavailable. A similar constraint exists with ramdisk deployment.

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 over virtual media.

This method prepares the boot of the instance after reading relevant information from the node’s instance_info.

The internal logic is as follows:

  • Cleanup any related files

  • Sync the boot mode with the machine.

  • Configure Secure boot, if required.

  • If local boot, or a whole disk image was deployed, set the next boot device as disk.

  • If “ramdisk” is the desired, then the UefiHttp boot option is set to the BMC with a request for this to be persistent.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

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

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of the agent ramdisk.

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.

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

class ironic.drivers.modules.redfish.boot.RedfishVirtualMediaBoot(*args, **kwargs)[source]

Bases: BootInterface

Virtual media boot interface over Redfish.

Virtual Media allows booting the system from the “virtual” CD/DVD drive containing the user image that BMC “inserts” into the drive.

The CD/DVD images must be in ISO format and (depending on BMC implementation) could be pulled over HTTP, served as iSCSI targets or NFS volumes.

The baseline boot workflow looks like this:

  1. Pull kernel, ramdisk and ESP (FAT partition image with EFI boot loader) images (ESP is only needed for UEFI boot)

  2. Create bootable ISO out of images (#1), push it to Glance and pass to the BMC as Swift temporary URL

  3. Optionally create floppy image with desired system configuration data, push it to Glance and pass to the BMC as Swift temporary URL

  4. Insert CD/DVD and (optionally) floppy images and set proper boot mode

For building deploy or rescue ISO, redfish boot interface uses deploy_kernel/deploy_ramdisk or rescue_kernel/rescue_ramdisk properties from [instance_info] or [driver_info].

For building boot (user) ISO, redfish boot interface seeks kernel_id and ramdisk_id properties in the Glance image metadata found in [instance_info]image_source node property.

capabilities = ['iscsi_volume_boot', 'ramdisk_boot', 'ramdisk_boot_configdrive']
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 over virtual media.

This method prepares the boot of the instance after reading relevant information from the node’s instance_info.

The internal logic is as follows:

  • If boot_option requested for this deploy is ‘local’, then set the node to boot from disk.

  • Unless boot_option requested for this deploy is ‘ramdisk’, pass root disk/partition ID to virtual media boot image

  • Otherwise build boot image, insert it into virtual media device and set node to boot from CD.

Parameters:

task – a task from TaskManager.

Returns:

None

Raises:

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

prepare_ramdisk(task, ramdisk_params)[source]

Prepares the boot of deploy or rescue ramdisk over 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.

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

ironic.drivers.modules.redfish.boot.eject_vmedia(task, boot_device=None)[source]

Eject virtual CDs and DVDs

Parameters:
  • task – A task from TaskManager.

  • boot_device – sushy boot device e.g. VIRTUAL_MEDIA_CD, VIRTUAL_MEDIA_DVD or VIRTUAL_MEDIA_FLOPPY or None to eject everything (default).

Raises:

InvalidParameterValue, if no suitable virtual CD or DVD is found on the node.

ironic.drivers.modules.redfish.boot.get_vmedia(task)[source]

Get the attached virtual CDs and DVDs for a node

Parameters:

task – A task from TaskManager.

Raises:

InvalidParameterValue, if no suitable virtual CD or DVD is found on the node.

ironic.drivers.modules.redfish.boot.insert_vmedia(task, image_url, device_type)[source]

Insert virtual CDs and DVDs

Parameters:
  • task – A task from TaskManager.

  • image_url

  • device_type – sushy boot device e.g. VIRTUAL_MEDIA_CD, VIRTUAL_MEDIA_DVD or VIRTUAL_MEDIA_FLOPPY or None to eject everything (default).

Raises:

InvalidParameterValue, if no suitable virtual CD or DVD is found on the node.