dellemc.powerflex.device_v2 module – Manage Device on Dell PowerFlex
Note
This module is part of the dellemc.powerflex collection (version 3.0.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.device_v2.
New in dellemc.powerflex 3.0.0
Synopsis
- Managing device on PowerFlex storage system includes adding new device, getting details of device, modifying attributes of device, and removing device.
- Support only for Powerflex 5.0 versions and above.
Requirements
The below requirements are needed on the host that executes this module.
- A Dell PowerFlex storage system version 5.0 or later.
- PyPowerFlex 2.0.0
Parameters
Parameter | Comments |
|---|---|
capacity_limit_gb integer | Device capacity limit in GB. |
clear_error boolean | Using the flag to clear error on a device. If the error continues to exist, the device will return to an error state as soon as it is accessed. Choices:
|
current_pathname string | Full path of the device to be added. Required while adding a device. |
device_group_id string | The ID of the device group. Required while adding a device. Mutually exclusive with device_group_name. |
device_group_name string | The name of the device group. Required while adding a device. Mutually exclusive with device_group_id. |
device_id string | Device ID. Mutually exclusive with device_name. |
device_name string | Device name. Mutually exclusive with device_id. |
force boolean | Using the Force flag to add a device. Using the flag to clear device error state without checking. Use this flag with caution, because all data on the device will be destroyed. Choices:
|
hostname aliases: gateway_host string / required | IP or FQDN of the PowerFlex host. |
media_type string | Device media types. Required while adding a device. Choices:
|
new_device_name string | New name of the device. |
password string / required | The password of the PowerFlex host. |
port integer | Port number through which communication happens with PowerFlex host. Default: |
state string | State of the device. Choices:
|
storage_node_id string | The ID of the storage node. Required while adding a device. Mutually exclusive with storage_node_name. |
storage_node_name string | The name of the storage node. Required while adding a device. Mutually exclusive with storage_node_id. |
timeout integer | Time after which connection will get terminated. It is to be mentioned in seconds. Default: |
username string / required | The username of the PowerFlex host. |
validate_certs aliases: verifycert boolean | Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
Attributes
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Runs task to validate without performing action on the target machine. |
diff_mode | Support: full | Runs the task to report the changes made or to be made. |
Notes
Note
- The modules present in the collection named as ‘dellemc.powerflex’ are built to support the Dell PowerFlex storage platform.
Examples
- name: Create device
register: device1_result
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
current_pathname: "/dev/sdc"
device_group_name: "DG1"
media_type: "SSD"
storage_node_name: "Node1"
- name: Create device using name with force flag
register: device2_result
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
current_pathname: "/dev/sdd"
device_group_id: "39a898be00000000"
storage_node_id: "03b589bf00000003"
media_type: "SSD"
device_name: "node1-d2"
force: true
state: "present"
- name: Get device details using device_id
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_id: "{{ device1_result.device_details.id }}"
state: "present"
- name: Get device details using (current_pathname, storage_node_name)
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
current_pathname: "/dev/sdd"
storage_node_name: "Node1"
state: "present"
- name: Get device details using (current_pathname, storage_node_id)
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
current_pathname: "/dev/sdd"
storage_node_id: "03b589bf00000003"
state: "present"
- name: Rename device
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_id: "{{ device1_result.device_details.id }}"
new_device_name: "node1-d3"
state: "present"
- name: Clear device error
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_id: "{{ device1_result.device_details.id }}"
clear_error: true
force: true
state: "present"
- name: Clear device error with force flag
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_name: "{{ device2_result.device_details.name }}"
clear_error: true
force: true
state: "present"
- name: Modify device capacity limit
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_name: "{{ device2_result.device_details.name }}"
capacity_limit_gb: 500
state: "present"
- name: Remove device using device_id
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
device_id: "{{ device1_result.device_details.id }}"
state: "absent"
- name: Remove device using (current_pathname, storage_node_name)
dellemc.powerflex.device_v2:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
current_pathname: "/dev/sdd"
storage_node_name: "Node1"
state: "absent"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
changed boolean | Whether or not the resource has changed. Returned: always Sample: |
device_details dictionary | Details of the device. Returned: When device exists Sample: |
|
aggregatedState string |
Indicates aggregated device state. Returned: success |
|
ataSecurityActive boolean |
Indicates ATA security active state. Returned: success |
|
autoDetectMediaType string |
Auto-detection result of media type. Returned: success |
|
cacheLookAheadActive boolean |
Indicates cache look-ahead active state. Returned: success |
|
capacity integer |
Device capacity in bytes. Returned: success |
|
capacityLimitInKb integer |
Device capacity limit in KB. Returned: success |
|
deviceCurrentPathname string |
Device current path name. Returned: success |
|
deviceGroupId string |
Device group ID. Returned: success |
|
deviceOriginalPathname string |
Device original path name. Returned: success |
|
deviceState string |
Indicates device state. Returned: success |
|
deviceType string |
Indicates device type. Returned: success |
|
errorState string |
Indicates error state. Returned: success |
|
firmwareVersion string |
Device firmware version. Returned: success |
|
id string |
Device ID. Returned: success |
|
ledSetting string |
LED setting state. Returned: success |
|
logicalSectorSizeInBytes integer |
Logical sector size in bytes. Returned: success |
|
longSuccessfulIos dictionary |
Indicates long successful I/O operations. Returned: success |
|
maxCapacityInKb integer |
Maximum device capacity in KB. Returned: success |
|
mediaFailing boolean |
Indicates if media is failing. Returned: success |
|
mediaType string |
Indicates media type. Returned: success |
|
modelName string |
Device model name. Returned: success |
|
name string |
Device name. Returned: success |
|
persistentChecksumState string |
Indicates persistent checksum state. Returned: success |
|
physicalSectorSizeInBytes integer |
Physical sector size in bytes. Returned: success |
|
raidControllerSerialNumber string |
RAID controller serial number. Returned: success |
|
serialNumber string |
Device serial number. Returned: success |
|
ssdEndOfLifeState string |
Indicates SSD end of life state. Returned: success |
|
storageNodeId string |
Storage node ID. Returned: success |
|
storageProps dictionary |
Storage device properties. Returned: success |
|
temperatureState string |
Indicates temperature state. Returned: success |
|
updateConfiguration boolean |
Indicates whether configuration update is enabled. Returned: success |
|
vendorName string |
Device vendor name. Returned: success |
|
writeCacheActive boolean |
Indicates write cache active state. Returned: success |
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/dellemc/powerflex/device_v2_module.html