For many years I have been tasked with building vRealize Automation environments, and one of the biggest pain points has been the deployment and preparation of the IaaS machines. This has usually required special preparation of a Windows template and several scripts to get everything configured so that vRA plays nice. This is usually an error-prone process, especially for the larger enterprise deployments. To tackle this problem, VMware released vRealize Suite Lifecycle Manager, which is on version 2.1, as of this writing.
I decided it was time to try this product and see if it lives up to the claims. I was also more interested in the API functionality, and as with all things automation, I typically turn to Ansible. I wasn’t too surprised to discover, that although the deployment is ‘automated’, depending on your interpretation, there is a number of manual steps that are still required. These include ensuring that the IaaS machines and database are already deployed and properly configured. The vRLCM Create Environment process also provides validation and pre-checks, along with scripts that can be used to prepare the machines.
With the preparation of these playbooks, I set out to automate the following:
- Deployment of a single VMware vIDM appliance;
- Deployment and initial configuration of a single vRealize Suite Lifecycle Manager appliance;
- Deployment of vRealize Automation IaaS Servers (Windows VMs), in multiple deployment scenarios.
- Creation of vRealize Automation environment through LCM.
This post will focus on deploying vRSLCM and vIDM with a follow-up post on the vRA deployments.
However, in my attempts to make this a set of one-click processes, I wasn’t able to quite get that far (got pretty close). This was mainly due to some limitations with the vRSLCM API (can’t automate certificates, for example). I will discuss these limitations throughout this post, and if I find workarounds, then I’ll provide an update.
I should also point out that this is quite experimental and although I have done all that I can to make these workflows as idempotent as I can, unfortunately, with the limitations of the LCM API, this has proven to be quite difficult. These playbooks are best used as a one-time-only deployment, at least for LCM itself.
Environment Preparation
In my environment, I have a dedicated virtual machine that I develop and run my playbooks on (you may call this the Ansible control machine) running on CentOS 7.x.
Environment Overview
CentOS | CentOS 7.x |
Ansible | 2.8.1 (2.8 is a minimum requirement) |
Python | 3.6 (installed from EPEL Repository) |
Prerequisites
The following pre-requisites are required:
- DNS A/PTR records created for vRSLCM and vIDM appliances.
Prepare Environment
Ensure that the system is up-to-date by running:
sudo yum -y update
Install yum-utils
sudo yum -y install yum-utils
Install Python 3
You will need to ensure that Python 3.6 is installed on your Ansible host. I am using the EPEL repository, but you may decide to use IUS or SCL to install these packages, so the package names may differ. Refer to the relevant documentation for installing Python 3 using these repositories, if required.
sudo yum -y install python36 python36-pip python36-devel
Install GIT
Git will be used to clone my Ansible vRSLCM playbooks repository.
sudo yum -y install git
Create a Python Environment
It’s always the best approach to create a python virtual environment so that packages do not conflict with the base system. I have a directory in the root of my home dir called ‘python-env‘ where I maintain several different environments. Once you have a virtual environment set up, you just need to install the required packages from the ‘requirements.txt‘ file (provided later in the git repository).
You can follow these steps below to create a virtual environment:
mkdir ~/python-env cd ~/python-dev python3.6 -m venv ansible_vrlcm source ansible_vrlcm/bin/activate
You will notice that the shell will now display the virtual environment that you are using:
It’s also a good idea to ensure the latest version of pip and setuptools is installed.
pip install --upgrade pip setuptools