dellemc.openmanage.redfish_storage_volume 模块 – 管理存储卷配置

注意

此模块是 dellemc.openmanage 集合 (版本 9.9.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install dellemc.openmanage。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求

要在剧本中使用它,请指定:dellemc.openmanage.redfish_storage_volume

dellemc.openmanage 2.1.0 中的新增功能

摘要

  • 此模块允许创建、修改、初始化或删除单个存储卷。

要求

执行此模块的主机需要以下要求。

  • python >= 3.9.6

参数

参数

注释

apply_time

字符串

在 dellemc.openmanage 8.5.0 中添加

卷配置的应用时间。

Immediate 允许您立即在主机服务器上应用卷配置并应用更改。这适用于 *job_wait*。

OnReset 允许您在主机服务器下次重启时应用更改。

*apply_time* 的默认值取决于控制器的不同类型。例如,BOSS-S1 和 BOSS-N1 控制器的 *apply_time* 默认值为 OnReset,而 PERC 控制器的 *apply_time* 默认值为 Immediate

选项

  • "Immediate"

  • "OnReset"

baseuri

字符串 / 必需

目标带外控制器的 IP 地址。例如 - <ipaddress>:<port>。

block_size_bytes

整数

以字节为单位的块大小。仅当 *state* 为 present 时适用。

ca_path

路径

在 dellemc.openmanage 5.0.0 中添加

包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。

capacity_bytes

字符串

以字节为单位的卷大小。

仅当 *state* 为 present 时适用。

command

字符串

initialize 初始化指定 *volume_id* 的现有存储卷。

选项

  • "initialize"

controller_id

字符串

存储控制器的完全限定设备描述符 (FQDD)。

例如 - RAID.Slot.1-1。

当 *state* 为 present 并创建卷时,此选项是必需的。

drives

列表 / 元素=字符串

物理磁盘的 FQDD。

例如 - Disk.Bay.0:Enclosure.Internal.0-1:RAID.Slot.1-1。

仅当创建新卷时 *state* 为 present 时适用。

encrypted

布尔值

指示卷当前是否正在使用加密。

仅当 *state* 为 present 时适用。

选项

  • false

  • true

encryption_types

字符串

可以选择以下加密类型。

ControllerAssisted 卷由存储控制器实体加密。

NativeDriveEncryption 卷利用驱动器硬件的本机驱动器加密功能。

SoftwareAssisted 卷由系统或操作系统上运行的软件加密。

仅当 *state* 为 present 时适用。

选项

  • "NativeDriveEncryption"

  • "ControllerAssisted"

  • "SoftwareAssisted"

force_reboot

布尔值

在 dellemc.openmanage 8.5.0 中添加

当正常重启失败时,强制重启服务器以应用更改。

*force_reboot* 仅当 *reboot_server* 为 true 时适用。

选项

  • false ← (默认)

  • true

initialize_type

字符串

现有卷的初始化类型。

仅当 *command* 为 initialize 时适用。

选项

  • "Fast" ← (默认)

  • "Slow"

job_wait

布尔值

在 dellemc.openmanage 8.5.0 中添加

此参数提供等待作业完成的选项。

当 *apply_time* 为 Immediate 时适用。

当 *apply_time* 为 OnReset 且 *reboot_server* 为 true 时适用。

选项

  • false ← (默认)

  • true

job_wait_timeout

整数

在 dellemc.openmanage 8.5.0 中添加

此参数是 *job_wait* 的最大等待时间(以秒为单位)。

当 *job_wait* 为 true 时适用。

默认值: 1200

name

别名:volume_name

字符串

要创建的卷的名称。

仅当 *state* 为 present 时适用。

oem

字典

包含 OEM 扩展有效负载。

仅当statepresent时适用。

optimum_io_size_bytes

整数

Stripe大小值必须是64 * 1024的倍数。

仅当 *state* 为 present 时适用。

password

字符串

目标带外控制器的密码。

如果未提供密码,则使用环境变量IDRAC_PASSWORD

示例:export IDRAC_PASSWORD=password

raid_type

字符串

在dellemc.openmanage 8.3.0中添加

RAID0 创建RAID0类型卷。

RAID1 创建RAID1类型卷。

RAID5 创建RAID5类型卷。

RAID6 创建RAID6类型卷。

RAID10 创建RAID10类型卷。

RAID50 创建RAID50类型卷。

RAID60 创建RAID60类型卷。

raid_typevolume_type互斥。

选项

  • "RAID0"

  • "RAID1"

  • "RAID5"

  • "RAID6"

  • "RAID10"

  • "RAID50"

  • "RAID60"

reboot_server

布尔值

在 dellemc.openmanage 8.5.0 中添加

重启服务器以应用更改。

只有当apply_timeoutOnReset或控制器的应用时间默认值为OnReset时,reboot_server才适用。

选项

  • false ← (默认)

  • true

state

字符串

present 为指定的I (controller_id)创建一个存储卷,或修改指定的I (volume_id)的存储卷。“注意:现有卷属性的修改取决于驱动器和控制器的功能”。

absent 删除指定volume_id的卷。

选项

  • "present"

  • "absent"

timeout

整数

在 dellemc.openmanage 5.0.0 中添加

套接字级别超时(秒)。

默认值:30

username

字符串

目标带外控制器的用户名。

如果未提供用户名,则使用环境变量IDRAC_USERNAME

示例:export IDRAC_USERNAME=username

validate_certs

布尔值

在 dellemc.openmanage 5.0.0 中添加

如果为false,则不会验证SSL证书。

仅在使用自签名证书的个人控制站点上配置false

在集合版本5.0.0之前,validate_certs默认为false

选项

  • false

  • true ← (默认)

volume_id

字符串

现有卷的FQDD。

例如:Disk.Virtual.4:RAID.Slot.1-1。

此选项在以下情况下是必需的:

当更新卷时,statepresent

当删除卷时,stateabsent

当初始化卷时,commandinitialize

volume_type

字符串

必须选择以下卷类型之一来创建卷。

NonRedundant 卷是非冗余存储设备。

Mirrored 卷是镜像设备。

StripedWithParity 卷是使用奇偶校验来保留冗余信息的设备。

SpannedMirrors 卷是镜像设备的跨区集合。

SpannedStripesWithParity 卷是使用奇偶校验来保留冗余信息的跨区设备集合。

volume_typeraid_type互斥。

选项

  • "NonRedundant"

  • "Mirrored"

  • "StripedWithParity"

  • "SpannedMirrors"

  • "SpannedStripesWithParity"

x_auth_token

字符串

在dellemc.openmanage 9.3.0中添加

身份验证令牌。

如果未提供x_auth_token,则使用环境变量IDRAC_X_AUTH_TOKEN

示例:export IDRAC_X_AUTH_TOKEN=x_auth_token

注释

注意

  • 从此模块可以直接访问Redfish API的系统运行此模块。

  • 此模块支持check_mode

  • 当未指定namevolume_id时,此模块始终报告更改。为了支持check_mode,需要namevolume_id

  • 此模块不支持在iDRAC8上创建RAID6和RAID60存储卷。

  • 此模块支持IPv4和IPv6地址。

示例

---
- name: Create a volume with supported options
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "present"
    volume_type: "Mirrored"
    name: "VD0"
    controller_id: "RAID.Slot.1-1"
    drives:
      - Disk.Bay.5:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.6:Enclosure.Internal.0-1:RAID.Slot.1-1
    block_size_bytes: 512
    capacity_bytes: 299439751168
    optimum_io_size_bytes: 65536
    encryption_types: NativeDriveEncryption
    encrypted: true

- name: Create a volume with minimum options
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    volume_type: "NonRedundant"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1

- name: Create a RAID0 on PERC controller on reset
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    raid_type: "RAID0"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-2
    apply_time: OnReset

- name: Create a RAID0 on BOSS controller with restart
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    raid_type: "RAID0"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-2
    apply_time: OnReset
    reboot_server: true

- name: Create a RAID0 on BOSS controller with force restart
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    raid_type: "RAID0"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-2
    reboot_server: true
    force_reboot: true

- name: Modify a volume's encryption type settings
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "present"
    volume_id: "Disk.Virtual.5:RAID.Slot.1-1"
    encryption_types: "ControllerAssisted"
    encrypted: true

- name: Delete an existing volume
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    state: "absent"
    volume_id: "Disk.Virtual.5:RAID.Slot.1-1"

- name: Initialize an existing volume
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    command: "initialize"
    volume_id: "Disk.Virtual.6:RAID.Slot.1-1"
    initialize_type: "Slow"

- name: Create a RAID6 volume
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    raid_type: "RAID6"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-2
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-3
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-4

- name: Create a RAID60 volume
  dellemc.openmanage.redfish_storage_volume:
    baseuri: "192.168.0.1"
    username: "username"
    password: "password"
    state: "present"
    controller_id: "RAID.Slot.1-1"
    raid_type: "RAID60"
    drives:
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-1
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-2
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-3
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-4
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-5
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-6
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-7
      - Disk.Bay.1:Enclosure.Internal.0-1:RAID.Slot.1-8

返回值

常用返回值已记录在此处,以下是此模块特有的字段

描述

error_info

字典

http错误的详细信息。

返回:http错误时

示例:{"error": {"@Message.ExtendedInfo": [{"Message": "Unable to perform configuration operations because a configuration job for the device already exists.", "MessageArgs": [], "[email protected]": 0, "MessageId": "IDRAC.1.6.STOR023", "RelatedProperties": [], "[email protected]": 0, "Resolution": "Wait for the current job for the device to complete or cancel the current job before attempting more configuration operations on the device.", "Severity": "Informational"}], "code": "Base.1.2.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information"}}

msg

字符串

存储配置操作的总体状态。

返回:始终

示例:"Successfully submitted create volume task."

task

字典

返回已创建任务的ID和URI。

返回:成功

示例:{"id": "JID_XXXXXXXXXXXXX", "uri": "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_XXXXXXXXXXXXX"}

作者

  • Sajna Shetty(@Sajna-Shetty)

  • Kritika Bhateja(@Kritika-Bhateja-03)

  • Shivam Sharma(@ShivamSh3)