ironic.drivers.modules.image_utils.
ImageHandler
(driver)[source]¶Bases: object
publish_image
(image_file, object_name)[source]¶Make image file downloadable.
Depending on ironic settings, pushes given file into Swift or copies it over to local HTTP server’s document root and returns publicly accessible URL leading to the given file.
image_file – path to file to publish
object_name – name of the published file
a URL to download published file
ironic.drivers.modules.image_utils.
cleanup_floppy_image
(task)[source]¶Deletes the floppy image if it was created for the node.
task – an ironic node object.
ironic.drivers.modules.image_utils.
cleanup_iso_image
(task)[source]¶Deletes the ISO if it was created for the instance.
task – A task from TaskManager.
ironic.drivers.modules.image_utils.
prepare_boot_iso
(task, d_info, root_uuid=None)[source]¶Prepare boot ISO image
Build bootable ISO out of [instance_info]/kernel, [instance_info]/ramdisk and [driver_info]/bootloader if present. Otherwise, read kernel_id and ramdisk_id from [instance_info]/image_source Glance image metadata.
Push produced ISO image up to Glance and return temporary Swift URL to the image.
task – a TaskManager instance containing the node to act on.
d_info – Deployment information of the node
root_uuid – Root UUID
bootable ISO HTTP URL.
MissingParameterValue, if any of the required parameters are missing.
InvalidParameterValue, if any of the parameters have invalid value.
ImageCreationFailed, if creating ISO image failed.
ironic.drivers.modules.image_utils.
prepare_deploy_iso
(task, params, mode, d_info)[source]¶Prepare deploy or rescue ISO image
Build bootable ISO out of [driver_info]/deploy_kernel/[driver_info]/deploy_ramdisk or [driver_info]/rescue_kernel/[driver_info]/rescue_ramdisk and [driver_info]/bootloader, then push built image up to Glance and return temporary Swift URL to the image.
If network interface supplies network configuration (network_data), a network_data.json will be written into an appropriate location on the final ISO.
task – a TaskManager instance containing the node to act on.
params – a dictionary containing ‘parameter name’->’value’ mapping to be passed to kernel command line.
mode – either ‘deploy’ or ‘rescue’.
d_info – Deployment information of the node
bootable ISO HTTP URL.
MissingParameterValue, if any of the required parameters are missing.
InvalidParameterValue, if any of the parameters have invalid value.
ImageCreationFailed, if creating ISO image failed.
ironic.drivers.modules.image_utils.
prepare_floppy_image
(task, params=None)[source]¶Prepares the floppy image for passing the parameters.
This method prepares a temporary VFAT filesystem image and adds a file into the image which contains parameters to be passed to the ramdisk. Then this method uploads built image to Swift ‘[redfish]swift_container’, setting it to auto expire after ‘[redfish]swift_object_expiry_timeout’ seconds. Finally, a temporary Swift URL is returned addressing Swift object just created.
task – a TaskManager instance containing the node to act on.
params – a dictionary containing ‘parameter name’->’value’ mapping to be passed to deploy or rescue image via floppy image.
ImageCreationFailed, if it failed while creating the floppy image.
SwiftOperationError, if any operation with Swift fails.
image URL for the floppy image.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.