purestorage.flasharray.purefa_host 模块 – 管理 Pure Storage FlashArray 上的主机
注意
此模块是 purestorage.flasharray 集合 (版本 1.32.0) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install purestorage.flasharray。您需要其他要求才能使用此模块,请参阅 要求 以了解详情。
要在 playbook 中使用它,请指定:purestorage.flasharray.purefa_host。
purestorage.flasharray 1.0.0 中的新增功能
摘要
- 在 Pure Storage FlashArray 上创建、删除或修改主机。 
要求
在执行此模块的主机上需要以下要求。
- python >= 3.3 
- purestorage >= 1.19 
- py-pure-client >= 1.26.0 
- netaddr 
- requests 
- pycountry 
- urllib3 
参数
| 参数 | 注释 | 
|---|---|
| 具有管理员权限用户的 FlashArray API 令牌。 | |
| 在多主机创建中要创建的主机数量 仅支持 Purity//FA v6.0.0 及更高版本 | |
| 用于多主机计数的数字位数。这将在必要时用零填充索引号 仅支持 Purity//FA v6.0.0 及更高版本 范围在 1 到 10 之间 默认值:  | |
| 禁用调试日志中的不安全证书警告 选项 
 | |
| FlashArray 管理 IPv4 地址或主机名。 | |
| 设置用于 CHAP 身份验证的主机密码 密码长度在 12 到 255 个字符之间 要清除用户名/密码对,请使用 *clear* 作为密码 设置密码是非幂等的 | |
| 设置用于 CHAP 身份验证的主机用户名 与 *host_password* 结合使用时必填 要清除用户名/密码对,请使用 *clear* 作为密码 | |
| 主机 IQN 列表。 | |
| 分配给主机卷的 LUN ID。必须唯一。 如果未提供,则将自动分配 ID。 LUN ID 的范围是 1 到 4095。 | |
| 主机名称。 请注意,主机名区分大小写,但 FlashArray 主机名是唯一的,并且忽略大小写 - 您不能同时拥有 *hosta* 和 *hostA* Purity//FA 6.0.0 版起支持多主机 **注意** 使用多主机创建的单个主机的 manual 删除会导致幂等性失败 多主机支持仅适用于主机创建 | |
| 主机 NQN 列表。请注意,NMVe 主机只能拥有 NQN。这些主机不允许使用多协议。 | |
| 定义主机使用的操作系统。推荐用于 ActiveCluster 集成。 选项 
 | |
| ActiveCluster 环境中首选阵列的列表。 要从主机中删除现有首选阵列,请指定 *delete*。 | |
| 定义卷的主机连接协议。 已弃用,不再是必需的参数 选项 
 | |
| 要重命名的名称。 请注意,主机名区分大小写,但 FlashArray 主机名是唯一的,并且忽略大小写 - 您不能同时拥有 *hosta* 和 *hostA* | |
| 多主机创建索引的起始编号 仅支持 Purity//FA v6.0.0 及更高版本 默认值:  | |
| 定义主机是否存在。 删除主机时,所有连接的卷都将断开连接。 选项 
 | |
| 如果需要,用于多主机创建的后缀字符串 主机名将形成如下格式:<name>#<suffix>,其中 *#* 是主机索引的占位符,请参见相关的描述 后缀字符串是可选的 仅支持 Purity//FA v6.0.0 及更高版本 | |
| 设置 CHAP 认证的目标密码 密码长度在 12 到 255 个字符之间 要清除用户名/密码对,请使用 *clear* 作为密码 设置密码是非幂等的 | |
| 设置 CHAP 认证的目标用户名 与target_password一起使用 要清除用户名/密码对,请使用 *clear* 作为密码 | |
| 主机关联的 VLAN ID。 如果未设置或设置为any,主机可以访问任何 VLAN。 如果设置为untagged,主机只能访问未标记的 VLAN。 如果设置为 1 到 4094 之间的数字,主机只能访问指定编号的 VLAN。 | |
| 要映射到主机的卷名。 | |
| 主机的 WWN 列表。 | 
注释
注意
- 如果指定 - lun选项,请确保主机支持请求的值
- 此模块需要 - purestorage和- py-pure-clientPython 库
- 特定模块可能需要其他 Python 库。 
- 如果未直接将fa_url和api_token参数传递给模块,则必须设置 - PUREFA_URL和- PUREFA_API环境变量
示例
- name: Create new AIX host
  purestorage.flasharray.purefa_host:
    name: foo
    personality: aix
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Create 10 hosts with index starting at 10 but padded with 3 digits
  purestorage.flasharray.purefa_host:
    name: foo
    personality: vms
    suffix: bar
    count: 10
    start: 10
    digits: 3
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: present
- name: Rename host foo to bar
  purestorage.flasharray.purefa_host:
    name: foo
    rename: bar
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete host
  purestorage.flasharray.purefa_host:
    name: foo
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
    state: absent
- name: Make host bar with wwn ports
  purestorage.flasharray.purefa_host:
    name: bar
    wwns:
    - 00:00:00:00:00:00:00:00
    - 11:11:11:11:11:11:11:11
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Make host bar with iSCSI ports
  purestorage.flasharray.purefa_host:
    name: bar
    iqn:
    - iqn.1994-05.com.redhat:7d366003913
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Make host bar with NVMe ports
  purestorage.flasharray.purefa_host:
    name: bar
    nqn:
    - nqn.2014-08.com.vendor:nvme:nvm-subsystem-sn-d78432
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Make mixed protocol host
  purestorage.flasharray.purefa_host:
    name: bar
    iqn:
    - iqn.1994-05.com.redhat:7d366003914
    wwns:
    - 00:00:00:00:00:00:00:01
    - 11:11:11:11:11:11:11:12
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Map host foo to volume bar as LUN ID 12
  purestorage.flasharray.purefa_host:
    name: foo
    volume: bar
    lun: 12
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Disconnect volume bar from host foo
  purestorage.flasharray.purefa_host:
    name: foo
    volume: bar
    state: absent
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Add preferred arrays to host foo
  purestorage.flasharray.purefa_host:
    name: foo
    preferred_array:
    - array1
    - array2
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete preferred arrays from host foo
  purestorage.flasharray.purefa_host:
    name: foo
    preferred_array: delete
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete exisitng WWNs from host foo (does not delete host object)
  purestorage.flasharray.purefa_host:
    name: foo
    wwns: ""
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Set CHAP target and host username/password pairs
  purestorage.flasharray.purefa_host:
    name: foo
    target_user: user1
    target_password: passwrodpassword
    host_user: user2
    host_password: passwrodpassword
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
- name: Delete CHAP target and host username/password pairs
  purestorage.flasharray.purefa_host:
    name: foo
    target_user: user
    target_password: clear
    host_user: user
    host_password: clear
    fa_url: 10.10.10.2
    api_token: e31060a7-21fc-e277-6240-25983c6c4592
