The ironic_lib.disk_partitioner Module

class ironic_lib.disk_partitioner.DiskPartitioner(device, disk_label='msdos', alignment='optimal')[source]

Bases: object

add_partition(size, part_type='primary', fs_type='', boot_flag=None)[source]

Add a partition.

Parameters:
  • size – The size of the partition in MiB.
  • part_type – The type of the partition. Valid values are: primary, logical, or extended.
  • fs_type – The filesystem type. Valid types are: ext2, fat32, fat16, HFS, linux-swap, NTFS, reiserfs, ufs. If blank (‘’), it will create a Linux native partition (83).
  • boot_flag – Boot flag that needs to be configured on the partition. Ignored if None. It can take values ‘bios_grub’, ‘boot’.
Returns:

The partition number.

commit()[source]

Write to the disk.

get_partitions()[source]

Get the partitioning layout.

Returns:An iterator with the partition number and the partition layout.
ironic_lib.disk_partitioner.list_opts()[source]

Entry point for oslo-config-generator.