infinidat.infinibox.infini_map 模块 – 在 Infinibox 上创建和删除卷到主机或集群的映射
注意
此模块是 infinidat.infinibox 集合(版本 1.4.5)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install infinidat.infinibox
。您需要进一步的要求才能使用此模块,有关详细信息,请参阅 要求。
要在 playbook 中使用它,请指定:infinidat.infinibox.infini_map
。
infinidat.infinibox 2.9.0 中的新功能
概要
此模块在 Infinibox 上创建或删除卷到主机或集群的映射。
对于 Linux 主机,在调用此模块后,playbook 应在创建映射时在主机上执行“rescan-scsi-bus.sh”。
当删除映射时,应调用“rescan-scsi-bus.sh –remove”。
对于 Windows 主机,请考虑使用“'rescan' | diskpart”或“Update-HostStorageCache”。
要求
在执行此模块的主机上需要满足以下要求。
python2 >= 2.7 或 python3 >= 3.6
infinisdk (https://infinisdk.readthedocs.io/en/latest/)
参数
参数 |
注释 |
---|---|
集群名称 |
|
主机名 |
|
卷 lun。 |
|
Infinibox 用户密码。 |
|
存在时创建映射,不存在时删除映射,或者在 stat 时提供映射的详细信息。 选择
|
|
Infinibox 主机名或 IPv4 地址。 |
|
具有足够权限的 Infinibox 用户用户名(请参阅说明)。 |
|
要映射到主机的卷名称。 |
说明
注意
此模块需要 infinisdk python 库
如果未直接将用户和密码参数传递给模块,则必须设置 INFINIBOX_USER 和 INFINIBOX_PASSWORD 环境变量
如果没有提供凭据,Ansible 会使用 infinisdk 配置文件
~/.infinidat/infinisdk.ini
。请参阅 http://infinisdk.readthedocs.io/en/latest/getting_started.html所有 Infinidat 模块都支持检查模式(–check)。但是,如果任务的资源依赖项未满足,则创建资源的 dryrun 可能会失败。例如,考虑一个在池中创建卷的任务。如果池不存在,则卷创建任务将失败。即使 playbook 中有之前的任务会创建池,但由于池创建也是 dryrun 的一部分,因此也会失败。
示例
- name: Map a volume to an existing host
infini_map:
host: foo.example.com
volume: bar
state: present # Default
user: admin
password: secret
system: ibox001
- name: Map a volume to an existing cluster
infini_map:
cluster: test-cluster
volume: bar
state: present # Default
user: admin
password: secret
system: ibox001
- name: Unmap volume bar from host foo.example.com
infini_map:
host: foo.example.com
volume: bar
state: absent
system: ibox01
user: admin
password: secret
- name: Stat mapping of volume bar to host foo.example.com
infini_map:
host: foo.example.com
volume: bar
state: stat
system: ibox01
user: admin
password: secret