ironic.drivers.modules.redfish.boot module

class ironic.drivers.modules.redfish.boot.RedfishVirtualMediaBoot[source]

Bases: ironic.drivers.base.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.

IMAGE_SUBDIR = 'redfish'
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.

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

Raises

UnsupportedDriverExtension