huawei.enterprise.hw_enterprise_hyper_cdp module – HyperCdp 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_cdp.

Synopsis

  • Create, delete, modify, revert, cancel_revert and get the detail of a LUN HyperCdp

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.

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"

  • "vstore_name"

  • "vstore_id"

  • "parent_id"

  • "parent_name"

  • "running_status"

  • "speed"

  • "protect_period"

  • "protect_period_unit"

hostname

string / required

IP or FQDN of the huawei enterprise management system.

MultiIP config as ip1,ip2

id

string

HyperCdp unique id, Mutually exclusive with “name”, Priority is higher than name.

name

string

HyperCdp unique name, Required for create operation. Mutually exclusive with id.

parent_id

string

Parent Lun ID, Required for create operation.

password

string / required

The password of the PowerStore host.

protect_period

string

Protection period of a secure snapshot.

The protection period of a secure snapshot ranges from 1 day to 20 years.

protect_period_unit

string

Unit of the secure snapshot protection period.

Choices:

  • "day"

  • "month"

  • "year"

secure_snap_enabled

boolean

Specifies whether the secure snapshot function is enabled.

Choices:

  • false

  • true

socket_timeout

integer

Huawei Enterprise Storage rest api Timeout time.

Default: 60

state

string / required

Define whether the LUN HyperCdp should exist or not.

Choices:

  • "absent"

  • "present"

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.

It defaults to 0:SystemVstore 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 HyperCdp
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< hyper_cdp_name >"
      parent_id: "< parent_id >"
      secure_snap_enabled: < true|false >
      protect_period: "< protect_period >"
      protect_period_unit: "< day|month|year >"
      vstore_id: "< vstore_id >"
      state: "present"

  - name: Modify HyperCdp By Id
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hyper_cdp_info.hyper_cdp_detail.id }}"
      new_name: "< hyper_cdp_new_name >"
      secure_snap_enabled: < true|false >
      protect_period: "< protect_period >"
      protect_period_unit: "< day|month|year >"
      state: "present"

  - name: Modify HyperCdp By Name
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
        hostname: "{{ hostname }}"
        username: "{{ username }}"
        password: "{{ password }}"
        valid_certs: "{{ valid_certs }}"
        socket_timeout: "{{ socket_timeout }}"
        storage_port: "{{ storage_port }}"
        use_log: "{{ use_log }}"
        name: "< hyper_cdp_name >"
        new_name: "< hyper_cdp_new_name >"
        secure_snap_enabled: < true|false >
        protect_period: "< protect_period >"
        protect_period_unit: "< day|month|year >"
        vstore_id: "< vstore_id >"
        state: "present"

  - name: Query Multi HyperCdp
    register: all_hyper_cdp
    huawei.enterprise.hw_enterprise_hyper_cdp:
      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
        - parent_id
        - parent_name
        - running_status
        - speed
        - protect_period
        - protect_period_unit
        - vstore_id
        - vstore_name

  - name: Query HyperCdp detail By Name
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      name: "< hyper_cdp_name >"
      vstore_id: "< vstore_id >"
      state: "present"
      filter:
        - id
        - name
        - parent_id
        - parent_name
        - running_status
        - speed
        - protect_period
        - protect_period_unit
        - vstore_id
        - vstore_name

  - name: Query HyperCdp Detail By Id
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hyper_cdp_info.hyper_cdp_detail.id }}"
      state: "present"
      filter:
        - id
        - name
        - parent_id
        - parent_name
        - running_status
        - speed
        - protect_period
        - protect_period_unit
        - vstore_id
        - vstore_name

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

  - name: Delete HyperCdp By Id
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hyper_cdp_info.hyper_cdp_detail.id }}"
      state: "absent"

  - name: Revert HyperCdp By Id
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hyper_cdp_info.hyper_cdp_detail.id }}"
      operation : "revert"
      state: "present"

  - name: Cancel Revert HyperCdp By Id
    register: hyper_cdp_info
    huawei.enterprise.hw_enterprise_hyper_cdp:
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      valid_certs: "{{ valid_certs }}"
      socket_timeout: "{{ socket_timeout }}"
      storage_port: "{{ storage_port }}"
      use_log: "{{ use_log }}"
      id: "{{ hyper_cdp_info.hyper_cdp_detail.id }}"
      operation : "cancel_revert"
      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

hyper_cdp_detail

complex

Details of the LUN HyperCdp.

Returned: When host exists

Sample: {"id": "1", "name": "sample_hyper_cdp", "parent_id": "3", "parent_name": "sample_lun", "protect_period": "2", "protect_period_unit": "month", "running_status": "activated", "speed": "medium", "vstore_id": "0", "vstore_name": "System_vStore"}

id

string

The system generated ID given to the HyperCdp.

Returned: success

name

string

Name of the LUN HyperCdp.

Returned: success

parent_id

string

Source LUN ID of the HyperCDP object.

Returned: success

parent_name

string

Source LUN name of the HyperCDP object.

Returned: success

protect_period

string

Protection period of a secure snapshot.

Returned: success

protect_period_unit

string

Unit of the secure snapshot protection period.

Returned: success

running_status

string

Running status of the HyperCDP object.

Returned: success

speed

string

Rollback speed.

Returned: success

vstore_id

string

id of storage vstore.

Returned: always

vstore_name

string

Name of storage vstore.

Returned: always

remark

string

task execute remark

Returned: always

Sample: "sample_hyper_cdp create successfully"

Authors

  • Huawei eSDK Ansible Team