Ansible is a popular configuration management software. We have released Ansible Modules for PowerMax, PowerStore, PowerScale and Unity. Ansible Modules for PowerFlex (1.0.0) is the first release for this storage system. Block provisioning operations are key focus for this release.

Ansible Modules for Dell EMC PowerFlex

The Ansible Modules for Dell EMC PowerFlex allow Data Center and IT administrators to use RedHat Ansible to automate and orchestrate the provisioning and management of Dell EMC PowerFlex storage systems.

The capabilities of the Ansible modules are managing SDCs, volumes, snapshots and storage pools; and to gather high level facts from the storage system. The options available for each are list, show, create, modify and delete. These tasks can be executed by running simple playbooks written in yaml syntax. The modules are written so that all the operations are idempotent, so making multiple identical requests has the same effect as making a single request.

The Ansible Modules for PowerFlex supports the following features:

  • Create volumes, storage pools and snapshots.
  • Modify volumes, storage pools, SDCs and snapshots.
  • Delete volumes and snapshots.
  • Get details of a volumes, snapshots, SDCs and storage pool.
  • Get entities of the PowerFlex storage device.

Ansible Modules for PowerFlex release 1.0 supports the following features:

  • The following are the features of the gatherfacts module:
    • Get the API details of a PowerFlex storage device.
    • Get the list of SDCs.
    • Get the list of SDSs.
    • Get the list of volumes.
    • Get the list of snapshots.
    • Get the list of storage pools.
    • Get list of protection domains.
    • Get list of snapshot policies.


  • The following are the features of the volume module:
    • Get the details of a volume.
    • Create a volume.
    • Modify details of a volume.
    • Delete a volume.
  • The following are the features of the snapshot module:
    • Get the details of a snapshot.
    • Create a snapshot.
    • Modify details of a snapshot.
    • Delete a snapshot.
  • The following are the features of the storage pools module:
    • Get the details of a storage pool.
    • Create a storage pool.
    • Modify details of a storage pool.
    • The following are the features of the SDCs module:
      • Get the details of the SDC.
      • Rename an SDC.

Support

Ansible modules for PowerFlex are supported by Dell EMC and are provided under the terms of the license attached to the source code. Dell EMC does not provide support for any source code modifications. For any Ansible module issues, questions or feedback, join the Dell EMC Automation community.

Supported Platforms

  • Dell EMC PowerFlex (VxFlex OS) version 3.5

Prerequisites

  • Ansible 2.9 or later
  • Python 3.5 or later
  • Red Hat Enterprise Linux 7.6, 7.7, 7.8, 8.2
  • PyPowerFlex python library for PowerFlex 1.1.0

Idempotency

The modules are written in such a way that all requests are idempotent and hence fault-tolerant. It essentially means that the result of a successfully performed request is independent of the number of times it is executed.

List of Ansible Modules for Dell EMC PowerFlex

  • Gather facts module
  • Snapshot module
  • SDC module
  • Storage pool module
  • Volume module

Installation of SDK

Install python sdk named ‘PyPowerFlex’. It can be installed using pip, based on appropriate python version.

Installing Collections

Download the tar build and execute the following command to install the collection anywhere in your system: ansible-galaxy collection install dellemc-powerflex-1.0.0.tar.gz -p <install_path>

Set the environment variable: export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:<install_path>

Using Collections

In order to use any Ansible module, ensure that the importing of proper FQCN(Fully Qualified Collection Name) must be embedded in the playbook. Below example can be referred

collections:

– dellemc.powerflex

For generating Ansible documentation for a specific module, embed the FQCN before the module name. Refer to the following example:

ansible-doc dellemc.powerflex.dellemc_powerflex_gatherfacts

Running Ansible Modules

The Ansible server must be configured with Python library for PowerFlex to run the Ansible playbooks. The Documents provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules.

SSL Certificate Validation

Copy the CA certificate to the “/etc/pki/ca-trust/source/anchors” path of the host by any external means.

Set the “REQUESTS_CA_BUNDLE” environment variable to the path of the SSL certificate using the command:

export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/source/anchors/<<Certificate_Name>>

Import the SSL certificate to host using the command:

update-ca-trust extract

If “TLS CA certificate bundle error” occurs, then follow below steps:

cd /etc/pki/tls/certs/

openssl x509 -in ca-bundle.crt -text -noout

Results

Each module returns the updated state and details of the entity, For example, if you are using the Volume module, all calls will return the updated details of the volume. Sample result is shown in each module’s documentation.

List of supported modules

Modules Operations
Volume Module Create/Modify/Delete/Get-details of Volume
SDC Module Modify/Get-details of SDC
Snapshot Module Create/Modify/Delete/Get-details of Snapshot
Storage Pool Module Create/Modify/Get-details of Storage Pool
Gather Facts List resources such as System details, SDS, SDC, Storage Pool, Protection Domain, Snapshot Policy

Ansible Stack Architecture Idempotency Idempotency is a fundamental feature of Ansible Has been handled in all modules Allows the playbook to be run multiple times Avoids the need for complex rollbacks If an entity is not present “Delete” will return success, but ‘changed=false’ If an entity (e.g. a volume) is already present “Get” will return the entity “Create” will return success, but ‘changed=false’ Python library for PowerFlex PyPowerFlex’ is the Python library for PowerFlex storage system Available for download: https://github.com/dell/python-powerflex Version required for Ansible: 1.1.0 All modules check for the library – if not present, give appropriate message
Various Module Operations

Parameter Description Category Type Default
gateway_host IP or FQDN for PowerFlex API gateway host. Mandatory str
username User name for PowerFlex API gateway host Mandatory str
password Password for PowerFlex API gateway host Mandatory str
verifycert Whether or not to verify the SSL certificate. Optional bool TRUE
port Port at which PowerFlex API is hosted. Optional int 443

lGather Facts Module Parameters

Parameter Description Category Type Default
gather_subset To specify the PowerFlex storage system entities for which information is required Valid options are – – vol – storage_pool – protection_domain – sdc – sds – snapshot_policy Optional List of str
filters List of filters to filter the output for storage entities. – Each filter is a list of filter_key, filter_operator, filter_value. Optional List of dict

Documentation and Downloads

Ansible Modules for PowerFlexv1.0 downloads and documentation are available on: Github: https://github.com/dell/ansible-powerflex
  Below, you can see a demo, showing how to create a volume

Leave a Reply