ironic.common.pxe_utils.
build_deploy_pxe_options
(task, pxe_info, mode='deploy', ipxe_enabled=False)[source]¶ironic.common.pxe_utils.
build_pxe_config_options
(task, pxe_info, service=False, ipxe_enabled=False, ramdisk_params=None)[source]¶Build the PXE config options for a node
This method builds the PXE boot options for a node, given all the required parameters.
The options should then be passed to pxe_utils.create_pxe_config to create the actual config files.
Parameters: |
|
---|---|
Returns: | A dictionary of pxe options to be used in the pxe bootfile template. |
ironic.common.pxe_utils.
build_service_pxe_config
(task, instance_image_info, root_uuid_or_disk_id, ramdisk_boot=False, ipxe_enabled=False)[source]¶ironic.common.pxe_utils.
cache_ramdisk_kernel
(task, pxe_info, ipxe_enabled=False)[source]¶Fetch the necessary kernels and ramdisks for the instance.
ironic.common.pxe_utils.
clean_up_pxe_config
(task, ipxe_enabled=False)[source]¶Clean up the TFTP environment for the task’s node.
Parameters: | task – A TaskManager instance. |
---|
ironic.common.pxe_utils.
clean_up_pxe_env
(task, images_info, ipxe_enabled=False)[source]¶Cleanup PXE environment of all the images in images_info.
Cleans up the PXE environment for the mentioned images in images_info.
Parameters: |
|
---|
ironic.common.pxe_utils.
create_ipxe_boot_script
()[source]¶Render the iPXE boot script into the HTTP root directory
ironic.common.pxe_utils.
create_pxe_config
(task, pxe_options, template=None, ipxe_enabled=False)[source]¶Generate PXE configuration file and MAC address links for it.
This method will generate the PXE configuration file for the task’s node under a directory named with the UUID of that node. For each MAC address or DHCP IP address (port) of that node, a symlink for the configuration file will be created under the PXE configuration directory, so regardless of which port boots first they’ll get the same PXE configuration. If grub2 bootloader is in use, then its configuration will be created based on DHCP IP address in the form nn.nn.nn.nn.
Parameters: |
|
---|
ironic.common.pxe_utils.
dhcp_options_for_instance
(task, ipxe_enabled=False, url_boot=False, ip_version=None)[source]¶Retrieves the DHCP PXE boot options.
Parameters: |
|
---|---|
Returns: | Dictionary to be sent to the networking service describing the DHCP options to be set. |
ironic.common.pxe_utils.
get_image_info
(node, mode='deploy', ipxe_enabled=False)[source]¶Generate the paths for TFTP files for deploy or rescue images.
This method generates the paths for the deploy (or rescue) kernel and deploy (or rescue) ramdisk.
Parameters: |
|
---|---|
Returns: | a dictionary whose keys are the names of the images (deploy_kernel, deploy_ramdisk, or rescue_kernel, rescue_ramdisk) and values are the absolute paths of them. |
Raises: | MissingParameterValue, if deploy_kernel/deploy_ramdisk or rescue_kernel/rescue_ramdisk is missing in node’s driver_info. |
ironic.common.pxe_utils.
get_instance_image_info
(task, ipxe_enabled=False)[source]¶Generate the paths for TFTP files for instance related images.
This method generates the paths for instance kernel and instance ramdisk. This method also updates the node, so caller should already have a non-shared lock on the node.
Parameters: |
|
---|---|
Returns: | a dictionary whose keys are the names of the images (kernel, ramdisk) and values are the absolute paths of them. If it’s a whole disk image or node is configured for localboot, it returns an empty dictionary. |
ironic.common.pxe_utils.
get_kernel_ramdisk_info
(node_uuid, driver_info, mode='deploy', ipxe_enabled=False)[source]¶Get href and tftp path for deploy or rescue kernel and ramdisk.
Parameters: |
|
---|---|
Returns: | a dictionary whose keys are deploy_kernel and deploy_ramdisk or rescue_kernel and rescue_ramdisk and whose values are the absolute paths to them. |
Note: driver_info should be validated outside of this method.
ironic.common.pxe_utils.
get_path_relative_to_tftp_root
(file_path)[source]¶Return file relative path to CONF.pxe.tftp_root
Parameters: | file_path – full file path to be made relative path. |
---|---|
Returns: | The path relative to CONF.pxe.tftp_root |
ironic.common.pxe_utils.
get_pxe_config_file_path
(node_uuid, ipxe_enabled=False)[source]¶Generate the path for the node’s PXE configuration file.
Parameters: |
|
---|---|
Returns: | The path to the node’s PXE configuration file. |
ironic.common.pxe_utils.
get_root_dir
()[source]¶Returns the directory where the config files and images will live.
ironic.common.pxe_utils.
get_tftp_path_prefix
()[source]¶Adds trailing slash (if needed) necessary for path-prefix
Returns: | CONF.pxe.tftp_root ensured to have a trailing slash |
---|
ironic.common.pxe_utils.
get_volume_pxe_options
(task)[source]¶Identify volume information for iPXE template generation.
ironic.common.pxe_utils.
is_ipxe_enabled
(task)[source]¶Return true if ipxe is set.
Parameters: | task – A TaskManager object |
---|---|
Returns: | boolean true if [pxe]ipxe_enabled is configured
or if the task driver instance is the iPXE driver. |
ironic.common.pxe_utils.
parse_driver_info
(node, mode='deploy')[source]¶Gets the driver specific Node deployment info.
This method validates whether the ‘driver_info’ property of the supplied node contains the required information for this driver to deploy images to, or rescue, the node.
Parameters: |
|
---|---|
Returns: | A dict with the driver_info values. |
Raises: | MissingParameterValue |
ironic.common.pxe_utils.
prepare_instance_pxe_config
(task, image_info, iscsi_boot=False, ramdisk_boot=False, ipxe_enabled=False)[source]¶Prepares the config file for PXE boot
Parameters: |
|
---|---|
Returns: | None |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.