Convert image to other format.
Count the number of primary and logical partitions on a MBR
Parameters: | device – The device path. |
---|---|
Returns: | A tuple with the number of primary partitions and logical partitions. |
Raise: | ValueError if the device does not have a valid MBR partition table. |
Create a partition for config drive
Checks if the device is GPT or MBR partitioned and creates config drive partition accordingly.
Parameters: |
|
---|---|
Raises: | InstanceDeployFailure if config drive size exceeds maximum limit or if it fails to create config drive. |
Destroy metadata structures on node’s disk.
Ensure that node’s disk magic strings are wiped without zeroing the entire drive. To do this we use the wipefs tool from util-linux.
Parameters: |
|
---|
Get the disk identifier from the disk being exposed by the ramdisk.
This disk identifier is appended to the pxe config which will then be used by chain.c32 to detect the correct disk to chainload. This is helpful in deployments to nodes with multiple disks.
http://www.syslinux.org/wiki/index.php/Comboot/chain.c32#mbr:
Parameters: | dev – Path for the already populated disk device. |
---|---|
Returns: | The Disk Identifier. |
Get size of an image in Megabyte.
check whether the device path belongs to an iscsi device.
Get partitions information from given device.
Parameters: | device – The device path. |
---|---|
Returns: | list of dictionaries (one per partition) with keys: number, start, end, size (in MiB), filesystem, flags |
Partition the disk device.
Create partitions for root, swap, ephemeral and configdrive on a disk device.
Parameters: |
|
---|---|
Returns: | A dictionary containing the partition type as Key and partition path as Value for the partitions created by this method. |
Return an object containing the parsed output from qemu-img info.
Create partitions and copy an image to the root partition.
Parameters: |
|
---|---|
Returns: | a dictionary containing the following keys: ‘root uuid’: UUID of root partition ‘efi system partition uuid’: UUID of the uefi system partition (if boot mode is uefi). NOTE: If key exists but value is None, it means partition doesn’t exist. |