ibm.storage_virtualize.ibm_svc_host 模块 – 此模块管理 IBM Storage Virtualize 系列系统上的主机

注意

此模块是 ibm.storage_virtualize 集合 (版本 2.5.0) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install ibm.storage_virtualize

要在 playbook 中使用它,请指定:ibm.storage_virtualize.ibm_svc_host

ibm.storage_virtualize 1.0.0 中的新增功能

概要

  • 管理“mkhost”、“chhost”和“rmhost”主机命令的 Ansible 接口。

参数

参数

注释

clustername

字符串 / 必需

Storage Virtualize 系统的主机名或管理 IP。

domain

字符串

Storage Virtualize 系统的域名。

当参数 *clustername* 使用主机名时有效。

draftpartition

字符串

在 ibm.storage_virtualize 2.5.0 中添加

指定要分配给主机的草稿分区名称。

当 *state=present* 时有效,用于修改主机。

从 Storage Virtualize 系列系统 8.6.3.0 或更高版本开始支持。

fcwwpn

字符串

要添加到主机的发起程序 WWPN 列表。必须提供完整的 WWPN 列表。

参数 *fcwwpn* 和 *iscsiname* 是互斥的。

当 *state=present* 时,创建或修改光纤通道 (FC) 主机时必需。

hostcluster

字符串

在 ibm.storage_virtualize 1.5.0 中添加

指定要将主机对象添加到其中的主机集群的名称。必须先存在主机集群,然后才能将主机对象添加到其中。

参数 *hostcluster* 和 *nohostcluster* 是互斥的。

当 *state=present* 时有效,用于创建或修改主机。

iogrp

字符串

指定一组或多组输入/输出 (I/O) 组,主机可以从中访问卷。指定后,此参数将无法修改。

当 *state=present* 时有效,用于创建主机。

iscsiname

字符串

要添加到主机的发起程序 IQN 列表。IQN 由逗号分隔。必须提供完整的 IQN 列表。

参数 *fcwwpn* 和 *iscsiname* 是互斥的。

当 *state=present* 时有效,用于创建主机。

log_path

字符串

调试日志文件的路径。

name

字符串 / 必需

为新的主机对象指定名称或标签。

nodraftpartition

布尔值

在 ibm.storage_virtualize 2.5.0 中添加

如果指定为 True,则主机对象将从草稿分区中删除。

参数 *draftpartition* 和 *nodraftpartition* 是互斥的。

当 *state=present* 时有效,用于修改现有主机。

从 Storage Virtualize 系列系统 8.6.3.0 或更高版本开始支持。

选项

  • false

  • true

nohostcluster

布尔值

在 ibm.storage_virtualize 1.5.0 中添加

如果指定为 True,则主机对象将从主机集群中删除。

参数 *hostcluster* 和 *nohostcluster* 是互斥的。

当 *state=present* 时有效,用于修改现有主机。

选项

  • false

  • true

nopartition

布尔值

在 ibm.storage_virtualize 2.1.0 中添加

如果指定为 True,则主机对象将从存储分区中删除。

参数 *partition* 和 *nopartition* 是互斥的。

当 *state=present* 时有效,用于修改现有主机。

从 Storage Virtualize 系列系统 8.6.1.0 或更高版本开始支持。

选项

  • false

  • true

nqn

字符串

在 ibm.storage_virtualize 1.12.0 中添加

要添加到主机的发起程序 NQN 列表。每个 NQN 由逗号分隔。必须提供完整的 NQN 列表。

当 *protocol=rdmanvme 或 tcpnvme* 时,创建时必需。

当 *state=present* 时有效,用于创建或修改主机。

old_name

字符串

在 ibm.storage_virtualize 1.9.0 中添加

在重命名时指定主机的旧名称。

当 *state=present* 时有效,用于重命名现有主机。

partition

字符串

在 ibm.storage_virtualize 2.1.0 中添加

指定要与主机关联的存储分区。

当 *state=present* 时有效,用于创建或修改主机。

从 Storage Virtualize 系列系统 8.6.1.0 或更高版本开始支持。

password

字符串

Storage Virtualize 系统的 REST API 密码。

如果不使用 *token* 来验证用户,则参数 *username* 和 *password* 是必需的。

portset

字符串

在 ibm.storage_virtualize 1.12.0 中添加

指定要与主机关联的端口集。

当 *state=present* 时有效,用于创建或修改主机。

protocol

字符串

指定主机用于与存储系统通信的协议。仅支持“scsi”协议。

当 *state=present* 时有效,用于创建主机。

选项

  • "scsi"

  • "rdmanvme"

  • "tcpnvme"

  • "fcnvme"

site

字符串

指定主机的站点名称。

当 *state=present* 时有效,用于创建或修改主机。

state

字符串 / 必需

创建或更新 (present) 或删除 (absent) 主机。

选项

  • "absent"

  • "present"

token

字符串

在 ibm.storage_virtualize 1.5.0 中添加

用于在 Storage Virtualize 系统上验证用户的身份验证令牌。

要生成令牌,请使用 ibm.storage_virtualize.ibm_svc_auth 模块。

type

字符串

指定主机的类型。

当 *state=present* 时有效,用于创建或修改主机。

username

字符串

Storage Virtualize 系统的 REST API 用户名。

如果不使用 *token* 来验证用户,则参数 *username* 和 *password* 是必需的。

validate_certs

布尔值

验证证书。

选项

  • false ← (默认)

  • true

备注

注意

  • 此模块支持 check_mode

示例

- name: Define a new iSCSI host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host4test
    state: present
    iscsiname: iqn.1994-05.com.redhat:2e358e438b8a
    iogrp: 0:1:2:3
    protocol: scsi
    type: generic
    site: site-name
    portset: portset0
- name: Add a host to an existing host cluster
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host4test
    state: present
    hostcluster: hostcluster0
- name: Define a new FC host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host4test
    state: present
    fcwwpn: 100000109B570216:1000001AA0570266
    iogrp: 0:1:2:3
    protocol: scsi
    type: generic
    site: site-name
- name: Rename an existing host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{ clustername }}"
    domain: "{{ domain }}"
    username: "{{ username }}"
    password: "{{ password }}"
    old_name: "host4test"
    name: "new_host_name"
    state: "present"
- name: Create an iSCSI host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host_name
    iscsiname: iqn.1994-05.com.redhat:2e358e438b8a,iqn.localhost.hostid.7f000001
    state: present
- name: Create a tcpnvme host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host_name
    protocol: tcpnvme
    nqn: nqn.2014-08.org.nvmexpress:NVMf:uuid:644f51bf-8432-4f59-bb13-5ada20c06397
    state: present
- name: Delete a host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: new_host_name
    state: absent
- name: Add existing host to draft partition
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host_name
    state: prersent
    draftpartition: partition_name
- name: Remove a host from a draft partition
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host_name
    state: present
    nodraftpartition: True
- name: Create a fcnvme host
  ibm.storage_virtualize.ibm_svc_host:
    clustername: "{{clustername}}"
    domain: "{{domain}}"
    username: "{{username}}"
    password: "{{password}}"
    log_path: /tmp/playbook.debug
    name: host_name
    protocol: fcnvme
    nqn: nqn.2014-08.org.nvmexpress:b2071fa4-4356-410f-a4ae-7ebfab5b0e90
    portset: portset_name
    state: present

作者

  • Sreshtant Bohidar (@Sreshtant-Bohidar)

  • Rohit Kumar (@rohitk-github)

  • Sandip G. Rajbanshi (@Sandip-Rajbanshi)

  • Lavanya C R (@Lavanya-C-R1)