Driving PowerOne API with Ansible

The Ansible community is massive, so it is no surprise that version 2.9 came out with more than 3600 modules. This number keeps growing and it is motivating a change in how modules are distributed in the future. To read more about these changes you can read from Jeff Geerling himself

However sometimes still you will come across with either:

  • some functionality that hasn't been implemented on a module
  • or a target for which there are no modules
What do you do then? You have a few options:
  • create your own module. This can be done in Python and even if you are not a Python guru you can find many tutorials that don't look intimidating at all
  • you use the "shell" or "command" modules to run some other script
  • if your target can be managed through a REST API then you can use the "uri" module

REST API's are the basis for many automation tasks nowadays. An advantage of building automation through the API is that the workflow you build is portable to other tools (of the configuration management kind or otherwise)

This is the method I will be discussing briefly today to manage a DellEMC PowerOne. This is a converged system from DellEMC that has been designed with the concept of "autonomy" in mind. The idea is that from the controller down everything, including hypervisor, compute, network, fabric and storage, is automated and not exposed to the user, which is no different to what happens in a public cloud to be honest. What the system exposes is the upstream connectivity and it does so through a very simple high-level REST API. Here you can see the API calls for the CRG (read ESX cluster) resource in the API

In this video I use Ansible with the "uri" module interacting with the PowerOne simulator to:
  • show the list of clusters configured in the system 
  • create a new cluster (CRG) using a POST call and a "json" body
  • show the list of clusters again to verify it got created

Comments

Popular posts from this blog

Sending PowerStore alerts via SNMP

Sending PowerStore logs to Syslog

Electronic Nose - eNose