huawei.enterprise.hw_enterprise_lun_snapshot module – LUN Snapshot 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_lun_snapshot.
Synopsis
Supports the provisioning operations on a LUN snapshot such as create, modify, delete and get the details of a snapshot.
Supports query all snapshots on storage.
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 |
|---|---|
Whether active or unactive snapshot. Support set when need modify snapshot active status. Choices:
|
|
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 of the LUN snapshot. |
|
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 |
|
Snapshot unique id, Mutually exclusive with name, Priority is higher than name. when needs to be active or deactive multi snapshots, it need be set like this:”id1,id2,id3”. |
|
Snapshot unique name, Required for create operation. Mutually exclusive with id. when needs to be active or deactive multi snapshots, it need be set like this:”snap_01,snap_02,snap_03”. |
|
Snapshot new unique name, Required for modify snapshot name. |
|
LUN ID, Required for create operation. |
|
The password of the PowerStore host. |
|
Whether revert or cancel revert snapshot. Support set when need revert or cancel revert snapshot. Choices:
|
|
Snapshot revert speed It defaults to Choices:
|
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the snapshot should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Rollback target object id The default rollback object is a parent snapshot. If there is no parent snapshot, the rollback object is the source LUN. |
|
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:system_vstore if not specified. |
Notes
Note
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Create LUN Snapshot
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< lun_snapshot_name >"
parent_id: "< lun_id >"
description: "< description >"
vstore_id: "< vstore_id >"
state: "present"
- name: Modify Snapshot Running status to activated or unactivated by id
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "< id1,id2,id3 >"
active: "< true | false >"
state: "present"
- name: Modify Snapshot Running status to activated or unactivated by name
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< snapshot_01,snapshot_02,snapshot_03 >"
active: "< true | false >"
vstore_id: "< vstore_id >"
state: "present"
- name: Rename LUN Snapshot by name
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< snapshot_name >"
new_name: "< new_snapshot_name >"
vstore_id: "< vstore_id >"
state: "present"
- name: Rename LUN Snapshot by id
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_snap_info.snap_detail.id }}"
new_name: "new_snapshot_name"
state: "present"
- name: Revert snapshot
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< snapshot_name >"
id: "{{ lun_snap_info.snap_detail.id }}"
revert: "true"
target_id: "{{ target_id }}"
rollback_speed: "medium"
vstore_id: "< vstore_id >"
state: "present"
- name: Cancel Revert snapshot
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_snap_info.snap_detail.id }}"
name: "< snapshot_name >"
revert: "false"
vstore_id: "< vstore_id >"
state: "present"
- name: Query Snapshot detail by name
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< snapshot_name >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- parent_name
- running_status
- wwn
vstore_id: "< vstore_id >"
state: "present"
- name: Query Snapshot detail by id
register: lun_snap_info
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_snap_info.snap_detail.id }}"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- parent_name
- running_status
- wwn
state: "present"
- name: Query Multi Snapshot
register: all_snapshot
huawei.enterprise.hw_enterprise_lun_snapshot:
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 >"
filter:
- id
- name
- vstore_name
- vstore_id
- parent_id
- parent_name
- running_status
- wwn
state: "present"
- name: Delete Snapshot by name
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
name: "< snapshot_name >"
vstore_id: "< vstore_id >"
state: "absent"
- name: Delete Snapshot by id
huawei.enterprise.hw_enterprise_lun_snapshot:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ lun_snap_info.snap_detail.id }}"
state: "absent"
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: |
|
task execute remark Returned: always Sample: |
|
Details of the snapshot. Returned: When snapshot exists else return {} Sample: |
|
The system generated ID given to the LUN snapshot. Returned: success |
|
Name of the LUN snapshot. Returned: success |
|
id of source lun. Returned: success |
|
Name of source lun. Returned: success |
|
running status of the LUN snapshot. Returned: success |
|
id of storage vstore. Returned: success |
|
Name of storage vstore. Returned: success |
|
WWN of the LUN snapshot. Returned: success |