huawei.enterprise.hw_enterprise_protect_group module – Protect 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_protect_group.
Synopsis
Supports the operations of create, modify, delete, add lun and remove lun for Protect group.
Support get the details of Protect 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 |
|---|---|
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. |
|
Protect group description. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
Protect group unique id. Either id or name is required when operate Protect group. id has higher priority than name when both pass to parameter. |
|
LUN group ID when creat a Protect group. if Lun group id is indicate when create Protect group, you can not add lun to Protect group. |
|
LUN ID when add or remove to Protect group. if Lun group id is indicate when create Protect group, you can not add lun to Protect group. |
|
Protect group unique name. Either id or name is required when operate Protect group. name has lower priority than id when both pass to parameter. |
|
The password of the PowerStore host. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the Protect group exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Whether to write plugin log to local filesystem. Choices:
|
|
The username of the PowerStore host. |
|
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. |
|
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 Protection Group
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< protect_group_name >"
lun_group_id: "< lun_group_id >"
description : "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Protection Group By ID
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ protect_group_info.protection_group_detail.id }}"
new_name: "< protect_group_new_name >"
description : "< description >"
state: "present"
- name: Modify Protection Group By Name
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< protect_group_name >"
new_name: "< protect_group_new_name >"
description : "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Query Multi Protection Group
register: all_protect_group
huawei.enterprise.hw_enterprise_protect_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:
- name
- id
- vstore_id
- vstore_name
- lun_group_name
- lun_num
- snapshot_group_num
- cdp_group_num
- clone_group_num
- name: Query Protection Group By ID
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ protect_group_info.protection_group_detail.id }}"
state: "present"
filter:
- name
- id
- vstore_id
- vstore_name
- lun_group_name
- lun_num
- snapshot_group_num
- cdp_group_num
- clone_group_num
- name: Query Protection Group By Name
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< protect_group_name >"
vstore_id: "< vstore_id >"
state: "present"
filter:
- name
- id
- vstore_id
- vstore_name
- lun_group_name
- lun_num
- snapshot_group_num
- cdp_group_num
- clone_group_num
- name: Delete Protection Group By ID
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ protect_group_info.protection_group_detail.id }}"
state: "absent"
- name: Delete Protection Group By Name
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< protect_group_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Add Lun To Protection Group
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_group:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ protect_group_info.protection_group_detail.id }}"
operation: "add_lun"
obj_type: "lun"
lun_id: "< lun_id >"
state: "present"
- name: Remove Lun From Protection Group
register: protect_group_info
huawei.enterprise.hw_enterprise_protect_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_lun"
id: "{{ protect_group_info.protection_group_detail.id }}"
obj_type: "lun"
lun_id: "< lun_id >"
state: "present"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the Protect group. Returned: When Protect group exists Sample: |
|
Number of HyperCDP consistency groups. Returned: success |
|
Number of clone consistency groups. Returned: success |
|
The system generated ID given to the Protect Group. Returned: success |
|
LUN group name. Returned: success |
|
Number of LUNs. Returned: success |
|
Name of the Protect Group. Returned: success |
|
Number of snapshot consistency groups. Returned: success |
|
id of storage vstore Returned: success |
|
name of storage vstore Returned: success |
|
task execute remark Returned: always Sample: |