ironic_python_agent.extensions.image module

class ironic_python_agent.extensions.image.ImageExtension(agent=None)[source]

Bases: ironic_python_agent.extensions.base.BaseAgentExtension

install_bootloader(root_uuid, efi_system_part_uuid=None, prep_boot_part_uuid=None, target_boot_mode='bios', ignore_bootloader_failure=None)[source]

Install the GRUB2 bootloader on the image.

Parameters
  • root_uuid – The UUID of the root partition.

  • efi_system_part_uuid – The UUID of the efi system partition. To be used only for uefi boot mode. For uefi boot mode, the boot loader will be installed here.

  • prep_boot_part_uuid – The UUID of the PReP Boot partition. Used only for booting ppc64* partition images locally. In this scenario the bootloader will be installed here.

  • target_boot_mode – bios, uefi. Only taken into account for softraid, when no efi partition is explicitely provided (happens for whole disk images)

Raises

CommandExecutionError if the installation of the bootloader fails.

Raises

DeviceNotFound if the root partition is not found.

ironic_python_agent.extensions.image.get_partition_path_by_number(device, part_num)[source]

Get partition path (/dev/something) by a partition number on device.

Only works for GPT partition table.

ironic_python_agent.extensions.image.prepare_boot_partitions_for_softraid(device, holders, efi_part, target_boot_mode)[source]

Prepare boot partitions when relevant.

Create either a RAIDed EFI partition or bios boot partitions for software RAID, according to both target boot mode and disk holders partition table types.

Parameters
  • device – the softraid device path

  • holders – the softraid drive members

  • efi_part – when relevant the efi partition coming from the image deployed on softraid device, can be/is often None

  • target_boot_mode – target boot mode can be bios/uefi/None or anything else for unspecified

Returns

the path to the ESP md device when target boot mode is uefi, nothing otherwise.