netapp_eseries.santricity.na_santricity_snapshot 模块 – NetApp E 系列存储系统的快照。

注意

此模块是 netapp_eseries.santricity 集合 (版本 1.4.1) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install netapp_eseries.santricity

要在 playbook 中使用它,请指定:netapp_eseries.santricity.na_santricity_snapshot

概要

  • 管理 NetApp E 系列存储系统的快照。

参数

参数

注释

alert_threshold_pct

整数

已用保留容量百分比,达到此值将发出警报。

默认值: 75

api_password

字符串 / 必填

用于向 SANtricity Web Services Proxy 或嵌入式 Web Services API 进行身份验证的密码。

api_url

字符串 / 必填

SANtricity Web Services Proxy 或嵌入式 Web Services API 的 URL。

示例 https://prod-1.wahoo.acme.com:8443/devmgr/v2

api_username

字符串 / 必填

用于向 SANtricity Web Services Proxy 或嵌入式 Web Services API 进行身份验证的用户名。

group_name

字符串 / 必填

快照一致性组或快照卷的名称。

请务必为快照一致性组和快照卷使用不同的名称,以避免名称冲突。

maximum_snapshots

整数

要维护的快照映像总数。

默认值: 32

pit_description

字符串

一致性组快照映像的任意描述

pit_name

字符串

一致性组快照映像的名称。

pit_timestamp

字符串

快照映像时间戳,格式为 YYYY-MM-DD HH:MM:SS (AM|PM)(小时、分钟、秒和时间段是可选的)

只需定义足够的时间来区分所需的快照映像和其他映像。

如果未指定时间段指示符 (AM, PM),则将假定为 24 小时制。

术语“最新”和“最旧”可用于选择最新和最旧的一致性组映像。

与 *pit_name 或 pit_description* 互斥

preferred_reserve_storage_pool

字符串

保留容量卷的默认首选存储池或卷组。

如果未定义,则将选择基础卷的存储池或卷组。

用于指定快照一致性组卷成员和快照卷的存储池或卷组

reserve_capacity_full_policy

字符串

保留容量已满时的策略。

Purge 将删除一致性组中基础卷的最旧快照映像。

拒绝写入基础卷(保持快照映像有效)。

选项

  • "purge" ← (默认)

  • "reject"

reserve_capacity_pct

整数

为快照写时复制 (COW) 保留的基础卷容量的默认百分比。

用于定义快照一致性组卷成员和快照卷的保留容量。

默认值: 40

rollback_backup

布尔值

是否应在执行回滚之前拍摄时间点快照。

选项

  • false

  • true ← (默认)

rollback_priority

字符串

存储系统为还原快照时间点指定的优先级。

选项

  • "highest"

  • "high"

  • "medium" ← (默认)

  • "low"

  • "lowest"

ssid

字符串

要管理的阵列的 ID。此值对于每个阵列必须唯一。

默认值: "1"

state

字符串

当 *state==absent* 时,确保已删除 *type*。

当 *state==present* 时,确保 *type* 可用。

当 *state==rollback* 时,一致性组将回滚到由 *pit_name 或 pit_timestamp* 选择的时间点快照映像。

*state==rollback* 将始终返回已更改,因为无法评估基础卷相对于快照映像的当前状态。

选项

  • "absent"

  • "present" ← (默认)

  • "rollback"

type

字符串

要影响的快照对象的类型。

Group 表示快照一致性组;一致性组可能具有一个或多个在 *volumes* 中定义的基础卷成员。

Pit 表示快照一致性组时间点映像;当 *state==present* 时,将为每个基础卷拍摄快照映像。

警告!当 *state==absent and type==pit* 时,必须定义 *pit_name* 或 *pit_timestamp*,并且在选择之前创建的所有时间点映像也将被删除。

视图指示特定时间点映像的一致性组快照卷;将为每个基本卷成员创建快照卷。

视图是从单个时间点的映像创建的,因此一旦创建就不能修改。

选项

  • "group" ← (默认)

  • "pit"

  • "view"

validate_certs

布尔值

是否验证https证书?

选项

  • false

  • true ← (默认)

view_host

字符串

映射快照卷的默认主机或主机组。

view_name

字符串

一致性组快照卷组。

state==volume或在state==absent时确保视图不存在时需要。

view_validate

布尔值

是否默认验证快照卷。

选项

  • false ← (默认)

  • true

view_writable

布尔值

快照卷是否默认为可写。

选项

  • false

  • true ← (默认)

volumes

列表 / 元素=字典

每个一致性组基本卷的详细信息,用于定义保留容量、首选保留容量存储池和快照卷选项。

state==present and type==group时,卷条目将用于向快照一致性组添加或删除基本卷。

state==present and type==view时,卷条目将用于为其各自的快照卷选择来自时间点的映像。

如果state==present and type==view且未指定volume,则将使用默认值选择所有卷。

视图是从单个时间点的映像创建的,因此一旦创建就不能修改。

state==rollback时,可以使用volumes指定要回滚的基本卷;否则,所有一致性组卷都将回滚。

preferred_reserve_storage_pool

字符串

保留容量卷的首选存储池或卷组。

如果未定义,则将选择基础卷的存储池或卷组。

用于指定快照一致性组卷成员和快照卷的存储池或卷组

reserve_capacity_pct

整数

为快照写时复制 (COW) 保留的基本卷容量的百分比。

用于定义快照一致性组卷成员和快照卷的保留容量。

默认值: 40

snapshot_volume_host

字符串

映射快照卷的主机或主机组。

snapshot_volume_lun

整数

快照卷的LUN ID。

snapshot_volume_validate

布尔值

是否应验证快照卷,包括媒体扫描和奇偶校验验证。

选项

  • false ← (默认)

  • true

snapshot_volume_writable

布尔值

基本卷映像的快照卷是否可写。

选项

  • false

  • true ← (默认)

volume

字符串 / 必填

一致性组的基本卷。

注释

注意

  • 使用键值对跟踪快照名称和描述,因为快照时间点映像确实具有与其数据结构关联的元数据;因此,需要清除不再与实际映像关联的旧键。每次执行此模块时都会执行此清除操作。

  • E 系列 Ansible 模块需要 Web 服务代理 (WSP) 实例可用以管理存储系统,或者支持嵌入式 Web 服务 API 的 E 系列存储系统。

  • 嵌入式 Web 服务目前在 E2800、E5700、EF570 和更新的硬件型号上可用。

  • netapp_eseries.santricity.netapp_e_storage_system 可用于配置由 WSP 实例管理的系统。

示例

- name: Ensure snapshot consistency group exists.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: present
    type: group
    group_name: snapshot_group1
    volumes:
      - volume: vol1
        reserve_capacity_pct: 20
        preferred_reserve_storage_pool: vg1
      - volume: vol2
        reserve_capacity_pct: 30
      - volume: vol3
    alert_threshold_pct: 80
    maximum_snapshots: 30
- name: Take the current consistency group's base volumes point-in-time snapshot images.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: present
    type: pit
    group_name: snapshot_group1
    pit_name: pit1
    pit_description: Initial consistency group's point-in-time snapshot images.
- name: Ensure snapshot consistency group view exists and is mapped to host group.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: present
    type: view
    group_name: snapshot_group1
    pit_name: pit1
    view_name: view1
    view_host: view1_hosts_group
    volumes:
      - volume: vol1
        reserve_capacity_pct: 20
        preferred_reserve_storage_pool: vg4
        snapshot_volume_writable: false
        snapshot_volume_validate: true
      - volume: vol2
        reserve_capacity_pct: 20
        preferred_reserve_storage_pool: vg4
        snapshot_volume_writable: true
        snapshot_volume_validate: true
      - volume: vol3
        reserve_capacity_pct: 20
        preferred_reserve_storage_pool: vg4
        snapshot_volume_writable: false
        snapshot_volume_validate: true
    alert_threshold_pct: 80
    maximum_snapshots: 30
- name: Rollback base volumes to consistency group's point-in-time pit1.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: present
    type: group
    group_name: snapshot_group1
    pit_name: pit1
    rollback: true
    rollback_priority: high
- name: Ensure snapshot consistency group view no longer exists.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: absent
    type: view
    group_name: snapshot_group1
    view_name: view1
- name: Ensure that the consistency group's base volumes point-in-time snapshot images pit1 no longer exists.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: absent
    type: image
    group_name: snapshot_group1
    pit_name: pit1
- name: Ensure snapshot consistency group no longer exists.
  na_santricity_snapshot:
    ssid: "1"
    api_url: https://192.168.1.100:8443/devmgr/v2
    api_username: admin
    api_password: adminpass
    state: absent
    type: group
    group_name: snapshot_group1

返回值

公共返回值已在此处记录此处,以下是此模块特有的字段

描述

changed

布尔值

是否已进行更改。

已返回:始终

deleted_metadata_keys

列表 / 元素=字符串

已从键值数据存储中清除的键。

已返回:始终

group_changes

字典

对一致性组执行的所有更改。

已返回:始终

作者

  • Nathan Swartz (@swartzn)

  • Vu Tran (@VuTran007)