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 |
|---|---|
Device capacity limit in GB. |
|
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:
|
|
Full path of the device to be added. Required while adding a device. |
|
The ID of the device group. Required while adding a device. Mutually exclusive with device_group_name. |
|
The name of the device group. Required while adding a device. Mutually exclusive with device_group_id. |
|
Device ID. Mutually exclusive with device_name. |
|
Device name. Mutually exclusive with device_id. |
|
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:
|
|
IP or FQDN of the PowerFlex host. |
|
Device media types. Required while adding a device. Choices:
|
|
New name of the device. |
|
The password of the PowerFlex host. |
|
Port number through which communication happens with PowerFlex host. Default: |
|
State of the device. Choices:
|
|
The ID of the storage node. Required while adding a device. Mutually exclusive with storage_node_name. |
|
The name of the storage node. Required while adding a device. Mutually exclusive with storage_node_id. |
|
Time after which connection will get terminated. It is to be mentioned in seconds. Default: |
|
The username of the PowerFlex host. |
|
Boolean variable to specify whether or not to validate SSL certificate.
Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Runs task to validate without performing action on the target machine. |
|
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 |
|---|---|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the device. Returned: When device exists Sample: |
|
Indicates aggregated device state. Returned: success |
|
Indicates ATA security active state. Returned: success |
|
Auto-detection result of media type. Returned: success |
|
Indicates cache look-ahead active state. Returned: success |
|
Device capacity in bytes. Returned: success |
|
Device capacity limit in KB. Returned: success |
|
Device current path name. Returned: success |
|
Device group ID. Returned: success |
|
Device original path name. Returned: success |
|
Indicates device state. Returned: success |
|
Indicates device type. Returned: success |
|
Indicates error state. Returned: success |
|
Device firmware version. Returned: success |
|
Device ID. Returned: success |
|
LED setting state. Returned: success |
|
Logical sector size in bytes. Returned: success |
|
Indicates long successful I/O operations. Returned: success |
|
Maximum device capacity in KB. Returned: success |
|
Indicates if media is failing. Returned: success |
|
Indicates media type. Returned: success |
|
Device model name. Returned: success |
|
Device name. Returned: success |
|
Indicates persistent checksum state. Returned: success |
|
Physical sector size in bytes. Returned: success |
|
RAID controller serial number. Returned: success |
|
Device serial number. Returned: success |
|
Indicates SSD end of life state. Returned: success |
|
Storage node ID. Returned: success |
|
Storage device properties. Returned: success |
|
Indicates temperature state. Returned: success |
|
Indicates whether configuration update is enabled. Returned: success |
|
Device vendor name. Returned: success |
|
Indicates write cache active state. Returned: success |