hitachivantara.vspone_block.vsp.hv_resource_group module – Manages resource groups on VSP block storage systems.
Note
This module is part of the hitachivantara.vspone_block collection (version 4.8.1).
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.
New in hitachivantara.vspone_block 3.2.0
Synopsis
- This module allows the creation and deletion of resource groups on VSP block storage systems.
- It also enables adding or removing various types of resources to/from the resource group.
- For examples, go to URL https://github.com/hitachi-vantara/vspone-block-ansible/blob/main/playbooks/vsp_direct/resource_group.yml
Requirements
The below requirements are needed on the host that executes this module.
- python >= 3.9
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 |
Token used to operate on locked resources. |
|
connection_type string |
Type of connection to the storage system. Choices:
|
|
password string |
Password for authentication. This is a required field. |
|
username string |
Username for authentication. This is a required field. |
spec dictionary / required | Specification for the resource group. |
|
add_resource_time_out_in_sec integer |
Timeout for an add resource operation. The default timeout is 300 seconds. |
|
begin_ldev_id aliases: start_ldev string |
First LDEV number. If you specify this attribute, you must also specify end_ldev_id. If you specify ldevs, you cannot specify this attribute. Required for add/remove LDEVs using LDEV range by ID. |
|
end_ldev_id aliases: end_ldev string |
Last LDEV number. If you specify this attribute, you must also specify start_ldev_id. If you specify ldevs, you cannot specify this attribute. Required for add/remove LDEVs using LDEV range by ID. |
|
external_parity_groups list / elements=string |
List of external parity groups to be added or removed from the resource group. |
|
force boolean |
For delete operations, specifies if the operation should be forced. Optional for Delete a Resource Group by ID forcefully. Choices:
|
|
host_groups list / elements=dictionary |
List of host groups to be added or removed from the resource group. Required for Create, Add, or Remove operations involving host groups. |
|
begin_id integer |
First host group ID. If you specify this attribute, you must also specify end_id. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving host groups. |
|
end_id integer |
Last host group ID. If you specify this attribute, you must also specify begin_id. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving host groups. |
|
ids list / elements=integer |
List of host group IDs. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving host groups. |
|
name string |
Name of the host group. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving host groups. |
|
port_id aliases: port string / required |
Port ID associated with the host group. Required for create/add/remove operations involving host groups. |
|
id integer |
The ID of the resource group. Optional for the following tasks: - Add the following resources to an existing Resource Group by ID: LDEVs, ports, host groups, NVM subsystem IDs - Remove the following resources from an existing Resource Group by ID: LDEVs, ports, host groups, NVM subsystem IDs - Delete a Resource Group by ID - Delete a Resource Group by ID forcefully Required for the following tasks: - Add LDEVs using LDEV range to an existing Resource Group by ID - Remove LDEVs using LDEV range from an existing Resource Group by ID |
|
iscsi_targets list / elements=dictionary |
List of iSCSI targets to be added or removed from the resource group. Optional for add/remove operations by Name. |
|
begin_id integer |
First iSCSI target ID. If you specify this attribute, you must also specify end_id. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving iSCSI targets. |
|
end_id integer |
Last iSCSI target ID. If you specify this attribute, you must also specify begin_id. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving iSCSI targets. |
|
ids list / elements=integer |
List of iSCSI target IDs. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for create/add/remove operations involving iSCSI targets. |
|
name string |
Name of the iSCSI target. One of ‘name’, ‘ids’, or ‘begin_id/end_id’ must be provided for add/remove operations. |
|
port_id aliases: port string / required |
Port ID associated with the iSCSI target. Required for add/remove operations by Name. |
|
ldevs list / elements=string |
List of LDEVs to be added or removed from the resource group. Optional for the Create a Resource Group with LDEVs or with the following resources: LDEVs, parity groups, ports, host groups, NVM subsystem IDs. Also used for add/remove operations by ID or Name. |
|
name string |
The name of the resource group. Required for the following tasks: - Create a Resource Group without any resources - Create a Resource Group with virtual storage serial number of VSM - Create a Resource Group with LDEVs - Create a Resource Group with the following resources: LDEVs, parity groups, ports, host groups, NVM subsystem IDs - Create a Resource Group with storage pool IDs and parity groups - Add the following resources to an existing Resource Group by Name: LDEVs, ports, host groups, iSCSI targets - Remove the following resources from an existing Resource Group by Name: LDEVs, ports, host groups, iSCSI targets - Delete a Resource Group by Name |
|
nvm_subsystem_ids list / elements=integer |
List of NVM subsystem IDs to be added or removed from the resource group. Optional for Create or Add/Remove operations by ID. |
|
parity_group_ids aliases: parity_groups list / elements=string |
List of parity groups to be added or removed from the resource group. Optional for the Create a Resource Group with LDEVs, parity groups, ports, host groups, NVM subsystem IDs, or with storage pool IDs. |
|
port_ids aliases: ports list / elements=string |
List of ports to be added or removed from the resource group. Optional for Create or Add/Remove operations by ID or Name. |
|
state string |
- Operation to be performed on the resources in the resource group. - add_resource- To add resources to the resource group. - remove_resource - To remove resources from the resource group. Choices:
|
|
storage_pool_ids list / elements=integer |
Pool volumes to be added or removed from the resource group. Optional for Create a Resource Group with storage pool IDs and parity groups. |
|
virtual_storage_model string |
Virtual storage model name associated with the resource group. Required for the Create a Resource Group with virtual storage serial number of VSM task. Choices:
|
|
virtual_storage_serial string |
Virtual storage serial number associated with the resource group. Required for the Create a Resource Group with virtual storage serial number of VSM task. |
state string | The desired state of the resource group task. Choices:
|
storage_system_info dictionary | Information about the storage system. This field is optional. |
|
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. |
Notes
Note
- If any resource is locked in the target storage system, the operations related to resource groups cannot be performed. In such cases, unlock the resources before running resource group related operations.
- Few parameters will be deprecated in future releases. Please refer to the documentation for details and original name instead of aliases.
- Connection type
gatewaywas removed starting from version 3.4.0. Please use an earlier version if you require this connection type.
Examples
- name: Create a Resource Group with virtual storage serial number of VSM
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
spec:
name: "my_resource_group_1"
virtual_storage_serial: "69200"
virtual_storage_model: "VSP G370"
- name: Get Resource Group by name
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
spec:
name: "my_resource_group"
- name: Create a Resource Group with LDEVs, parity groups, port_ids, and host groups
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
spec:
ldevs: [1, 2, 3]
parity_groups: ["PG1", "PG2"]
port_ids: ["CL1-A", "CL1-C"]
host_groups:
- port_id: "CL1-A"
name: "my_host_group_1"
- port_id: "CL1-A"
name: "my_host_group_2"
- name: Add resources to an existing Resource Group by ID
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
spec:
state: add_resource
id: 4
ldevs: [3, 4]
host_groups:
- port: "CL1-A"
name: "my_host_group_3"
iscsi_targets:
- port: "CL1-C"
name: "my_iscsi_target_2"
- name: Remove resources from an existing Resource Group by ID
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
spec:
id: 4
state: remove_resource
ldevs: [3, 4]
host_groups:
- port: "CL1-A"
name: "my_host_group_3"
iscsi_targets:
- port: "CL1-C"
name: "my_iscsi_target_2"
- name: Delete a Resource Group by ID forcefully
hitachivantara.vspone_block.vsp.hv_resource_group:
connection_info:
address: storage1.company.com
username: "admin"
password: "secret"
state: absent
spec:
id: 4
force: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
resource_groups list / elements=dictionary | The resource group information. Returned: always |
|
host_groups list / elements=dictionary |
List of host groups in the resource group. Returned: success |
|
id integer |
The ID of the host group. Returned: success Sample: |
|
name string |
The name of the host group. Returned: success Sample: |
|
port string |
Deprecated. Use port_id instead. Returned: success Sample: |
|
port_id string |
The port ID associated with the host group. Returned: success Sample: |
|
id integer |
The ID of the resource group. Returned: success Sample: |
|
iscsi_targets list / elements=dictionary |
List of iSCSI targets in the resource group. Returned: success |
|
id integer |
The ID of the iSCSI target. Returned: success Sample: |
|
name string |
The name of the iSCSI target. Returned: success Sample: |
|
port string |
The port name associated with the iSCSI target. Returned: success Sample: |
|
ldevs list / elements=integer |
List of LDEVs in the resource group. Returned: success Sample: |
|
ldevs_hex list / elements=string |
List of LDEVs in hexadecimal format in the resource group. Returned: success Sample: |
|
lock_status string |
The lock status of the resource group. Returned: success Sample: |
|
name string |
The name of the resource group. Returned: success Sample: |
|
parity_groups list / elements=string |
List of parity groups in the resource group. Returned: success Sample: |
|
port_ids list / elements=string |
List of port IDs in the resource group. Returned: success Sample: |
|
ports list / elements=string |
Deprecated. Use port_ids instead. Returned: success Sample: |
|
virtual_storage_id integer |
The virtual storage ID associated with the resource group. Returned: success Sample: |
|
virtual_storage_serial string |
The virtual storage serial number associated with the resource group. Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/hitachivantara/vspone_block/vsp.hv_resource_group_module.html