huawei.enterprise.hw_enterprise_hyper_pair module – HyperMetro Pair 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_hyper_pair.

Synopsis

  • Supports the operations of create, delete, modify, start, stop, swap and synchronize HyperMetro Pair On Huawei Enterprise Storage

  • Support get the details of HyperMetro Pair 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

HyperMetro domain description.

domain_id

string

HyperMetro domain ID.

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"

  • "domain_name"

  • "vstore_id"

  • "vstore_name"

hc_resource_type

string

Primary resource type of the HyperMetro pair.

Should setup to 1:LUN.

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

HyperMetro pair unique id. Either id or name is required when operate HyperMetro Pair.

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

local_obj_id

string

Local lun ID.

name

string

HyperMetro pair unique name. Either id or name is required when operate HyperMetro Pair.

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

password

string / required

The password of the PowerStore host.

recovery_policy

string

Recovery policy.

speed defaults to automatic if not.

Choices:

  • "automatic|manual"

remote_obj_id

string

Remote lun ID.

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

speed

string

Synchronization rate of the HyperMetro pair.

speed defaults to medium if not.

Choices:

  • "low|medium|high|highest"

state

string / required

Define whether the HyperMetro Pair 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 HyperMetro Pair
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      hc_resource_type: "lun"
      local_obj_id: "< local_obj_id >"
      remote_obj_id: "< remote_obj_id >"
      domain_id: "< domain_id > "
      recovery_policy: "< automatic|manual >"
      speed: "< low|medium|high|highest >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify HyperMetro Pair By Id
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      recovery_policy: "< automatic|manual >"
      speed: "< low|medium|high|highest >"
      state: "present"

  - name: Query Multi Hypermetro Pair
    register: all_hypermetro_pair
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      state: "present"
      vstore_id: "< vstore_id >"
      filter:
        - id
        - health_status
        - running_status
        - recovery_policy
        - speed
        - domain_name
        - vstore_id
        - vstore_name

  - name: Query HyperMetro Pair By Id
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      state: "present"
      filter:
        - id
        - health_status
        - running_status
        - recovery_policy
        - speed
        - domain_name
        - vstore_id
        - vstore_name

  - name: Delete HyperMetro Pair By Id
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      use_log: "{{ use_log }}"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      state: "absent"

  - name: Force Start HyperMetro Pair
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      use_log: "{{ use_log }}"
      operation: "start"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      state: "present"

  - name: Stop HyperMetro Pair
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      use_log: "{{ use_log }}"
      operation: "stop"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      state: "present"

  - name: Swap HyperMetro Pair
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      use_log: "{{ use_log }}"
      operation: "swap"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.id }}"
      state: "present"

  - name: Synchronize HyperMetro Pair
    register: hypermetro_pair_info
    huawei.enterprise.hw_enterprise_hyper_pair:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      use_log: "{{ use_log }}"
      operation: "synchronize"
      id: "{{ hypermetro_pair_info.hypermetro_pair_detail.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

hypermetro_pair_detail

complex

Details of the HyperMetro Pair.

Returned: When HyperMetro Pair exists

Sample: {"domain_name": "name_1", "health_status": "1", "id": "e4c2d1eaf02c0001", "recovery_policy:": "1", "running_status:": "41", "speed:": "2", "vstore_id:": "1", "vstore_name:": "vstore1"}

domain_name

string

HyperMetro domain name.

Returned: success

health_status

string

HyperMetro pair health status.

Returned: success

id

string

The system generated ID given to the HyperMetro Pair.

Returned: success

recovery_policy

string

HyperMetro pair recovery policy.

Returned: success

running_status

string

HyperMetro pair running status.

Returned: success

speed

string

Synchronization rate of the HyperMetro pair.

Returned: success

vstore_id

string

id of storage vstore.

Returned: success

vstore_name

string

name of storage vstore.

Returned: success

remark

string

task execute remark

Returned: always

Sample: "Task sample_hypermetro_pair create successfully"

Authors

  • Huawei eSDK Ansible Team