The ironic_lib.disk_partitioner Module

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, extra_flags=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’.
  • extra_flags – List of flags to set on the partition. Ignored if None.
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.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.