huawei.enterprise.hw_enterprise_replication_pair module – Remote Replication Pairs 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_replication_pair.

Synopsis

  • Supports the operations of create, modify, delete, synchronize, split, switch, enable or disable Remote Replications Pairs on huawei Enterprise Storage

  • Support get the details of Remote Replication Pairs

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 pair 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"

  • "health_status"

  • "running_status"

  • "recovery_policy"

  • "speed"

  • "local_res_name"

  • "remote_res_name"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

Remote Replication Pairs unique id.

local_lun_id

string

ID of the local lun resource.

Required when create a remote replication pair.

password

string / required

The password of the PowerStore host.

remote_device_id

string

Remote device ID.

remote_lun_id

string

ID of the remote lun resource.

Required when create a remote replication group.

replication_model

string

Replication model.

Synchronous remote replication, asynchronous remote replication.

Speed defaults to asynchronous if not.

Choices:

  • "synchronous"

  • "asynchronous"

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

speed

string

Rate.

Low,medium,high,highest

Speed defaults to medium if not

Choices:

  • "low"

  • "medium"

  • "high"

  • "highest"

state

string

Define whether the Remote Replication Pairs 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 Remote Replications Pairs
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      local_lun_id: "< local_lun_id >"
      remote_device_id: "< remote_device_id >"
      remote_lun_id: "< remote_lun_id >"
      replication_model: "< synchronous|asynchronous >"
      speed: "< low|medium|high|highest >"
      recovery_policy: "< automatic|manual >"
      state: "present"

  - name: Modify Remote Replications Pairs By Id
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ replication_pair_info.replication_pair_detail.id }}"
      speed: "< low|medium|high|highest >"
      recovery_policy: "< automatic|manual >"
      state: "present"

  - name: Query Multi Remote Replication Pairs
    register: all_remote_replication_pair
    huawei.enterprise.hw_enterprise_replication_pair:
      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
        - health_status
        - running_status
        - recovery_policy
        - replication_model
        - speed
        - local_lun_name
        - local_lun_id
        - remote_lun_name
        - remote_lun_id
        - local_res_type

  - name: Query Remote Replication Pairs By Id
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ replication_pair_info.replication_pair_detail.id }}"
      state: "present"
      filter:
        - id
        - health_status
        - running_status
        - recovery_policy
        - replication_model
        - speed
        - local_lun_name
        - local_lun_id
        - remote_lun_name
        - remote_lun_id
        - local_res_type

  - name: Delete Remote Replication Pairs detail By Id
    huawei.enterprise.hw_enterprise_replication_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ replication_pair_info.replication_pair_detail.id }}"
      state: "absent"

  - name: Synchronize Remote Replications Pairs
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      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: "{{ replication_pair_info.replication_pair_detail.id }}"
      state: "present"

  - name: Split Remote Replications Pairs
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      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: "{{ replication_pair_info.replication_pair_detail.id }}"
      state: "present"

  - name: Switch Remote Replications Pairs
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      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: "{{ replication_pair_info.replication_pair_detail.id }}"
      state: "present"

  - name: Enable remote Replications Pairs Force Protection Secondary Resource
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      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: "{{ replication_pair_info.replication_pair_detail.id }}"
      access: "read_only"
      state: "present"

  - name: Disable remote Replications Pairs Force Protection Secondary Resources
    register: replication_pair_info
    huawei.enterprise.hw_enterprise_replication_pair:
      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: "{{ replication_pair_info.replication_pair_detail.id }}"
      access: "read_write"
      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_remote_replica_pairs create successfully"

replication_pair_detail

complex

Details of the Remote Replication Pair.

Returned: When Remote Replication Pair exists

Sample: {"health_status": "normal", "id": "2100845b12719eb00000000300000003", "local_res_name:": "test1", "recovery_policy:": "automatic", "remote_res_name:": "test2", "replication_model:": "synchronizing", "running_status:": "synchronizing", "speed:": "medium", "vstore_id:": "1", "vstore_name:": "vstore1"}

health_status

string

Remote Replication Pair health status.

Returned: success

id

string

The system generated ID given to the Remote Replication Pair.

Returned: success

local_res_id

string

ID of the local resource.

Returned: success

local_res_name

string

Name of the local resource.

Returned: success

recovery_policy

string

Remote Replication Pair recovery policy.

Returned: success

remote_res_id

string

ID of the remote resource.

Returned: success

remote_res_name

string

Name of the remote resource.

Returned: success

running_status

string

Remote Replication Pair running status.

Returned: success

speed

string

Synchronization rate of the Remote Replication Pair.

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