dellemc.powerflex.volume module – Manage volumes on Dell PowerFlex
Note
This module is part of the dellemc.powerflex collection (version 2.6.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 dellemc.powerflex
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: dellemc.powerflex.volume
.
New in dellemc.powerflex 1.0.0
Synopsis
Managing volumes on PowerFlex storage system includes creating, getting details, modifying attributes and deleting volume.
It also includes adding/removing snapshot policy, mapping/unmapping volume to/from SDC and listing associated snapshots.
Requirements
The below requirements are needed on the host that executes this module.
A Dell PowerFlex storage system version 3.6 or later.
PyPowerFlex 1.14.0.
Parameters
Parameter |
Comments |
---|---|
Specifies whether to allow or not allow multiple mappings. If the volume is mapped to one SDC then for every new mapping allow_multiple_mappings has to be passed as true. Choices:
|
|
Whether to remove or detach the snapshot policy. To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. If the snapshot policy name/id is passed empty then auto_snap_remove_type is defaulted to Choices:
|
|
The unit of the volume size. It defaults to ‘GB’. Choices:
|
|
Type of the compression method. Choices:
|
|
If If It can be specified only when the state is It defaults to Choices:
|
|
IP or FQDN of the PowerFlex host. |
|
The password of the PowerFlex host. |
|
Port number through which communication happens with PowerFlex host. Default: |
|
The ID of the protection domain. During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it. Mutually exclusive with protection_domain_name. |
|
The name of the protection domain. During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it. Mutually exclusive with protection_domain_id. |
|
Specifies SDC parameters. |
|
Define the access mode for all mappings of the volume. Choices:
|
|
Limit of volume network bandwidth. Need to mention in multiple of 1024 Kbps. To set no limit, 0 is to be passed. |
|
Limit of volume IOPS. Minimum IOPS limit is 11 and specify 0 for unlimited iops. |
|
ID of the SDC. Specify either sdc_name, sdc_id or sdc_ip. Mutually exclusive with sdc_name and sdc_ip. |
|
IP of the SDC. Specify either sdc_name, sdc_id or sdc_ip. Mutually exclusive with sdc_id and sdc_ip. |
|
Name of the SDC. Specify either sdc_name, sdc_id or sdc_ip. Mutually exclusive with sdc_id and sdc_ip. |
|
Mapping state of the SDC. Choices:
|
|
The size of the volume. Size of the volume will be assigned as higher multiple of 8 GB. |
|
ID of the snapshot policy. To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. |
|
Name of the snapshot policy. To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. |
|
State of the volume. Choices:
|
|
The ID of the storage pool. Either name or the id of the storage pool is required for creating a volume. Mutually exclusive with storage_pool_name. |
|
The name of the storage pool. Either name or the id of the storage pool is required for creating a volume. During creation, if storage pool name is provided then either protection domain name or id must be mentioned along with it. Mutually exclusive with storage_pool_id. |
|
Time after which connection will get terminated. It is to be mentioned in seconds. Default: |
|
Whether to use RM Cache or not. Choices:
|
|
The username of the PowerFlex host. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
|
The ID of the volume. Except create operation, all other operations can be performed using vol_id. Mutually exclusive with vol_name. |
|
The name of the volume. Mandatory for create operation. It is unique across the PowerFlex array. Mutually exclusive with vol_id. |
|
New name of the volume. Used to rename the volume. |
|
Type of volume provisioning. Choices:
|
Notes
Note
The check_mode is not supported.
The modules present in the collection named as ‘dellemc.powerflex’ are built to support the Dell PowerFlex storage platform.
Examples
- name: Create a volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
storage_pool_name: "pool_1"
protection_domain_name: "pd_1"
vol_type: "THICK_PROVISIONED"
compression_type: "NORMAL"
use_rmcache: true
size: 16
state: "present"
- name: Map a SDC to volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
allow_multiple_mappings: true
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
access_mode: "READ_WRITE"
sdc_state: "mapped"
state: "present"
- name: Unmap a SDC to volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
sdc_state: "unmapped"
state: "present"
- name: Map multiple SDCs to a volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
protection_domain_name: "pd_1"
sdc:
- sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764"
access_mode: "READ_WRITE"
bandwidth_limit: 2048
iops_limit: 20
- sdc_ip: "198.10.xxx.xxx"
access_mode: "READ_ONLY"
allow_multiple_mappings: true
sdc_state: "mapped"
state: "present"
- name: Get the details of the volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_id: "fe6c8b7100000005"
state: "present"
- name: Modify the details of the Volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
storage_pool_name: "pool_1"
new_vol_name: "new_sample_volume"
size: 64
state: "present"
- name: Delete the Volume
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
delete_snapshots: false
state: "absent"
- name: Delete the Volume and all its dependent snapshots
dellemc.powerflex.volume:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: "{{validate_certs}}"
port: "{{port}}"
vol_name: "sample_volume"
delete_snapshots: true
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the volume. Returned: When volume exists Sample: |
|
The ID of the volume. Returned: success |
|
The details of the mapped SDC. Returned: success |
|
Mapping access mode for the specified volume. Returned: success |
|
Bandwidth limit for the SDC. Returned: success |
|
IOPS limit for the SDC. Returned: success |
|
ID of the SDC. Returned: success |
|
IP of the SDC. Returned: success |
|
Name of the SDC. Returned: success |
|
Name of the volume. Returned: success |
|
ID of the protection domain in which volume resides. Returned: success |
|
Name of the protection domain in which volume resides. Returned: success |
|
Size of the volume in Gb. Returned: success |
|
Size of the volume in Kb. Returned: success |
|
ID of the snapshot policy associated with volume. Returned: success |
|
Name of the snapshot policy associated with volume. Returned: success |
|
List of snapshots associated with the volume. Returned: success |
|
Statistics details of the storage pool. Returned: success |
|
Number of child volumes. Returned: success |
|
Number of mapped Sdcs of the volume. Returned: success |
|
ID of the storage pool in which volume resides. Returned: success |
|
Name of the storage pool in which volume resides. Returned: success |