ironic_python_agent.extensions.standby module¶
- class ironic_python_agent.extensions.standby.ImageDownload(image_info, time_obj=None)[source]¶
- Bases: - object- Helper class that opens a HTTP connection to download an image. - This class opens a HTTP connection to download an image from a URL and create an iterator so the image can be downloaded in chunks. The MD5 hash of the image being downloaded is calculated on-the-fly. - property bytes_transferred¶
- Property value to return the number of bytes transferred. 
 - property content_length¶
- Property value to return the server indicated length. 
 - verify_image(image_location)[source]¶
- Verifies the checksum of the local images matches expectations. - If this function does not raise ImageChecksumError then it is very likely that the local copy of the image was transmitted and stored correctly. - Parameters:
- image_location – The location of the local image. 
- Raises:
- ImageChecksumError if the checksum of the local image does not match the checksum as reported by glance in image_info. 
 
 
- class ironic_python_agent.extensions.standby.StandbyExtension(agent=None)[source]¶
- Bases: - BaseAgentExtension- Extension which adds stand-by related functionality to agent. - execute_bootc_install(image_source, instance_info={}, pull_secret=None, configdrive=None)[source]¶
- Asynchronously prepares specified image on local OS install device. - Identifies target disk device to deploy onto, and extracts necessary configuration data to trigger podman, triggers podman, verifies partitioning changes were made, and finally executes configuration drive write-out. - Parameters:
- image_source – The OCI Container registry URL supplied by Ironic. 
- instance_info – An Ironic Node’s instance_info filed for user requested specific configuration details be extracted. 
- pull_secret – The user requested or system required pull secret to authenticate to remote container image registries. 
- configdrive – The user requested configuration drive content supplied by Ironic’s step execution command. 
 
- Raises:
- ImageDownloadError if the image download encounters an error. 
- Raises:
- ImageChecksumError if the checksum of the local image does not match the checksum as reported by glance in image_info. 
- Raises:
- ImageWriteError if writing the image fails. 
- Raises:
- InstanceDeployFailure if failed to create config drive. large to store on the given device. 
 
 - prepare_image(image_info, configdrive=None)[source]¶
- Asynchronously prepares specified image on local OS install device. - In this case, ‘prepare’ means make local machine completely ready to reboot to the image specified by image_info. - Downloads and writes an image to disk if necessary. Also writes a configdrive to disk if the configdrive parameter is specified. - Parameters:
- image_info – Image information dictionary. 
- configdrive – A string containing the location of the config drive as a URL OR the contents (as gzip/base64) of the configdrive. Optional, defaults to None. 
 
- Raises:
- ImageDownloadError if the image download encounters an error. 
- Raises:
- ImageChecksumError if the checksum of the local image does not match the checksum as reported by glance in image_info. 
- Raises:
- ImageWriteError if writing the image fails. 
- Raises:
- InstanceDeployFailure if failed to create config drive. large to store on the given device. 
 
 
