huawei.enterprise.hw_enterprise_replication_const_group module – Remote Replication Consistency Group 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_replication_const_group.

Synopsis

  • Supports the operations of create, modify, delete, split, switch, enable ,disable, add pair to Remote ReplicationCgs, remove pair from Remote ReplicationCgs

  • Support get the details of Remote Replication 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

Remote Replication Consistency Group description

enable_compression

boolean

Link compression.

Choices:

  • false

  • true

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"

  • "health_status"

  • "running_status"

  • "recovery_policy"

  • "speed"

  • "replication_model"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Remote Replication Consistency Group unique id.

Either id or name is required when operate Remote Replication Consistency Group.

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

local_lun_id

string

ID of remote protection group.

Only create replication const group need to set.

local_lun_id and remote_lun_id must be set at same time.

name

string

Remote Replication Consistency Group unique name.

Either id or name is required when operate Remote Replication Consistency Group.

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

pair_id

string

Replication pair IDs.

password

string / required

The password of the PowerStore host.

protect_group_id

string

ID of local protection group.

Required when create replication const group.

recovery_policy

string

Recovery policy

automatic,manual

Recovery policy defaults to automatic if not specific

Choices:

  • "automatic"

  • "manual"

remote_array_id

string

Remote device ID.

Required when create replication const group.

remote_lun_id

string

ID of remote protection group.

Only create replication const group need to set.

local_lun_id and remote_lun_id must be set at same time.

remote_pool_id

string

ID of the remote storage pool.

Only create replication const group need to set.

Mutually exclusive with local_lun_id and remote_lun_id.

Priority is higher than local_lun_id and remote_lun_id.

remote_vstore_id

string

ID of the remote storage vstore.

Only create replication const group need to set.

replication_model

string

Replication model.

Required when create replication const group.

Choices:

  • "synchronous"

  • "asynchronous"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

speed

string

Rate.

speed defaults to medium if not

Choices:

  • "low"

  • "medium"

  • "high"

  • "highest"

state

string

Define whether the Remote Replication 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.

  • Currently, specifying name when creating a Replication consistency group is not supported. The name of the Replication consistency group is automatically generated by the storage system based on the protection group name. Therefore, you can configure any str name here during creation. The function of specifying a name to create a Replication consistency group will be supported later once the storage system updates its capabilities.

  • You Can modify Replication consistency group name after you created it.

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

Examples

tasks:
  - name: Create Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_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: "< name >"
      protect_group_id: "< protect_group_id >"
      remote_array_id: "< remote_array_id >"
      remote_pool_id: "< remote_pool_id >"
      remote_vstore_id: "< remote_vstore_id >"
      local_lun_id: "< local_lun_id >"
      remote_lun_id: "< remote_lun_id >"
      replication_model: "< synchronous|asynchronous >"
      speed: "< low|medium|high|highest >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify Remote Replication Consistency Group By Id
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_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: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      new_name: "< remote_replication_new_name >"
      description: "< description >"
      speed: "< low|medium|high|highest >"
      recovery_policy: "< automatic|manual >"
      enable_compression: < true | false >
      state: "present"

  - name: Modify Remote Replication Consistency Group By Name
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_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: "< remote_replication_cgs_name >"
      new_name: "< remote_replication_new_name >"
      description: "< description >"
      speed: "< low|medium|high|highest >"
      recovery_policy: "< automatic|manual >"
      enable_compression: < true | false >
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Query Multi Replication Consistency Group
    register: all_remote_replication_cgs
    huawei.enterprise.hw_enterprise_replication_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
        - health_status
        - running_status
        - recovery_policy
        - replication_model
        - speed

  - name: Query Remote Replication Consistency Group By Id
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_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: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      state: "present"
      filter:
        - id
        - name
        - health_status
        - running_status
        - recovery_policy
        - replication_model
        - speed

  - name: Query Remote Replication Consistency Group By Name
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_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: "< remote_replication_cgs_name >"
      vstore_id: "< vstore_id >"
      state: "present"
      filter:
        - id
        - name
        - health_status
        - running_status
        - recovery_policy
        - replication_model
        - speed

  - name: Delete Remote Replication Consistency Group By Id
    huawei.enterprise.hw_enterprise_replication_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: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      state: "absent"

  - name: Delete Remote Replication Consistency Group By Name
    huawei.enterprise.hw_enterprise_replication_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: "< remote_replication_cgs_name >"
      vstore_id: "< vstore_id >"
      state: "absent"

  - name: Synchronize Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "synchronize"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      state: "present"

  - name: Split Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "split"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      state: "present"

  - name: Switch Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "switch"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      state: "present"

  - name: Enable Protection For Remote Replication Consistency Group Secondary Resource
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "enable"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      access: "read_only"
      state: "present"

  - name: Disable Protection Remote Replication Consistency Group Secondary Resource
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "disable"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      access: "read_write"
      state: "present"

  - name: Add Pair to Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "add_pair"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      pair_id: "< pair_id >"
      state: "present"

  - name: Remove Pair to Remote Replication Consistency Group
    register: remote_replication_cgs_info
    huawei.enterprise.hw_enterprise_replication_const_group:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      operation: "remove_pair"
      id: "{{ remote_replication_cgs_info.replication_const_group_detail.id }}"
      pair_id: "< pair_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_replication_consistency_group create successfully"

replication_const_group_detail

complex

Details of the Remote Replication Consistency Group.

Returned: When host exists

Sample: {"health_status": "normal", "id": "2100845b12719eb00000000300000003", "name": "cg_rep_A_PG0002581", "recovery_policy:": "automatic", "replication_model:": "synchronizing", "running_status:": "synchronizing", "speed:": "medium", "vstore_id:": "1", "vstore_name:": "vstore1"}

health_status

string

Remote Replication Consistency Group health status.

Returned: success

id

string

The system generated ID given to the Remote Replication Consistency Group.

Returned: success

name

string

Name of the Remote Replication Consistency Group.

Returned: success

recovery_policy

string

Remote Replication Consistency Group recovery policy.

Returned: success

replication_model

string

Replication mode.

Returned: success

running_status

string

Remote Replication Consistency Group running status.

Returned: success

speed

string

Rate.

Returned: success

vstore_id

string

id of storage vstore

Returned: success

vstore_name

string

name of storage vstore

Returned: success

Authors

  • Huawei eSDK Ansible Team