huawei.enterprise.hw_enterprise_snap_const_group module – Snapshot Consistency Group Operations for Huawei Enterprise Storage

Note

This module is part of the huawei.enterprise collection (version 2.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install huawei.enterprise. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: huawei.enterprise.hw_enterprise_snap_const_group.

Synopsis

  • Supports the operations of create, modify, delete, active, deActive, rollback, cancelRollBack, restore and mapping Snapshot Consistency Group On Huawei Enterprise Storage

  • Support get the details of Snapshot Consistency Group information

Requirements

The below requirements are needed on the host that executes this module.

  • Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage

Parameters

Parameter

Comments

custom_vars

dictionary

Parameters used to extend those not currently supported by the module.

Configuration needs to be based on the REST API documentation for storage.

If necessary, you can contact the plugin technical support for assistance.

description

string

Snapshot Consistency Group description

filter

list / elements=string

Parameter required for all query operations.

The response will include the storage parameters that match the indicate filter criteria.

Choices:

  • "id"

  • "name"

  • "parent_id"

  • "parent_name"

  • "speed"

  • "running_status"

  • "vstoreId"

  • "vstoreName"

host_id

string

Used to deliver the mapping information.

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Snapshot Consistency Group unique id.

Either id or name is required when operate Snapshot Consistency Group

id has higher priority than name when both pass to parameter.

lun_group_name

string

new LUN group name use to mapping Snapshot Consistency Group.

name

string

Snapshot Consistency Group unique name.

Either id or name is required when operate Snapshot Consistency Group.

name has lower priority than id when both pass to parameter.

parent_id

string

Parent object ID (Snapshot Consistency Group ID).

Required when creating snapshot

password

string / required

The password of the PowerStore host.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

speed

string

Rollback speed

Choices:

  • "low"

  • "medium"

  • "high"

  • "highest"

state

string

Define whether the Snapshot Consistency Group exist or not.

Choices:

  • "present"

  • "absent"

storage_port

integer

Port number for the Huawei Enterprise array.

If not passed, it will take 8088 as default.

Default: 8088

use_log

boolean

Whether to write plugin log to local filesystem.

Choices:

  • false ← (default)

  • true

username

string / required

The username of the PowerStore host.

valid_certs

string

The path of the SSL certificate variable to specify whether to validate SSL certificate or not.

If don’t set means no need to verify ssl cert.

vstore_id

string

id of storage vstore

vstore id default to 0:System Vstore if not specified.

Notes

Note

  • The check_mode is not supported.

  • The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.

Examples

tasks:
  - name: Create SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< snapshot_cgs_name >"
      parent_id: "< parent_id >"
      description: "< description >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify SnapshotCGs By ID
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      new_name: "< snapshot_cgs_new_name >"
      speed: "< low|medium|high|highest >"
      description: "< description >"
      state: "present"

  - name: Modify SnapshotCGs By Name
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< snapshot_cgs_name >"
      new_name: "< snapshot_cgs_new_name >"
      speed: "< low|medium|high|highest >"
      description: "< description >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Query Multi SnapshotCGs
    register: all_snapshot_cgs
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      vstore_id: "< vstore_id >"
      state: "present"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - parent_name
        - description
        - speed
        - running_status

  - name: Query SnapshotCGs By ID
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      state: "present"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - parent_name
        - description
        - speed
        - running_status

  - name: Query SnapshotCGs By Name
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      state: "present"
      filter:
        - id
        - name
        - vstore_name
        - vstore_id
        - parent_id
        - parent_name
        - description
        - speed
        - running_status

  - name: Delete SnapshotCGs By ID
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      state: "absent"

  - name: Delete SnapshotCGs By Name
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      state: "absent"

  - name: Active SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "active"
      state: "present"

  - name: DeActive SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "de_active"
      state: "present"

  - name: RollBack SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "rollback"
      state: "present"

  - name: CancelRollBack SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "cancel_rollback"
      state: "present"

  - name: Restore SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "restore"
      state: "present"

  - name: Mapping SnapshotCGs
    register: snapshot_cgs_info
    huawei.enterprise.hw_enterprise_snap_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ snapshot_cgs_info.snapshot_cgs_detail.id }}"
      name: "< snapshot_cgs_name >"
      vstore_id: "< vstore_id >"
      operation: "mapping"
      lun_group_name: "{{ lun_group_name }}"
      host_id: "{{ host_id }}"
      state: "present"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

actions

list / elements=string

playbook action lists

Returned: always

Sample: ["create"]

changed

boolean

Whether or not the resource has changed.

Returned: always

Sample: false

remark

string

task execute remark

Returned: always

Sample: "Task sample_snapshot_consistency_group create successfully"

snapshot_cgs_detail

complex

Details of the Snapshot Consistency Group.

Returned: When Snapshot Consistency Group exists

Sample: {"description": "Snapshot Consistent group description", "id": "1", "name": "Snapshot Consistency Group", "parent_id": "1", "parent_name": "lunCg1", "running_status": "normal", "speed": "low", "vstore_id:": "1", "vstore_name:": "vstore1"}

description

string

description of snapshot consistent group.

Returned: success

id

string

The system generated ID given to the Snapshot Consistency Group.

Returned: always

name

string

Name of the Snapshot Consistency Group.

Returned: always

parent_id

string

ID of the parent object (LUN consistency group ID).

Returned: always

parent_name

string

Name of the parent object (LUN consistency group ID).

Returned: always

running_status

string

HyperMetro domain name.

Returned: always

speed

string

Rollback speed.

Returned: always

vstore_id

string

id of storage vstore.

Returned: always

vstore_name

string

name of storage vstore.

Returned: always

Authors

  • Huawei eSDK Ansible Team