DELLEMC,  DevOps

Automating the enterprise storage PowerMax using Ansible Modules

Automating the enterprise storage PowerMax using Ansible Modules

In this blog, I am going to cover Automating the enterprise storage PowerMax using Ansible Modules.

It has become very successful the way you manage storage, my first experience with EMC storage arrays was back in 2004 where I was tasked to work on Symmetrix 8800. Now we are into the PowerMax generation with NvME thus the product came long way so do we.

As we largely look at automation and orchestration as part of delivering modern infrastructure & application services, its an important to automate storage tasks that never going to get old-fashioned. These tasks are mainly creation and provisioning of a storage.

Let us go through this blog and explore how easy it is to automate these Gold Standard storage tasks.

Overview –

I would like to make sure here by saying I am not predominantly going to focus Ansible a technology. I will brush up a bit on how Ansible is configured for YML.

I presume you have Ansible knowledge in terms of how to setup, manage and work the playbooks.

Let’s cover the DellEMC PowerMax integration and testing using Ansible in this blog.

The Ansible Modules for DellEMC PowerMax are used to automate and orchestrate the configuration, and deployment of the arrays. Ansible Module for PowerMax is capable to manage volumes, storage groups, ports, ports groups, hosts, hosts groups, masking view, snapshots. It does support show, create, delete and modify.

The Ansible operation is called as Tasks within the Ansible playbooks.

Prerequisites –

Unisphere for PowerMax 9.0
Ansible 2.6 or higher
RHEL 7.5
Python 2.7.12 or higher
Python library for Unisphere (PyU4V) 3.0.0.14 must be installed on the client OS

Setting up Ansible

Ansible by default manages machines over the SSH protocol. Once Ansible is installed, it will not add a database, and there will be no daemons to start or keep running. You only need to install it on one machine (which could easily be a laptop) and it can manage an entire fleet of remote machines from that central point. When Ansible manages remote machines, it does not leave software installed or running on them, so there’s no real question about how to upgrade Ansible when moving to a new version.

Currently, Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. Windows is not supported for the control node.

This includes Red Hat, Debian, CentOS, macOS, any of the BSDs, and so on.

To install Ansible on RHEL or CentOS run below command.

On RHEL and CentOS:
$ sudo yum install ansible

Once installation is successfully completed, verify Ansible version.

How to test basic functionality of your Ansible environment? Well, I prefer to use Inventory list. Basically it is information of hosts and groups.
The inventory file can be in one of many formats, depending on the inventory plugins you have. For this example, the format for /etc/ansible/hosts is an INI-like (one of Ansible’s defaults) and looks like this:

mail.example.com
[webservers]
foo.example.com
bar.example.com
[dbservers]
one.example.com
two.example.com
three.example.com

 

A YAML version would look like:

– name: Create Storage Group
dellemc_powermax_storagegroup:
unispherehost: “{{unispherehost}}”
universion: “{{universion}}”
verifycert: “{{verifycert}}”
user: “{{user}}”
password: “{{password}}”
serial_no: “{{serial_no}}”
sg_name: “{{sg_name}}”
service_level: “Diamond”
srp: “SRP_1”
compression: True
state: ‘present’

 

Now based on above information, I created a file called ‘dev’ and added information of hosts and groups in my testing environment e.g unisphere for PowerMax and Ansible control host. Have a look at below ‘dev’ file for your reference. I will not go into too much detail because this blog is not to teach you Ansible.

I tested the Ansible environment connectivity with my Unisphere host by running following ping command via Ansible.
Ping — Try to connect to host, verify a usable python and return pong on success.

Prepare your Ansible server to write and run Ansible playbooks. Essentially you will need to install Python library for Unisphere, its called ‘PyY4V’.

Follow below procedure to prepare your host & install the PyU4V.

I would like to use Pip to install PyU4V. Pip is not available in core repositories. To install pip we need to enable the EPEL repository.

Once the EPEL repository is enabled we can install pip and all of its dependencies with the following command:

To verify that the pip is installed correctly run the following command which will print the pip version:

Once Pip is installed successfully, proceed to install Python library for Unisphere, its called ‘PyY4V’.

Here is the basic yml file to create an empty storage group on PowerMax.

Here is how you run the YML playbook that you created above for creating an empty storage group on PowerMax. Once playbook run successfully, you should see all green and OK outputs.

After running Ansible playbook to create an empty storage group on PowerMax, you can verify storage group by access traditional Unisphere for Powermax.

 

Hope you enjoyed this post, I’d be very grateful if you’d help sharing it on Social Media. Thank you!

 

DISCLAIMER: The views expressed on this site are strictly my own and do not necessarily reflect the opinions or views of any Company. Please always check official documentation to verify technical information.

One Comment