The ironic.common.disk_partitioner Module

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

Bases: object

add_partition(size, part_type='primary', fs_type='', bootable=False)[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).
  • bootable – Boolean value; whether the partition is bootable or not.
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.

This Page