dellemc.openmanage.idrac_redfish_storage_controller (9.1.0) — module

Configures the physical disk, virtual disk, and storage controller settings

| "added in version" 2.1.0 of dellemc.openmanage"

Authors: Jagadeesh N V (@jagadeeshnv), Felix Stephen (@felixs88), Husniya Hameed (@husniya_hameed), Abhishek Sinha (@Abhishek-Dell)

Install collection

Install with ansible-galaxy collection install dellemc.openmanage:==9.1.0


Add to requirements.yml

  collections:
    - name: dellemc.openmanage
      version: 9.1.0

Description

This module allows the users to configure the settings of the physical disk, virtual disk, and storage controller.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Assign dedicated hot spare
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    volume_id:
      - "Disk.Virtual.0:RAID.Slot.1-1"
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - assign_dedicated_hot_spare
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Assign global hot spare
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - assign_global_hot_spare
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unassign hot spare
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
    command: UnassignSpare
  tags:
    - un-assign-hot-spare
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set controller encryption key
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "SetControllerKey"
    controller_id: "RAID.Slot.1-1"
    key: "PassPhrase@123"
    key_id: "mykeyid123"
  tags:
    - set_controller_key
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rekey in LKM mode
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ReKey"
    controller_id: "RAID.Slot.1-1"
    key: "NewPassPhrase@123"
    key_id: "newkeyid123"
    old_key: "OldPassPhrase@123"
  tags:
    - rekey_lkm
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rekey in SEKM mode
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ReKey"
    controller_id: "RAID.Slot.1-1"
    mode: "SEKM"
  tags:
    - rekey_sekm
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove controller key
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "RemoveControllerKey"
    controller_id: "RAID.Slot.1-1"
  tags:
    - remove_controller_key
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Reset controller configuration
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ResetConfig"
    controller_id: "RAID.Slot.1-1"
  tags:
    - reset_config
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable controller encryption
  idrac_redfish_storage_controller:
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: "EnableControllerEncryption"
    controller_id: "RAID.Slot.1-1"
    mode: "LKM"
    key: "your_Key@123"
    key_id: "your_Keyid@123"
  tags:
    - enable-encrypt
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Blink physical disk.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: BlinkTarget
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - blink-target
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Blink virtual drive.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: BlinkTarget
    volume_id: "Disk.Virtual.0:RAID.Slot.1-1"
  tags:
    - blink-volume
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unblink physical disk.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: UnBlinkTarget
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - unblink-target
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unblink virtual drive.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: UnBlinkTarget
    volume_id: "Disk.Virtual.0:RAID.Slot.1-1"
  tags:
    - unblink-drive
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Convert physical disk to RAID
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ConvertToRAID"
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - convert-raid
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Convert physical disk to non-RAID
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ConvertToNonRAID"
    target: "Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - convert-non-raid
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change physical disk state to online.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ChangePDStateToOnline"
    target: "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - pd-state-online
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change physical disk state to offline.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "ChangePDStateToOnline"
    target: "Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1"
  tags:
    - pd-state-offline
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Lock virtual drive
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    command: "LockVirtualDisk"
    volume_id: "Disk.Virtual.0:RAID.SL.3-1"
  tags:
    - lock
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Online Capacity Expansion of a volume using target
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: "OnlineCapacityExpansion"
    volume_id: "Disk.Virtual.0:RAID.Integrated.1-1"
    target:
      - "Disk.Bay.2:Enclosure.Internal.0-0:RAID.Integrated.1-1"
  tags:
    - oce_target
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Online Capacity Expansion of a volume using size
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "{{ baseuri }}"
    username: "{{ username }}"
    password: "{{ password }}"
    ca_path: "/path/to/ca_cert.pem"
    command: "OnlineCapacityExpansion"
    volume_id: "Disk.Virtual.0:RAID.Integrated.1-1"
    size: 362785
  tags:
    - oce_size
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set controller attributes.
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    controller_id: "RAID.Slot.1-1"
    attributes:
      ControllerMode: "HBA"
    apply_time: "OnReset"
  tags:
    - controller-attribute
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure controller attributes at Maintenance window
  dellemc.openmanage.idrac_redfish_storage_controller:
    baseuri: "192.168.0.1:443"
    username: "user_name"
    password: "user_password"
    ca_path: "/path/to/ca_cert.pem"
    controller_id: "RAID.Slot.1-1"
    attributes:
      CheckConsistencyMode: Normal
      CopybackMode: "Off"
      LoadBalanceMode: Disabled
    apply_time: AtMaintenanceWindowStart
    maintenance_window:
      start_time: "2022-09-30T05:15:40-05:00"
      duration: 1200

Inputs

    
key:
    description:
    - A new security key passphrase that the encryption-capable controller uses to create
      the encryption key. The controller uses the encryption key to lock or unlock access
      to the Self-Encrypting Drive (SED). Only one encryption key can be created for each
      controller.
    - This is mandatory when I(command) is C(SetControllerKey), C(ReKey), or C(EnableControllerEncryption)
      and when I(mode) is C(LKM).
    - The length of the key can be a maximum of 32 characters in length, where the expanded
      form of the special character is counted as a single character.
    - 'The key must contain at least one character from each of the character classes:
      uppercase, lowercase, number, and special character.'
    type: str

mode:
    choices:
    - LKM
    - SEKM
    default: LKM
    description:
    - Encryption mode of the encryption capable controller.
    - This option is applicable only when I(command) is C(ReKey) or C(EnableControllerEncryption).
    - C(SEKM) requires secure enterprise key manager license on the iDRAC.
    - C(LKM) to choose mode as local key mode.
    type: str

size:
    description:
    - Capacity of the virtual disk to be expanded in MB.
    - Check mode and Idempotency is not supported for I(size).
    - Minimum Online Capacity Expansion size must be greater than 100 MB of the current
      size.
    - When I(command) is C(OnlineCapacityExpansion), then I(size) is mutually exclusive
      with I(target).
    type: int

key_id:
    description:
    - This is a user supplied text label associated with the passphrase.
    - This is mandatory when I(command) is C(SetControllerKey), C(ReKey), or C(EnableControllerEncryption)
      and when I(mode) is C(LKM).
    - The length of I(key_id) can be a maximum of 32 characters in length and should not
      have any spaces.
    type: str

target:
    aliases:
    - drive_id
    description:
    - Fully Qualified Device Descriptor (FQDD) of the target physical drive.
    - This is mandatory when I(command) is C(AssignSpare), C(UnassisgnSpare), C(ChangePDStateToOnline),
      C(ChangePDStateToOffline), C(ConvertToRAID), or C(ConvertToNonRAID).
    - If I(volume_id) is not specified or empty, this physical drive will be assigned
      as a global hot spare when I(command) is C(AssignSpare).
    - When I(command) is C(OnlineCapacityExpansion), then I(target) is mutually exclusive
      with I(size).
    - 'Notes: Global or Dedicated hot spare can be assigned only once for a physical disk,
      Re-assign cannot be done when I(command) is C(AssignSpare).'
    elements: str
    type: list

baseuri:
    description: IP address of the target out-of-band controller. For example- <ipaddress>:<port>.
    required: true
    type: str

ca_path:
    description:
    - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for
      the validation.
    type: path
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

command:
    choices:
    - ResetConfig
    - AssignSpare
    - SetControllerKey
    - RemoveControllerKey
    - ReKey
    - UnassignSpare
    - EnableControllerEncryption
    - BlinkTarget
    - UnBlinkTarget
    - ConvertToRAID
    - ConvertToNonRAID
    - ChangePDStateToOnline
    - ChangePDStateToOffline
    - LockVirtualDisk
    - OnlineCapacityExpansion
    description:
    - These actions may require a system reset, depending on the capabilities of the controller.
    - C(ResetConfig) - Deletes all the virtual disks and unassigns all hot spares on physical
      disks. I(controller_id) is required for this operation.
    - C(AssignSpare) - Assigns a physical disk as a dedicated or global hot spare for
      a virtual disk. I(target) is required for this operation.
    - C(SetControllerKey) - Sets the key on controllers, which is used to encrypt the
      drives in Local Key Management(LKM). I(controller_id), I(key), and I(key_id) are
      required for this operation.
    - C(RemoveControllerKey) - Deletes the encryption key on the controller. I(controller_id)
      is required for this operation.
    - C(ReKey) - Resets the key on the controller and it always reports as changes found
      when check mode is enabled. I(controller_id), I(old_key), I(key_id), and I(key)
      is required for this operation.
    - C(UnassignSpare) - To unassign the Global or Dedicated hot spare. I(target) is required
      for this operation.
    - C(EnableControllerEncryption) - To enable Local Key Management (LKM) or Secure Enterprise
      Key Manager (SEKM) on controllers that support encryption of the drives. I(controller_id),
      I(key), and I(key_id) are required for this operation.
    - C(BlinkTarget) - Blinks the target virtual drive or physical disk and it always
      reports as changes found when check mode is enabled. I(target) or I(volume_id) is
      required for this operation.
    - C(UnBlinkTarget) - Unblink the target virtual drive or physical disk and and it
      always reports as changes found when check mode is enabled. I(target) or I(volume_id)
      is required for this operation.
    - C(ConvertToRAID) - Converts the disk form non-Raid to Raid. I(target) is required
      for this operation.
    - C(ConvertToNonRAID) - Converts the disk form Raid to non-Raid. I(target) is required
      for this operation.
    - C(ChangePDStateToOnline) - To set the disk status to online. I(target) is required
      for this operation.
    - C(ChangePDStateToOffline) - To set the disk status to offline. I(target) is required
      for this operation.
    - C(LockVirtualDisk) - To encrypt the virtual disk. I(volume_id) is required for this
      operation.
    - C(OnlineCapacityExpansion) - To expand the size of virtual disk. I(volume_id), and
      I(target) or I(size) is required for this operation.
    type: str

old_key:
    description:
    - Security key passphrase used by the encryption-capable controller.
    - This option is mandatory when I(command) is C(ReKey) and I(mode) is C(LKM).
    type: str

timeout:
    default: 30
    description: The socket level timeout in seconds.
    type: int
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

job_wait:
    default: false
    description:
    - Provides the option if the module has to wait for the job to be completed.
    - This is applicable for I(attributes) when I(apply_time) is C(Immediate).
    type: bool

password:
    description:
    - Password of the target out-of-band controller.
    - If the password is not provided, then the environment variable C(IDRAC_PASSWORD)
      is used.
    - 'Example: export IDRAC_PASSWORD=password'
    required: true
    type: str

username:
    description:
    - Username of the target out-of-band controller.
    - If the username is not provided, then the environment variable C(IDRAC_USERNAME)
      is used.
    - 'Example: export IDRAC_USERNAME=username'
    required: true
    type: str

volume_id:
    description:
    - Fully Qualified Device Descriptor (FQDD) of the volume.
    - Applicable if I(command) is C(AssignSpare), C(BlinkTarget), C(UnBlinkTarget) or
      C(LockVirtualDisk).
    - I(volume_id) or I(target) is required when the I(command) is C(BlinkTarget) or C(UnBlinkTarget),
      if both are specified I(target) is considered.
    - To know the number of volumes to which a hot spare can be assigned, refer iDRAC
      Redfish API documentation.
    elements: str
    type: list

apply_time:
    choices:
    - Immediate
    - OnReset
    - AtMaintenanceWindowStart
    - InMaintenanceWindowOnReset
    default: Immediate
    description:
    - Apply time of the I(attributes).
    - This is applicable only to I(attributes).
    - C(Immediate) Allows the user to immediately reboot the host and apply the changes.
      I(job_wait) is applicable.
    - C(OnReset) Allows the user to apply the changes on the next reboot of the host server.
    - C(AtMaintenanceWindowStart) Allows the user to apply at the start of a maintenance
      window as specified in I(maintenance_window).
    - C(InMaintenanceWindowOnReset) Allows to apply after a manual reset but within the
      maintenance window as specified in I(maintenance_window).
    type: str

attributes:
    description:
    - Dictionary of controller attributes and value pair.
    - This feature is only supported for iDRAC9 with firmware version 6.00.00.00 and above
    - I(controller_id) is required for this operation.
    - I(apply_time) and I(maintenance_window) is applicable for I(attributes).
    - I(attributes) is mutually exclusive with I(command).
    - Use U(https://I(idrac_ip)/redfish/v1/Schemas/DellOemStorageController.json) to view
      the attributes.
    type: dict

controller_id:
    description:
    - Fully Qualified Device Descriptor (FQDD) of the storage controller. For example-'RAID.Slot.1-1'.
    - This option is mandatory when I(command) is C(ResetConfig), C(SetControllerKey),
      C(RemoveControllerKey), C(ReKey), or C(EnableControllerEncryption).
    - This option is mandatory for I(attributes).
    type: str

validate_certs:
    default: true
    description:
    - If C(false), the SSL certificates will not be validated.
    - Configure C(false) only on personally controlled sites where self-signed certificates
      are used.
    - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default.
    type: bool
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

job_wait_timeout:
    default: 120
    description:
    - The maximum wait time of job completion in seconds before the job tracking is stopped.
    - This option is applicable when I(job_wait) is C(true).
    type: int

maintenance_window:
    description:
    - Option to schedule the maintenance window.
    - This is required when I(apply_time) is C(AtMaintenanceWindowStart) or C(InMaintenanceWindowOnReset).
    suboptions:
      duration:
        default: 900
        description:
        - The duration in seconds for the maintenance window.
        type: int
      start_time:
        description:
        - The start time for the maintenance window to be scheduled.
        - The format is YYYY-MM-DDThh:mm:ss<offset>
        - '<offset> is the time offset from UTC that the current timezone set in iDRAC
          in the format: +05:30 for IST.'
        required: true
        type: str
    type: dict

Outputs

error_info:
  description: Details of a http error.
  returned: on http error
  sample:
    error:
      '@Message.ExtendedInfo':
      - Message: Unable to run the method because the requested HTTP method is not
          allowed.
        MessageArgs: []
        MessageArgs@odata.count: 0
        MessageId: iDRAC.1.6.SYS402
        RelatedProperties: []
        RelatedProperties@odata.count: 0
        Resolution: Enter a valid HTTP method and retry the operation. For information
          about valid methods, see the Redfish Users Guide available on the support
          site.
        Severity: Informational
      code: Base.1.0.GeneralError
      message: A general error has occurred. See ExtendedInfo for more information
  type: dict
msg:
  description: Overall status of the storage controller configuration operation.
  returned: always
  sample: Successfully submitted the job that performs the AssignSpare operation
  type: str
status:
  description: status of the submitted job.
  returned: always
  sample:
    ActualRunningStartTime: '2022-02-09T04:42:41'
    ActualRunningStopTime: '2022-02-09T04:44:00'
    CompletionTime: '2022-02-09T04:44:00'
    Description: Job Instance
    EndTime: TIME_NA
    Id: JID_444033604418
    JobState: Completed
    JobType: RealTimeNoRebootConfiguration
    Message: Job completed successfully.
    MessageArgs: []
    MessageId: PR19
    Name: 'Configure: RAID.Integrated.1-1'
    PercentComplete: 100
    StartTime: '2022-02-09T04:42:40'
    TargetSettingsURI: null
  type: dict
task:
  description: ID and URI resource of the job created.
  returned: success
  sample:
    id: JID_XXXXXXXXXXXXX
    uri: /redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_XXXXXXXXXXXXX
  type: dict