vRealize Automation is VMware’s solution for automating IT processes, such as virtual machine and application deployment. Together with vRealize Orchestrator, the tooling allows you to integrate with all different kind of systems. The question I want to answer in this article, what are your options to automate vRealize Automation itself? Let’s have a look at some of the available options.
VMware Cloud Client
Let’s start with an option provided by VMware: the Cloud Client. The Cloud Client is command-line tool which allows you to interact with vRealize Automation, Orchestrator as well as Site Recovery Manager. It’s provides you verb based access to most of the vRA/vRO features, and offers support for auto login, import/export of blueprints (infrastructure as code), tabular formatting and more. The Cloud Client is available for free, and you can integrate Cloud Client commands into a powershell script for example.
The Cloud Client is also a the option if you want to export/import vRA blueprints into the YAML format. You can browse developercenter.vmware.com and import available templates using the Cloud Client.
VMware vRealize Automation REST API
vRealize Automation also has a RESTful API for automating the application. This API provides your with (low level) access to broad set of vRA services and functions. You can perform vRealize Automation functions programmatically by using REST API service calls. To make REST calls you can use curl, or a tool like Postman that will me life a little bit easier. There’s an vRA 7 API set available on git, that you can import in Postman (however, it seems that unfortunately not all API calls are part of this set). You can import the API set directly into Postman using https://raw.githubusercontent.com/grantorchard/postman-collections/master/VMware%20vRealize%20Automation%207%20-%20Complete.json.postman_collection.
To learn more about the vRA REST API I would suggest to read the vRealize Automation Programming Guide.
Power vRA – vRealize Automation PowerShell module
This is a really nice initiative by Jonathan Medd and Craig Gumbley who are working on a PowerShell module for vRealize Automation. Power vRA, as it’s called, is community supported vRA powershell module and available on Github and the PowerShell Gallery.
With PowerShell v5 you can just do a simple
For PowerShell v4 the following one-liner is provided:
(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/jakkulabs/PowervRA/master/Get-PowervRA.ps1") | iex
Since Power vRA 1.2.2 (currently the latest version), vRA 6.2.4, 7.0 and 7.1 are supported. The module includes a long list of cmdlist which allows you to complete a lot of different tasks. Check Jonathan’s blog for some Power vRA examples.
Integrate vRA with Jenkins
Another options that can be used to automate vRA, is to integrate vRA with Jenkins. Jenkins is a open source continuous integration tool written in Java. It is used to build and test software projects continuously and integrates with for example Git, Apache Ant & Maven and AccuRev. And…thanks to Kris Thieler and Paul Gifford a Jenkins vRealize Automation plugin is available.
With this plugin vRealize Automation can be configured as part of a build environment, build step and post build action. A (vRA) build environment can be created before the actual build starts. Build steps define the steps Jenkins has to take as part of build process. With the plugin you can automatically deploy an exisiting blueprint or create a new (updated) blueprint in your catalog based on a YAML definition. You can also deploy a vRA blueprint as part of a post-build step, this steps are taken after the build has completed.
Hope this was helpful!