hitachivantara.vspone_block.vsp.hv_resource_group_lock module – Allows the locking and unlocking of resource groups on Hitachi VSP storage systems.

Note

This module is part of the hitachivantara.vspone_block collection (version 3.4.0).

You might already have this collection installed if you are using the ansible package. 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 hitachivantara.vspone_block. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: hitachivantara.vspone_block.vsp.hv_resource_group_lock.

New in hitachivantara.vspone_block 3.2.0

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.8

Parameters

Parameter

Comments

connection_info

dictionary / required

Information required to establish a connection to the storage system.

address

string / required

IP address or hostname of the storage system.

api_token

string

This token is required while working on locked resources. Provide the lock_token value returned by lock resource group task for primary storage system.

connection_type

string

Type of connection to the storage system.

Choices:

  • "direct" ← (default)

password

string

Password for authentication. This is a required field.

username

string

Username for authentication. This is a required field.

secondary_connection_info

dictionary

Information required to establish a connection to the remote storage system.

address

string / required

IP address or hostname of the storage system.

api_token

string

This token is required while working on locked resources. Provide the lock_token value returned by lock resource group task for secondary storage system.

password

string

Password for authentication. Required if api_token is not provided.

username

string

Username for authentication. Required if api_token is not provided.

spec

dictionary

Specification for the resource group lock.

lock_timeout_sec

integer

The time that elapses before a lock timeout (in seconds). Specify a value from 0 to 7200. Default is 0.

state

string

Set state to present for locking resource group.

Set state to absent for unlocking resource group.

Choices:

  • "present" ← (default)

  • "absent"

storage_system_info

dictionary

Information about the storage system. This field is an optional field.

serial

string

The serial number of the storage system.

Attributes

Attribute

Support

Description

check_mode

Support: none

Determines if the module should run in check mode.

Examples

- name: Resource management with Resource Group Lock where single storage system is involved
  tasks:
    - name: Lock resource groups
      hitachivantara.vspone_block.vsp.hv_resource_group_lock:
        connection_info:
          address: storage1.company.com
          username: "admin"
          password: "secret"
        spec:
          lock_timeout_sec: 300
      register: response

    - name: Debug lock resource group result
      ansible.builtin.debug:
        var: response

    - name: Create ldev
      hitachivantara.vspone_block.vsp.hv_ldevs:
        connection_info:
          address: storage1.company.com
          api_token: lock_token_value
        spec:
          pool_id: 0
          size: 2GB
          name: RD_LOCK_TEST_120424
      register: create_ldev_result

    - name: Debug lock resource group result
      ansible.builtin.debug:
        var: create_ldev_result

    - name: Unlock the Resource Groups that were locked
      hitachivantara.vspone_block.vsp.hv_resource_group_lock:
        connection_info:
          address: storage1.company.com
          api_token: lock_token_value
        state: absent
      register: result

    - name: Debug lock resource group result
      ansible.builtin.debug:
        var: result

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

response

list / elements=dictionary

First lock resource groups output, then ldev creation output and finally unlock resource group output. Ansible sorts the output, so the outputs were jumbled with three tasks. Ignore the underscores (_) in the beginning of the variables, they are added to keep the output in order with the tasks. For first task three (___), for the second task two (__), and for the third task one (_) underscores are added in the beginning.

Returned: always

Sample: {"___lock_session_id": 26945, "___lock_token": "62316257-5362-458a-8a9a-8922beaf7460", "___locked_resource_groups": [{"id": 0, "name": "meta_resource"}, {"id": 1, "name": "test-rg-1"}, {"id": 2, "name": "test-rg-2"}, {"id": 3, "name": "test-rg-3"}], "__canonical_name": "naa.60060e80089c4e0000509c4e00000024", "__dedup_compression_progress": -1, "__dedup_compression_status": "DISABLED", "__deduplication_compression_mode": "disabled", "__emulation_type": "OPEN-V-CVS", "__hostgroups": [], "__is_alua": false, "__is_command_device": false, "__is_data_reduction_share_enabled": false, "__is_device_group_definition_enabled": false, "__is_encryption_enabled": false, "__is_security_enabled": false, "__is_user_authentication_enabled": false, "__is_write_protected": false, "__is_write_protected_by_key": false, "__iscsi_targets": [], "__ldev_id": 36, "__logical_unit_id_hex_format": "00:00:24", "__name": "RD_LOCK_TEST_120424", "__num_of_ports": -1, "__nvm_subsystems": [], "__parity_group_id": "", "__path_count": -1, "__pool_id": 0, "__provision_type": "CVSHDP", "__qos_settings": {}, "__resource_group_id": 0, "__snapshots": [], "__status": "NML", "__storage_serial_number": "40014", "__tiering_policy": {}, "__total_capacity": "2.00GB", "__used_capacity": "0.00B", "__virtual_ldev_id": -1, "_changed": true, "_comment": "Resource Groups unlocked successfully.", "_failed": false}

Authors

  • Hitachi Vantara LTD (@hitachi-vantara)