ironic_python_agent.raid_utils module

ironic_python_agent.raid_utils.calc_raid_partition_sectors(psize, start)[source]

Calculates end sector and converts start and end sectors including

the unit of measure, compatible with parted. :param psize: size of the raid partition :param start: start sector of the raid partion in integer format :return: start and end sector in parted compatible format, end sector

as integer

ironic_python_agent.raid_utils.calculate_raid_start(target_boot_mode, partition_table_type, dev_name)[source]

Define the start sector for the raid partition.

Parameters
  • target_boot_mode – the node boot mode.

  • partition_table_type – the node partition label, gpt or msdos.

  • dev_name – block device in the raid configuration.

Returns

The start sector for the raid partition.

ironic_python_agent.raid_utils.create_raid_device(index, logical_disk)[source]

Create a raid device.

Parameters
  • index – the index of the resulting md device.

  • logical_disk – the logical disk containing the devices used to crete the raid.

Raise

errors.SoftwareRAIDError if not able to create the raid device or fails to re-add a device to a raid.

ironic_python_agent.raid_utils.create_raid_partition_tables(block_devices, partition_table_type, target_boot_mode)[source]

Creates partition tables in all disks in a RAID configuration and

reports the starting sector for each partition on each disk. :param block_devices: disks where we want to create the partition tables. :param partition_table_type: type of partition table to create, for example

gpt or msdos.

Parameters

target_boot_mode – the node selected boot mode, for example uefi or bios.

Returns

a dictionary of devices and the start of the corresponding partition.

ironic_python_agent.raid_utils.get_block_devices_for_raid(block_devices, logical_disks)[source]

Get block devices that are involved in the RAID configuration.

This call does two things: * Collect all block devices that are involved in RAID. * Update each logical disks with suitable block devices.