dellemc.unity.snapshot 模块 – 管理 Unity 存储系统上的快照
注意
此模块是 dellemc.unity 集合(版本 2.0.0)的一部分。
如果您使用的是 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install dellemc.unity
。您需要进一步的要求才能使用此模块,有关详细信息,请参见要求。
要在剧本中使用它,请指定:dellemc.unity.snapshot
。
dellemc.unity 1.1.0 中的新增功能
概要
管理 Unity 存储系统上的快照包括创建快照、删除快照、更新快照、获取快照、映射主机和取消映射主机。
要求
执行此模块的主机需要以下要求。
Dell Unity 存储设备版本 5.1 或更高版本。
Ansible-core 2.14 或更高版本。
Python 3.9、3.10 或 3.11。
Storops Python SDK 1.2.11。
参数
参数 |
注释 |
---|---|
此选项指定是否自动删除快照。 如果设置为 如果设置为 (false),快照将不会根据池的自动删除策略自动删除。 如果指定了 expiry_time,则选项 auto_delete 不能设置为 如果在创建期间未提及 auto_delete 和 expiry_time,则将创建快照,并将 auto_delete 保留为 一旦设置了 expiry_time,则无法将快照分配给自动删除策略。 选项
|
|
为其创建快照的一致性组的名称。 要创建快照,必须提供 vol_name 或 cg_name。 对于其他操作不是必需的。 |
|
可以使用此选项提供有关快照的其他信息。 |
|
此选项用于指定快照过期的日期和时间。 时间以 UTC 时区提及。 格式为“MM/DD/YYYY HH:MM”。年份必须为 4 位数字。 |
|
主机的 ID。 要将快照映射到主机或从主机取消映射,必须提供 host_name 或 host_id。 快照可以附加到多个主机。 |
|
主机的名称。 要将快照映射到主机或从主机取消映射,必须提供 host_name 或 host_id。 快照可以附加到多个主机。 |
|
host_state 选项用于提及主机对快照的存在。 当快照映射到主机或从主机取消映射时,这是必需的。 选项
|
|
快照的新名称。 |
|
Unity 管理服务器的密码。 |
|
与 Unity 管理服务器通信所通过的端口号。 默认值: |
|
快照的 ID。 对于创建以外的所有操作,必须提供 snapshot_name 或 snapshot_id。 |
|
快照的名称。 创建快照的强制性参数。 对于所有其他操作,必须提供 snapshot_name 或 snapshot_id。 |
|
state 选项用于提及快照的存在。 选项
|
|
Unity 管理服务器的 IP 或 FQDN。 |
|
Unity 管理服务器的用户名。 |
|
布尔变量,用于指定是否验证 SSL 证书。
选项
|
|
为其创建快照的卷的名称。 要创建快照,必须提供 vol_name 或 cg_name。 对于其他操作不是必需的。 |
说明
注意
不支持 check_mode。
此集合中名为“dellemc.unity”的模块旨在支持 Dell Unity 存储平台。
示例
- name: Create a Snapshot for a CG
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
cg_name: "{{cg_name}}"
snapshot_name: "{{cg_snapshot_name}}"
description: "{{description}}"
auto_delete: false
state: "present"
- name: Create a Snapshot for a volume with Host attached
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "{{vol_name}}"
snapshot_name: "{{vol_snapshot_name}}"
description: "{{description}}"
expiry_time: "04/15/2025 16:30"
host_name: "{{host_name}}"
host_state: "mapped"
state: "present"
- name: Unmap a host for a Snapshot
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
snapshot_name: "{{vol_snapshot_name}}"
host_name: "{{host_name}}"
host_state: "unmapped"
state: "present"
- name: Map snapshot to a host
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
snapshot_name: "{{vol_snapshot_name}}"
host_name: "{{host_name}}"
host_state: "mapped"
state: "present"
- name: Update attributes of a Snapshot for a volume
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_name: "{{vol_snapshot_name}}"
new_snapshot_name: "{{new_snapshot_name}}"
description: "{{new_description}}"
host_name: "{{host_name}}"
host_state: "unmapped"
state: "present"
- name: Delete Snapshot of CG
dellemc.unity.snapshot:
unispherehost: "{{unispherehost}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
snapshot_name: "{{cg_snapshot_name}}"
state: "absent"
返回值
通用返回值记录在这里,以下是此模块独有的字段。
键 |
描述 |
---|---|
指示资源是否已更改。 返回: 始终 示例: |
|
快照的详细信息。 返回: 当快照存在时 示例: |
|
快照到期后的日期和时间。 返回: 成功时 |
|
包含关联主机的名称和 ID。 返回: 成功时 |
|
快照实例的唯一标识符。 返回: 成功时 |
|
为快照提到的附加信息。 返回: 成功时 |
|
快照的名称。 返回: 成功时 |
|
快照存在的存储资源的 ID。 返回: 成功时 |
|
快照存在的存储资源的名称。 返回: 成功时 |