Handling of VM disk images.
ironic.common.images.converted_size(path)[source]¶Get size of converted raw image.
The size of image converted to raw format can be growing up to the virtual size of the image.
| Parameters: | path – path to the image file. |
|---|---|
| Returns: | virtual size of the image or 0 if conversion not needed. |
ironic.common.images.create_boot_iso(context, output_filename, kernel_href, ramdisk_href, deploy_iso_href, root_uuid=None, kernel_params=None, boot_mode=None)[source]¶Creates a bootable ISO image for a node.
Given the hrefs for kernel, ramdisk, root partition’s UUID and kernel cmdline arguments, this method fetches the kernel and ramdisk, and builds a bootable ISO image that can be used to boot up the baremetal node.
| Parameters: |
|
|---|---|
| Boot_mode: | the boot mode in which the deploy is to happen. |
| Raises: | ImageCreationFailed, if creating boot ISO failed. |
ironic.common.images.create_isolinux_image_for_bios(output_file, kernel, ramdisk, kernel_params=None)[source]¶Creates an isolinux image on the specified file.
Copies the provided kernel, ramdisk to a directory, generates the isolinux configuration file using the kernel parameters provided, and then generates a bootable ISO image.
| Parameters: |
|
|---|---|
| Raises: | ImageCreationFailed, if image creation failed while copying files or while running command to generate iso. |
ironic.common.images.create_isolinux_image_for_uefi(output_file, deploy_iso, kernel, ramdisk, kernel_params=None)[source]¶Creates an isolinux image on the specified file.
Copies the provided kernel, ramdisk, efiboot.img to a directory, creates the path for grub config file, generates the isolinux configuration file using the kernel parameters provided, generates the grub configuration file using kernel parameters and then generates a bootable ISO image for uefi.
| Parameters: |
|
|---|---|
| Raises: | ImageCreationFailed, if image creation failed while copying files or while running command to generate iso. |
ironic.common.images.create_vfat_image(output_file, files_info=None, parameters=None, parameters_file='parameters.txt', fs_size_kib=100)[source]¶Creates the fat fs image on the desired file.
This method copies the given files to a root directory (optional), writes the parameters specified to the parameters file within the root directory (optional), and then creates a vfat image of the root directory.
| Parameters: |
|
|---|---|
| Raises: | ImageCreationFailed, if image creation failed while doing any of filesystem manipulation activities like creating dirs, mounting, creating filesystem, copying files, etc. |
ironic.common.images.get_image_properties(context, image_href, properties='all')[source]¶Returns the values of several properties of an image
| Parameters: |
|
|---|---|
| Returns: | a dict of the values of the properties. A property not on the glance metadata will have a value of None. |
ironic.common.images.get_temp_url_for_glance_image(context, image_uuid)[source]¶Returns the tmp url for a glance image.
| Parameters: |
|
|---|---|
| Returns: | the tmp url for the glance image. |
ironic.common.images.is_whole_disk_image(ctx, instance_info)[source]¶Find out if the image is a partition image or a whole disk image.
| Parameters: |
|
|---|---|
| Returns: | True for whole disk images and False for partition images and None on no image_source or Error. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.