purestorage.flasharray.purefa_volume 模块 – 管理 Pure Storage FlashArrays 上的卷

注意

此模块是 purestorage.flasharray 集合(版本 1.32.0)的一部分。

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

要安装它,请使用:ansible-galaxy collection install purestorage.flasharray。 您需要进一步的要求才能使用此模块,有关详细信息,请参阅要求

要在剧本中使用它,请指定:purestorage.flasharray.purefa_volume

purestorage.flasharray 1.0.0 中的新增功能

概要

  • 在 Pure Storage FlashArray 上创建、删除或扩展卷的容量。

要求

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

  • python >= 3.3

  • purestorage >= 1.19

  • py-pure-client >= 1.26.0

  • netaddr

  • requests

  • pycountry

  • urllib3

参数

参数

注释

add_to_pgs

list / elements=string

在 purestorage.flasharray 1.14.0 中添加

创建时,新卷将添加到指定的保护组

api_token

string

具有管理员权限的用户的 FlashArray API 令牌。

bw_qos

别名:qos

string

卷的带宽限制,单位为 M 或 G。M 将设置 MB/s,G 将设置 GB/s。要清除现有的 QoS 设置,请使用 0(零)

count

integer

在多个卷创建中要创建的卷数

仅从 Purity//FA v6.0.0 及更高版本支持

digits

integer

用于多个卷计数的位数。 这将在必要时用零填充索引号

仅从 Purity//FA v6.0.0 及更高版本支持

范围在 1 到 10 之间

默认值: 1

disable_warnings

boolean

在 purestorage.flasharray 1.29.0 中添加

在调试日志中禁用不安全证书警告

选项

  • false ←(默认)

  • true

eradicate

boolean

定义是否在删除时清除卷或将其留在回收站中。

选项

  • false ←(默认)

  • true

fa_url

string

FlashArray 管理 IPv4 地址或主机名。

iops_qos

string

卷的 IOPs 限制 - 使用值或 K 或 M。K 将表示 1000,M 将表示 1000000。要清除现有的 IOPs 设置,请使用 0(零)

move

string

将卷移入和移出 pod 或 vgroup

提供要将卷移动到的 pod 或 vgroup 的名称

Pod 和 Vgroup 名称在阵列中必须是唯一的

要移动到本地阵列,请指定 local

这不是幂等的 - 在剧本中使用 ignore_errors

name

string / required

卷的名称。

可以使用此语法 POD_NAME::VOLUME_NAME 在 POD 中创建卷。

可以使用此语法 VG_NAME/VOLUME_NAME 在卷组中创建卷。

从 Purity//FA 6.0.0 开始提供多卷支持 ***注意*** 手动删除或清除使用多卷创建的单个卷将导致幂等性失败

多卷支持仅存在于卷创建中

overwrite

boolean

定义是否在目标卷已存在的情况下覆盖该卷。

选项

  • false ←(默认)

  • true

pgroup

string

在 purestorage.flasharray 1.8.0 中添加

要将卷添加到的现有(未删除)保护组的名称

仅适用于卷的创建

从 Purity//FA 6.3.4 开始被 add_to_pgs 取代

priority_operator

string

在 purestorage.flasharray 1.13.0 中添加

DMM 优先级调整运算符

选项

  • "="

  • "+"

  • "-"

priority_value

integer

在 purestorage.flasharray 1.13.0 中添加

DMM 优先级调整值

选项

  • -10

  • 0

  • 10

promotion_state

string

在 purestorage.flasharray 1.16.0 中添加

提升或降级卷,以便该卷开始或停止接受写入请求。

选项

  • "promoted"

  • "demoted"

rename

string

要将指定卷重命名为的值。

重命名仅适用于当前卷所在的容器。

没有必要指定 pod 或 vgroup 名称,因为这是隐含的。

size

string

卷大小,单位为 M、G、T 或 P。

start

integer

启动多个卷创建索引的数字

仅从 Purity//FA v6.0.0 及更高版本支持

默认值: 0

state

string

定义卷是否应该存在。

选项

  • "absent"

  • "present" ←(默认)

suffix

string

多个卷创建所需的后缀字符串

卷名称将形成为 <name>#I<suffix>,其中 # 是卷索引的占位符。 请参阅相关说明

仅从 Purity//FA v6.0.0 及更高版本支持

默认值: ""

target

string

目标卷的名称(如果正在复制)。

with_default_protection

boolean

在 purestorage.flasharray 1.14.0 中添加

是否将默认容器保护组添加到 add_to_pgs 中指定的那些组,作为新卷的初始保护。

选项

  • false

  • true ←(默认)

注释

注意

  • 此模块需要 purestoragepy-pure-client Python 库

  • 特定模块可能需要其他 Python 库。

  • 如果未将 fa_urlapi_token 参数直接传递给模块,则必须设置 PUREFA_URLPUREFA_API 环境变量

示例

- name: Create new volume named foo with a QoS limit
  purestorage.flasharray.purefa_volume:
    name: foo
    size: 1T
    bw_qos: 58M
    iops_qos: 23K
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Create new volume named foo with a DMM priority (Purity//FA 6.1.2+)
  purestorage.flasharray.purefa_volume:
    name: foo
    size: 1T
    priority_operator: +
    priorty_value: 10
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Create new volume named foo in pod bar in protection group pg1
  purestorage.flasharray.purefa_volume:
    name: bar::foo
    pgroup: pg1
    size: 1T
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Create 10 volumes with index starting at 10 but padded with 3 digits
  purestorage.flasharray.purefa_volume:
    name: foo
    size: 1T
    suffix: bar
    count: 10
    start: 10
    digits: 3
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Extend the size of an existing volume named foo
  purestorage.flasharray.purefa_volume:
    name: foo
    size: 2T
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Delete and eradicate volume named foo
  purestorage.flasharray.purefa_volume:
    name: foo
    eradicate: true
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent

- name: Create clone of volume bar named foo
  purestorage.flasharray.purefa_volume:
    name: foo
    target: bar
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Overwrite volume bar with volume foo
  purestorage.flasharray.purefa_volume:
    name: foo
    target: bar
    overwrite: true
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Clear volume QoS from volume foo
  purestorage.flasharray.purefa_volume:
    name: foo
    bw_qos: 0
    iops_qos: 0
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present

- name: Move local volume foo from local array to pod bar
  purestorage.flasharray.purefa_volume:
    name: foo
    move: bar
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Move volume foo in pod bar to local array
  purestorage.flasharray.purefa_volume:
    name: bar::foo
    move: local
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

- name: Move volume foo in pod bar to vgroup fin
  purestorage.flasharray.purefa_volume:
    name: bar::foo
    move: fin
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592

返回值

常见的返回值记录在这里,以下是此模块独有的字段

描述

volume

dictionary

一个描述已更改卷的字典。 只有一些属性会随着各种操作返回。

返回: success

bandwidth_limit

integer

卷带宽限制(字节/秒)

返回: success

created

string

卷创建时间

返回: success

示例: "2019-03-13T22:49:24Z"

iops_limit

integer

卷的 IOPS 限制

返回: success

name

string

卷名称

返回: success

nvme_nguid

string

卷的 NVMe 命名空间全局唯一标识符

返回: success

示例: "eui.00cd6b99ef25864724a937c5000be684"

page83_naa

string

卷的 NAA 规范名称

返回: success

示例: "naa.624a9370361019ecace43db3000120a4"

priority_operator

string

DMM 优先级调整运算符

返回: success

priority_value

integer

DMM 优先级调整值

返回: success

serial

string

卷序列号

返回: success

示例: "361019ECACE43D83000120A4"

size

integer

卷大小,以字节为单位

返回: success

source

string

用于卷复制的源卷的卷名称

返回: success

作者

  • Pure Storage Ansible 团队 (@sdodsley)