ironic.drivers.modules.irmc.common module¶
Common functionalities shared between different iRMC modules.
- ironic.drivers.modules.irmc.common.check_elcm_license(node)[source]¶
- Connect to iRMC and return status of eLCM license - This function connects to iRMC REST API and check whether eLCM license is active. This function can be used to check connection to iRMC REST API. - Parameters:
- node – An ironic node object 
- Returns:
- dictionary whose keys are ‘active’ and ‘status_code’. value of ‘active’ is boolean showing if eLCM license is active and value of ‘status_code’ is int which is HTTP return code from iRMC REST API access 
- Raises:
- InvalidParameterValue if invalid value is contained in the ‘driver_info’ property. 
- Raises:
- MissingParameterValue if some mandatory key is missing in the ‘driver_info’ property. 
- Raises:
- IRMCOperationError if the operation fails. 
 
- ironic.drivers.modules.irmc.common.get_irmc_client(node)[source]¶
- Gets an iRMC SCCI client. - Given an ironic node object, this method gives back a iRMC SCCI client to do operations on the iRMC. - Parameters:
- node – An ironic node object. 
- Returns:
- scci_cmd partial function which takes a SCCI command param. 
- Raises:
- InvalidParameterValue on invalid inputs. 
- Raises:
- MissingParameterValue if some mandatory information is missing on the node 
- Raises:
- IRMCOperationError if iRMC operation failed 
 
- ironic.drivers.modules.irmc.common.get_irmc_report(node)[source]¶
- Gets iRMC SCCI report. - Given an ironic node object, this method gives back a iRMC SCCI report. - Parameters:
- node – An ironic node object. 
- Returns:
- A xml.etree.ElementTree object. 
- Raises:
- InvalidParameterValue on invalid inputs. 
- Raises:
- MissingParameterValue if some mandatory information is missing on the node. 
- Raises:
- scci.SCCIInvalidInputError if required parameters are invalid. 
- Raises:
- scci.SCCIClientError if SCCI failed. 
 
- ironic.drivers.modules.irmc.common.get_secure_boot_mode(node)[source]¶
- Get the current secure boot mode. - Parameters:
- node – An ironic node object. 
- Raises:
- UnsupportedDriverExtension if secure boot is not present. 
- Raises:
- IRMCOperationError if the operation fails. 
 
- ironic.drivers.modules.irmc.common.parse_driver_info(node)[source]¶
- Gets the specific Node driver 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 and default values. 
- Raises:
- InvalidParameterValue if invalid value is contained in the ‘driver_info’ property. 
- Raises:
- MissingParameterValue if some mandatory key is missing in the ‘driver_info’ property. 
 
- ironic.drivers.modules.irmc.common.set_irmc_version(task)[source]¶
- Fetch and save iRMC firmware version. - This function should be called before calling any other functions which need to check node’s iRMC firmware version. - Set <iRMC OS>/<fw version> to driver_internal_info[‘irmc_fw_version’] - Parameters:
- node – An ironic node object 
- Raises:
- InvalidParameterValue if invalid value is contained in the ‘driver_info’ property. 
- Raises:
- MissingParameterValue if some mandatory key is missing in the ‘driver_info’ property. 
- Raises:
- IRMCOperationError if the operation fails. 
- Raises:
- NodeLocked if the target node is already locked. 
 
- ironic.drivers.modules.irmc.common.set_secure_boot_mode(node, enable)[source]¶
- Enable or disable UEFI Secure Boot - Parameters:
- node – An ironic node object. 
- enable – Boolean value. True if the secure boot to be enabled. 
 
- Raises:
- IRMCOperationError if the operation fails. 
 
- ironic.drivers.modules.irmc.common.update_ipmi_properties(task)[source]¶
- Update ipmi properties to node driver_info. - Parameters:
- task – A task from TaskManager. 
 
- ironic.drivers.modules.irmc.common.within_version_ranges(node, version_ranges)[source]¶
- Read saved iRMC FW version and check if it is within the passed ranges. - Parameters:
- node – An ironic node object 
- version_ranges – - A Python dictionary containing version ranges in the next format: <os_n>: <ranges>, where <os_n> is a string representing iRMC OS number (e.g. ‘4’) and <ranges> is a dictionaries indicating the specific firmware version ranges under the iRMC OS number <os_n>. - The dictionary used in <ranges> only has two keys: ‘min’ and ‘upper’, and value of each key is a string representing iRMC firmware version number or None. Both keys can be absent and their value can be None. - It is acceptable to not set ranges for a <os_n> (for example set <ranges> to None, {}, etc…), in this case, this function only checks if the node’s iRMC OS number matches the <os_n>. - Valid <version_ranges> example:
- {‘3’: None, # all version of iRMC S3 matches
- ’4’: {}, # all version of iRMC S4 matches # all version of iRMC S5 matches ‘5’: {‘min’: None, ‘upper’: None}, # iRMC S6 whose version is >=1.20 matches ‘6’: {‘min’: ‘1.20’, ‘upper’: None}, # iRMC S7 whose version is # 5.51<= (version) <8.23 matches ‘7’: {‘min’: ‘5.51’, ‘upper’: ‘8.23’}} 
 
 
 
- Returns:
- True if node’s iRMC FW is in range, False if not or fails to parse firmware version 
 
