ironic.drivers.modules.redfish.management module

class ironic.drivers.modules.redfish.management.RedfishManagement(*args, **kwargs)[source]

Bases: ManagementInterface

clear_secure_boot_keys(task)[source]

Clear all secure boot keys.

Parameters:

task – a task from TaskManager.

Raises:

UnsupportedDriverExtension if secure boot is now supported.

Raises:

RedfishError on runtime driver error.

detect_vendor(task)[source]

Detects and returns the hardware vendor.

Uses the System’s Manufacturer field.

Parameters:

task – A task from TaskManager.

Raises:

InvalidParameterValue if an invalid component, indicator or state is specified.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishError on driver-specific problems.

Returns:

String representing the BMC reported Vendor or Manufacturer, otherwise returns None.

get_boot_device(task)[source]

Get the current boot device for a node.

Parameters:

task – a task from TaskManager.

Raises:

InvalidParameterValue on malformed parameter(s)

Raises:

MissingParameterValue on missing parameter(s)

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError on an error from the Sushy library

Returns:

a dictionary containing:

boot_device:

the boot device, one of ironic.common.boot_devices or None if it is unknown.

persistent:

Boolean value or None, True if the boot device persists, False otherwise. None if it’s unknown.

get_boot_mode(task)[source]

Get the current boot mode for a node.

Provides the current boot mode of the node.

Parameters:

task – A task from TaskManager.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

DriverOperationError or its derivative in case of driver runtime error.

Returns:

The boot mode, one of ironic.common.boot_mode or None if it is unknown.

get_indicator_state(task, component, indicator)[source]

Get current state of the indicator of the hardware component.

Parameters:
  • task – A task from TaskManager.

  • component – The hardware component, one of ironic.common.components.

  • indicator – Indicator ID (as reported by get_supported_indicators).

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishError on an error from the Sushy library

Returns:

Current state of the indicator, one of ironic.common.indicator_states.

get_mac_addresses(task)[source]

Get MAC address information for the node.

Parameters:

task – A TaskManager instance containing the node to act on.

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError on an error from the Sushy library

Returns:

A list of MAC addresses for the node

get_properties()[source]

Return the properties of the interface.

Returns:

dictionary of <property name>:<property description> entries.

get_secure_boot_state(task)[source]

Get the current secure boot state for the node.

Parameters:

task – A task from TaskManager.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishError or its derivative in case of a driver runtime error.

Raises:

UnsupportedDriverExtension if secure boot is not supported by the hardware.

Returns:

Boolean

get_sensors_data(task)[source]

Get sensors data.

Parameters:

task – a TaskManager instance.

Raises:

FailedToGetSensorData when getting the sensor data fails.

Raises:

FailedToParseSensorData when parsing sensor data fails.

Raises:

InvalidParameterValue if required parameters are missing.

Raises:

MissingParameterValue if a required parameter is missing.

Returns:

returns a dict of sensor data grouped by sensor type.

get_supported_boot_devices(task)[source]

Get a list of the supported boot devices.

Parameters:

task – a task from TaskManager.

Returns:

A list with the supported boot devices defined in ironic.common.boot_devices.

get_supported_boot_modes(task)[source]

Get a list of the supported boot modes.

Parameters:

task – A task from TaskManager.

Returns:

A list with the supported boot modes defined in ironic.common.boot_modes. If boot mode support can’t be determined, empty list is returned.

get_supported_indicators(task, component=None)[source]

Get a map of the supported indicators (e.g. LEDs).

Parameters:
  • task – A task from TaskManager.

  • component – If not None, return indicator information for just this component, otherwise return indicators for all existing components.

Returns:

A dictionary of hardware components (ironic.common.components) as keys with values being dictionaries having indicator IDs as keys and indicator properties as values.

{
    'chassis': {
        'enclosure-0': {
            "readonly": true,
            "states": [
                "OFF",
                "ON"
            ]
        }
    },
    'system':
        'blade-A': {
            "readonly": true,
            "states": [
                "OFF",
                "ON"
            ]
        }
    },
    'drive':
        'ssd0': {
            "readonly": true,
            "states": [
                "OFF",
                "ON"
            ]
        }
    }
}

inject_nmi(task)[source]

Inject NMI, Non Maskable Interrupt.

Inject NMI (Non Maskable Interrupt) for a node immediately.

Parameters:

task – A TaskManager instance containing the node to act on.

Raises:

InvalidParameterValue on malformed parameter(s)

Raises:

MissingParameterValue on missing parameter(s)

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError on an error from the Sushy library

reset_secure_boot_keys_to_default(task)[source]

Reset secure boot keys to manufacturing defaults.

Parameters:

task – a task from TaskManager.

Raises:

UnsupportedDriverExtension if secure boot is now supported.

Raises:

RedfishError on runtime driver error.

restore_boot_device(task, system)[source]

Restore boot device if needed.

Checks the redfish_boot_device internal flag and sets the one-time boot device accordingly. A warning is issued if it fails.

This method is supposed to be called from the Redfish power interface and should be considered private to the Redfish hardware type.

Parameters:
  • task – a task from TaskManager.

  • system – a Redfish System object.

set_boot_device(task, device, persistent=False)[source]

Set the boot device for a node.

Set the boot device to use on next reboot of the node.

Parameters:
  • task – a task from TaskManager.

  • device – the boot device, one of ironic.common.boot_devices.

  • persistent – Boolean value. True if the boot device will persist to all future boots, False if not. Default: False.

Raises:

InvalidParameterValue on malformed parameter(s)

Raises:

MissingParameterValue on missing parameter(s)

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError on an error from the Sushy library

set_boot_mode(task, mode)[source]

Set the boot mode for a node.

Set the boot mode to use on next reboot of the node.

Parameters:
Raises:

InvalidParameterValue if an invalid boot mode is specified.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError on an error from the Sushy library

set_indicator_state(task, component, indicator, state)[source]

Set indicator on the hardware component to the desired state.

Parameters:
Raises:

InvalidParameterValue if an invalid component, indicator or state is specified.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishError on an error from the Sushy library

set_secure_boot_state(task, state)[source]

Set the current secure boot state for the node.

Parameters:
  • task – A task from TaskManager.

  • state – A new state as a boolean.

Raises:

MissingParameterValue if a required parameter is missing

Raises:

RedfishError or its derivative in case of a driver runtime error.

Raises:

UnsupportedDriverExtension if secure boot is not supported by the hardware.

update_firmware(task, firmware_images)[source]

Updates the firmware on the node.

Parameters:
  • task – a TaskManager instance containing the node to act on.

  • firmware_images – A list of firmware images are to apply.

Returns:

None if it is completed.

Raises:

RedfishError on an error from the Sushy library.

validate(task)[source]

Validates the driver information needed by the redfish driver.

Parameters:

task – a TaskManager instance containing the node to act on.

Raises:

InvalidParameterValue on malformed parameter(s)

Raises:

MissingParameterValue on missing parameter(s)