Common functionalities shared between different iLO modules.
ironic.drivers.modules.ilo.common.
attach_vmedia
(node, device, url)[source]¶Attaches the given url as virtual media on the node.
Parameters: |
|
---|---|
Raises: | IloOperationError if insert virtual media failed. |
ironic.drivers.modules.ilo.common.
cleanup_vmedia_boot
(task)[source]¶Cleans a node after a virtual media boot.
This method cleans up a node after a virtual media boot. It deletes the floppy image if it exists in CONF.ilo.swift_ilo_container or web server. It also ejects both virtual media cdrom and virtual media floppy.
Parameters: | task – a TaskManager instance containing the node to act on. |
---|
ironic.drivers.modules.ilo.common.
copy_image_to_swift
(source_file_path, destination_object_name)[source]¶Uploads the given image to swift.
This method copies the given image to swift.
Parameters: |
|
---|---|
Raises: | SwiftOperationError, if any operation with Swift fails. |
Returns: | temp url from swift after the source image is uploaded. |
ironic.drivers.modules.ilo.common.
copy_image_to_web_server
(source_file_path, destination)[source]¶Copies the given image to the http web server.
This method copies the given image to the http_root location. It enables read-write access to the image else the deploy fails as the image file at the web_server url is inaccessible.
Parameters: |
|
---|---|
Raises: | ImageUploadFailed exception if copying the source file to the web server fails. |
Returns: | image url after the source image is uploaded. |
ironic.drivers.modules.ilo.common.
destroy_floppy_image_from_web_server
(node)[source]¶Removes the temporary floppy image.
It removes the floppy image created for deploy. :param node: an ironic node object.
ironic.drivers.modules.ilo.common.
eject_vmedia_devices
(task)[source]¶Ejects virtual media devices.
This method ejects virtual media floppy and cdrom.
Parameters: | task – a TaskManager instance containing the node to act on. |
---|---|
Returns: | None |
Raises: | IloOperationError, if some error was encountered while trying to eject virtual media floppy or cdrom. |
ironic.drivers.modules.ilo.common.
get_ilo_object
(node)[source]¶Gets an IloClient object from proliantutils library.
Given an ironic node object, this method gives back a IloClient object to do operations on the iLO.
Parameters: | node – an ironic node object. |
---|---|
Returns: | an IloClient object. |
Raises: | InvalidParameterValue on invalid inputs. |
Raises: | MissingParameterValue if some mandatory information is missing on the node |
ironic.drivers.modules.ilo.common.
get_secure_boot_mode
(task)[source]¶Retrieves current enabled state of UEFI secure boot on the node
Returns the current enabled state of UEFI secure boot on the node.
Parameters: | task – a task from TaskManager. |
---|---|
Raises: | MissingParameterValue if a required iLO parameter is missing. |
Raises: | IloOperationError on an error from IloClient library. |
Raises: | IloOperationNotSupported if UEFI secure boot is not supported. |
Returns: | Boolean value indicating current state of UEFI secure boot on the node. |
ironic.drivers.modules.ilo.common.
parse_driver_info
(node)[source]¶Gets the driver specific Node info.
This method validates whether the ‘driver_info’ property of the supplied node contains the required information for this driver.
Parameters: | node – an ironic Node object. |
---|---|
Returns: | a dict containing information from driver_info (or where applicable, config values). |
Raises: | InvalidParameterValue if any parameters are incorrect |
Raises: | MissingParameterValue if some mandatory information is missing on the node |
ironic.drivers.modules.ilo.common.
remove_image_from_swift
(object_name, associated_with=None)[source]¶Removes the given image from swift.
This method removes the given image name from swift. It deletes the image if it exists in CONF.ilo.swift_ilo_container
Parameters: |
|
---|
ironic.drivers.modules.ilo.common.
remove_image_from_web_server
(object_name)[source]¶Removes the given image from the configured web server.
This method removes the given image from the http_root location, if the image exists.
Parameters: | object_name – The name of the image file which needs to be removed from the web server root. |
---|
ironic.drivers.modules.ilo.common.
remove_single_or_list_of_files
(file_location)[source]¶Removes (deletes) the file or list of files.
This method only accepts single or list of files to delete. If single file is passed, this method removes (deletes) the file. If list of files is passed, this method removes (deletes) each of the files iteratively.
Parameters: | file_location – a single or a list of file paths |
---|
ironic.drivers.modules.ilo.common.
set_boot_mode
(node, boot_mode)[source]¶Sets the node to boot using boot_mode for the next boot.
Parameters: |
|
---|---|
Raises: | IloOperationError if setting boot mode failed. |
ironic.drivers.modules.ilo.common.
set_secure_boot_mode
(task, flag)[source]¶Enable or disable UEFI Secure Boot for the next boot
Enable or disable UEFI Secure Boot for the next boot
Parameters: |
|
---|---|
Raises: | IloOperationError on an error from IloClient library. |
Raises: | IloOperationNotSupported if UEFI secure boot is not supported. |
ironic.drivers.modules.ilo.common.
setup_vmedia
(task, iso, ramdisk_options)[source]¶Attaches virtual media and sets it as boot device.
This method attaches the given bootable ISO as virtual media, prepares the arguments for ramdisk in virtual media floppy.
Parameters: |
|
---|---|
Raises: | ImageCreationFailed, if it failed while creating the floppy image. |
Raises: | IloOperationError, if some operation on iLO failed. |
ironic.drivers.modules.ilo.common.
setup_vmedia_for_boot
(task, boot_iso, parameters=None)[source]¶Sets up the node to boot from the given ISO image.
This method attaches the given boot_iso on the node and passes the required parameters to it via virtual floppy image.
Parameters: |
|
---|---|
Raises: | ImageCreationFailed, if it failed while creating the floppy image. |
Raises: | SwiftOperationError, if any operation with Swift fails. |
Raises: | IloOperationError, if attaching virtual media failed. |
ironic.drivers.modules.ilo.common.
update_boot_mode
(task)[source]¶Update instance_info with boot mode to be used for deploy.
This method updates instance_info with boot mode to be used for deploy if node properties[‘capabilities’] do not have boot_mode. It sets the boot mode on the node.
Parameters: | task – Task object. |
---|---|
Raises: | IloOperationError if setting boot mode failed. |
ironic.drivers.modules.ilo.common.
update_ipmi_properties
(task)[source]¶Update ipmi properties to node driver_info
Parameters: | task – a task from TaskManager. |
---|
ironic.drivers.modules.ilo.common.
update_secure_boot_mode
(task, mode)[source]¶Changes secure boot mode for next boot on the node.
This method changes secure boot mode on the node for next boot. It changes the secure boot mode setting on node only if the deploy has requested for the secure boot. During deploy, this method is used to enable secure boot on the node by passing ‘mode’ as ‘True’. During teardown, this method is used to disable secure boot on the node by passing ‘mode’ as ‘False’.
Parameters: |
|
---|---|
Raises: | IloOperationNotSupported, if operation is not supported on iLO |
Raises: | IloOperationError, if some operation on iLO failed. |
ironic.drivers.modules.ilo.common.
verify_image_checksum
(image_location, expected_checksum)[source]¶Verifies checksum (md5) of image file against the expected one.
This method generates the checksum of the image file on the fly and verifies it against the expected checksum provided as argument.
Parameters: |
|
---|---|
Raises: | ImageRefValidationFailed, if invalid file path or verification fails. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.