ironic.drivers.modules.drac.raid module

DRAC RAID specific methods

class ironic.drivers.modules.drac.raid.DracRAID(*args, **kwargs)[source]

Bases: DracWSManRAID

Class alias of class DracWSManRAID.

This class provides ongoing support of the deprecated ‘idrac’ RAID interface implementation entrypoint.

All bug fixes and new features should be implemented in its base class, DracWSManRAID. That makes them available to both the deprecated ‘idrac’ and new ‘idrac-wsman’ entrypoints. Such changes should not be made to this class.

class ironic.drivers.modules.drac.raid.DracRedfishRAID(*args, **kwargs)[source]

Bases: RedfishRAID

iDRAC Redfish interface for RAID related actions.

Includes iDRAC specific adjustments for RAID related actions.

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.

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

Perform post delete_configuration action to commit the config.

Clears foreign configuration for all RAID controllers. If no foreign configuration to clear, then checks if any controllers can be converted to RAID mode.

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.

Converts any physical disks of selected controllers to RAID mode if in non-RAID mode.

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

class ironic.drivers.modules.drac.raid.DracWSManRAID(*args, **kwargs)[source]

Bases: RAIDInterface

apply_configuration(task, raid_config, create_root_volume=True, create_nonroot_volumes=False, delete_existing=True)[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 the RAID configuration.

This method creates the RAID configuration on the given node.

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

  • create_root_volume – If True, a root volume is created during RAID configuration. Otherwise, no root volume is created. Default is True.

  • create_nonroot_volumes – If True, non-root volumes are created. If False, no non-root volumes are created. Default 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 (cleaning) or states.DEPLOYWAIT (deployment) if creation is in progress asynchronously or None if it is completed.

Raises:

MissingParameterValue, if node.target_raid_config is missing or empty.

Raises:

DracOperationError on an error from python-dracclient.

delete_configuration(task)[source]

Delete the RAID configuration.

Parameters:

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

Returns:

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

Raises:

DracOperationError on an error from python-dracclient.

get_logical_disks(task)[source]

Get the RAID configuration of the node.

Parameters:

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

Returns:

A dictionary of properties.

Raises:

DracOperationError on an error from python-dracclient.

get_properties()[source]

Return the properties of the interface.

supported = False

Indicates if an interface is supported.

This will be set to False for interfaces which are untested in first- or third-party CI, or in the process of being deprecated.

ironic.drivers.modules.drac.raid.abandon_config(node, raid_controller)[source]

Deletes all pending changes on a RAID controller.

Parameters:
  • node – an ironic node object.

  • raid_controller – id of the RAID controller.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.change_physical_disk_state(node, mode=None, controllers_to_physical_disk_ids=None)[source]

Convert disks RAID status

This method converts the requested physical disks from RAID to JBOD or vice versa. It does this by only converting the disks that are not already in the correct state.

Parameters:
  • node – an ironic node object.

  • mode – the mode to change the disks either to RAID or JBOD.

  • controllers_to_physical_disk_ids – Dictionary of controllers and corresponding disk ids to convert to the requested mode.

Returns:

a dictionary containing: - conversion_results, a dictionary that maps controller ids to the conversion results for that controller. The conversion results are a dict that contains: - The is_commit_required key with the value always set to True indicating that a config job must be created to complete disk conversion. - The is_reboot_required key with a RebootRequired enumerated value indicating whether the server must be rebooted to complete disk conversion.

Raises:

DRACOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.clear_foreign_config(node, raid_controller)[source]

Free up the foreign drives.

Parameters:
  • node – an ironic node object.

  • raid_controller – id of the RAID controller.

Returns:

a dictionary containing - The is_commit_required needed key with a boolean value indicating whether a config job must be created for the values to be applied. - The is_reboot_required key with a RebootRequired enumerated value indicating whether the server must be rebooted to clear foreign configuration.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.commit_config(node, raid_controller, reboot=False, realtime=False)[source]

Apply all pending changes on a RAID controller.

Parameters:
  • node – an ironic node object.

  • raid_controller – id of the RAID controller.

  • reboot – indicates whether a reboot job should be automatically created with the config job. (optional, defaults to False)

  • realtime – indicates RAID controller supports realtime. (optional, defaults to False)

Returns:

id of the created job

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.create_virtual_disk(node, raid_controller, physical_disks, raid_level, size_mb, disk_name=None, span_length=None, span_depth=None)[source]

Create a single virtual disk on a RAID controller.

The created virtual disk will be in pending state. The DRAC card will do the actual configuration once the changes are applied by calling the commit_config method.

Parameters:
  • node – an ironic node object.

  • raid_controller – id of the RAID controller.

  • physical_disks – ids of the physical disks.

  • raid_level – RAID level of the virtual disk.

  • size_mb – 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)

Returns:

a dictionary containing the commit_needed key with a boolean value indicating whether a config job must be created for the values to be applied.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.delete_virtual_disk(node, virtual_disk)[source]

Delete a single virtual disk on a RAID controller.

The deleted virtual disk will be in pending state. The DRAC card will do the actual configuration once the changes are applied by calling the commit_config method.

Parameters:
  • node – an ironic node object.

  • virtual_disk – id of the virtual disk.

Returns:

a dictionary containing the commit_needed key with a boolean value indicating whether a config job must be created for the values to be applied.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.list_physical_disks(node)[source]

List the physical disks of the node.

Parameters:

node – an ironic node object.

Returns:

a list of PhysicalDisk objects from dracclient.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.list_raid_controllers(node)[source]

List the RAID controllers of the node.

Parameters:

node – an ironic node object.

Returns:

a list of RAIDController objects from dracclient.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.list_raid_settings(node)[source]

List the RAID configuration settings

Parameters:

node – an ironic node object.

Returns:

a dictionary with the RAID settings using InstanceID as the key. The attributes are RAIDEnumerableAttribute, RAIDStringAttribute and RAIDIntegerAttribute objects.

Raises:

DRACOperationFailed on error reported back by the DRAC interface

ironic.drivers.modules.drac.raid.list_virtual_disks(node)[source]

List the virtual disks of the node.

Parameters:

node – an ironic node object.

Returns:

a list of VirtualDisk objects from dracclient.

Raises:

DracOperationError on an error from python-dracclient.

ironic.drivers.modules.drac.raid.set_raid_settings(node, controller_fqdd, settings)[source]

Sets the RAID configuration

It sets the pending_value parameter for each of the attributes passed in. For the values to be applied, a config job must be created.

Parameters:
  • node – an ironic node object.

  • controller_fqdd – the ID of the RAID controller.

  • settings – a dictionary containing the proposed values, with each key being the name of attribute and the value being the proposed value.

Returns:

a dictionary containing: - The is_commit_required key with a boolean value indicating whether a config job must be created for the values to be applied. - The is_reboot_required key with a RebootRequired enumerated value indicating whether the server must be rebooted for the values to be applied. Possible values are true and false.

Raises:

DRACOperationFailed on error reported back by the DRAC interface