ironic.drivers.modules.redfish.raid module

class ironic.drivers.modules.redfish.raid.RedfishRAID(*args, **kwargs)[source]

Bases: RAIDInterface

apply_configuration(task, raid_config, create_root_volume=True, create_nonroot_volumes=False, delete_existing=False)[source]

Applies RAID configuration on the given node.

Parameters:
  • task – A TaskManager instance.

  • raid_config – The RAID configuration to apply.

  • create_root_volume – Setting this to False indicates not to create root volume that is specified in raid_config. Default value is True.

  • create_nonroot_volumes – Setting this to False indicates not to create non-root volumes (all except the root volume) in raid_config. Default value is True.

  • delete_existing – Setting this to True indicates to delete RAID configuration prior to creating the new configuration.

Raises:

InvalidParameterValue, if the RAID configuration is invalid.

Returns:

states.DEPLOYWAIT if RAID configuration is in progress asynchronously or None if it is complete.

create_configuration(task, create_root_volume=True, create_nonroot_volumes=True, delete_existing=False)[source]

Create RAID configuration on the node.

This method creates the RAID configuration as read from node.target_raid_config. This method by default will create all logical disks.

Parameters:
  • task – TaskManager object containing the node.

  • create_root_volume – Setting this to False indicates not to create root volume that is specified in the node’s target_raid_config. Default value is True.

  • create_nonroot_volumes – Setting this to False indicates not to create non-root volumes (all except the root volume) in the node’s target_raid_config. Default value is True.

  • delete_existing – Setting this to True indicates to delete RAID configuration prior to creating the new configuration. Default is False.

Returns:

states.CLEANWAIT if RAID configuration is in progress asynchronously or None if it is complete.

Raises:

RedfishError if there is an error creating the configuration

delete_configuration(task)[source]

Delete RAID configuration on the node.

Parameters:

task – TaskManager object containing the node.

Returns:

states.CLEANWAIT (cleaning) or states.DEPLOYWAIT (deployment) if deletion is in progress asynchronously or None if it is complete.

get_properties()[source]

Return the properties of the interface.

Returns:

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

post_create_configuration(task, raid_configs, return_state=None)[source]

Perform post create_configuration action to commit the config.

Extension point to allow vendor implementations to extend this class and override this method to perform a custom action to commit the RAID create configuration to the Redfish service.

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

  • raid_configs – a list of dictionaries containing the RAID configuration operation details.

  • return_state – state to return based on operation being invoked

post_delete_configuration(task, raid_configs, return_state=None)[source]

Perform post delete_configuration action to commit the config.

Extension point to allow vendor implementations to extend this class and override this method to perform a custom action to commit the RAID delete configuration to the Redfish service.

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

  • raid_configs – a list of dictionaries containing the RAID configuration operation details.

  • return_state – state to return based on operation being invoked

pre_create_configuration(task, logical_disks_to_create)[source]

Perform required actions before creating config.

Extension point to allow vendor implementations to extend this class and override this method to perform custom actions prior to creating the RAID configuration on the Redfish service.

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

  • logical_disks_to_create – list of logical disks to create.

Returns:

updated list of logical disks to create.

pre_delete_configuration(task, vols_to_delete)[source]

Perform required actions before deleting config.

Extension point to allow vendor implementations to extend this class and override this method to perform custom actions prior to deleting the RAID configuration on the Redfish service.

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

  • vols_to_delete – list of volumes to delete.

validate_raid_config(task, raid_config)[source]

Validates the given RAID configuration.

Parameters:
  • task – A TaskManager instance.

  • raid_config – The RAID configuration to validate.

Raises:

InvalidParameterValue, if the RAID configuration is invalid.

volume_create_error_handler(task, exc, volume_collection, payload)[source]

Handle error from failed VolumeCollection.create()

Extension point to allow vendor implementations to extend this class and override this method to perform a custom action if the call to VolumeCollection.create() fails.

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

  • exc – the exception raised by VolumeCollection.create().

  • volume_collection – the sushy VolumeCollection instance.

  • payload – the payload passed to the failed create().

Returns:

Newly created Volume resource or TaskMonitor if async task.

Raises:

RedfishError if there is an error creating the virtual disk.

ironic.drivers.modules.redfish.raid.convert_drive_units(logical_disks, node)[source]

Convert size in logical_disks from gb to bytes

ironic.drivers.modules.redfish.raid.create_virtual_disk(task, raid_controller, physical_disks, raid_level, size_bytes, disk_name=None, span_length=None, span_depth=None, error_handler=None)[source]

Create a single virtual disk on a RAID controller.

Parameters:
  • task – TaskManager object containing the node.

  • raid_controller – id of the RAID controller.

  • physical_disks – ids of the physical disks.

  • raid_level – RAID level of the virtual disk.

  • size_bytes – size of the virtual disk.

  • disk_name – name of the virtual disk. (optional)

  • span_depth – Number of spans in virtual disk. (optional)

  • span_length – Number of disks per span. (optional)

  • error_handler – function to call if volume create fails. (optional)

Returns:

Newly created Volume resource or TaskMonitor if async task.

Raises:

RedfishConnectionError when it fails to connect to Redfish.

Raises:

RedfishError if there is an error creating the virtual disk.

ironic.drivers.modules.redfish.raid.get_physical_disks(node)[source]

Get the physical drives of the node for RAID controllers.

Parameters:

node – an ironic node object.

Returns:

a list of Drive objects from sushy

Raises:

RedfishConnectionError when it fails to connect to Redfish

Raises:

RedfishError if there is an error getting the drives via Redfish

ironic.drivers.modules.redfish.raid.update_raid_config(node)[source]

Updates node’s raid_config field with current logical disks.

Parameters:

node – node for which to update the raid_config field