Initial setup of IT systems often requires a very large amount of configuration. Creating a private cloud on ManageIQ is a very good example. While setting up infrastructure in ManageIQ is a one-time task that usually does not require automation, creating hundreds of teams, their projects, setting up quotas and rights is not a task for manual execution. Fortunately, all ManageIQ functions are available via REST API requests.
Our infrastructure already uses the vRO orchestrator (VMware Aria Automation Orchestrator), it has access to a list of IT teams and resource quotas allocated to them. Therefore, we have implemented automation of routine tasks on the vRO side. We offer a package of processes for creating ManageIQ tenants and projects, as well as assigning quotas and managing tags. This package will be gradually supplemented with new processes.
ManageIQ Integration Package
v0.6.1
Comprehensive documentation on the ManageIQ API is available on the official website: https://www.manageiq.org/docs/api.
The current version of the package includes a set of CRUD processes for managing the following ManageIQ objects:
- tenants and projects;
- resource quotas;
- tag categories;
- tags.
Request execution process
The package supports simultaneous work with several ManageIQ servers, each MIQ installation has a separate configuration element in /Library/ManageIQ/. All processes have a special input parameter configName, which defines the name of the configuration element with the ManageIQ host settings.
The main process that executes all requests to the ManageIQ API is called “Invoke a REST operation (MIQ)”. ManageIQ supports two authentication methods: basic and using tokens. Our process uses the authentication method recommended by the developer – tokens.
The “Invoke a REST operation (MIQ)” process:
- finds a configuration element by its name;
- gets the REST host and token from the configuration element;
- finds a REST:RESTOperation object on the REST host by its name;
- sends a request to the REST server;
- gets the server response and checks the status code;
- gets a new access token if the token has expired and resends the request;
- in case of an error, generates a json string with the server response.
Preparing the package for work
1. Installing the package in vRealize Orchestrator:
- download the vRO package ru.zabedu.miq.package;
- import the package into the orchestrator via the Packages tab;
- check that the processes and configuration element have been successfully imported;
2. Registering a ManageIQ REST host:
- Use the standard “Add a REST host” process to register a ManageIQ server on vRO;
- Select the authentication type: “Host’s authentication type” = “NONE”;
3. Configuration:
The package supports simultaneous work with several ManageIQ servers, make the required number of copies of the existing manageiq_test configuration element, all of them should be located in Library/ManageIQ/. For each ManageIQ configuration, you need to do:
- Select the main REST host: specify the MIQ host in the configuration element in the host variable;
- Start the REST operations registration process: “Add REST operations (MIQ)”;
- Save ManageIQ credentials: in the configuration element, in the credentials attribute, you must specify the string ‘username:password’ encoded in base64:
$ echo -n 'username:password' | base64
- Get an authentication token: run the “Update access token” process.
Download the package
Write questions and suggestions for further development of the package.