Automating vRSLCM 8.x End to End Configuration via API

In this post we will learn how to leverage vRealize Suite Life Cycle Manager (vRSLCM) API to automated deployment & configuration. 

With release of vRSLCM 8.x, VMware introduced simple installer (similar to vCSA) for deployment of vRSLCM. Below is screenshot of how the simple installer looks like. 

As of now we don’t have any API which can be leveraged to automate appliance deployment, so we will perform this task via ovftool.

Deploying vRSLCM via ovftool

1: Changing vRSLCM Appliance Initial Password via API

Once vRSLCM appliance is deployed and boots up, default login credentials for admin user is admin/vmware and you are prompted to change password on first login. To perform the same via API, see below example:

Sample Response: If the call is successful, you will see below response

2: Login to vRSLCM: Before we can execute vRSLCM configuration API, we need to authenticate against appliance first. Please use below sample call for the same:

POST  https://<vrslcm-fqdn>/lcm/authzn/api/login

Auth: Basic: admin@local/New password

If you are using postman for executing API, then you see a cookie called JSESSIONID created. This cookie is replicated automatically to all the new tabs which you are gonna open in postman.

Login API

3: Expand vRSLCM LVM: By default all products binaries that are downloaded from myvmware portal or uploaded offline to vRSLCM appliance, sits in /data partition which is just 20 GB big. Since 20 GB is not big enough to accommodate all binaries. we need to expand this partition. This can be done via below API call:

Where vcPassword can be fetched via below API Call and grepping for vmid associated with “alias”: “defaultConfigPAssword” from response output.

GET  https://<vrslcm-fqdn>/lcm/locker/api/passwords

4: Configure System NTP Settings: Here we are configuring NTP server to be used by vRSLCM appliance.

5: Configure product NTP Settings: Here we are configuring NTP server to be used by all vRealize products that will be deployed via vRSLCM.

6: Configure Product DNS Setting: Here we are configuring DNS server to be used by all vRealize products that will be deployed via vRSLCM.

7: Configure vRSLCM Product Repo: Before we can install any vRealize product, we need to download product binaries either from myvmware portal or upload the offline installer ova’s to vRSLCM local storage (inside /data). To keep things simple I will be using offline upload method. 

For configuring offline repo, first we need to create a directory inside /data in vRSLCM appliance. Once this directory is created, we need to upload ova’s in this directory.

Set vRSLCM Repo to Local: Lets assume /data/repo is the directory which will hold all the OVA’s. Below API call will set the repo to /data/repo

Map Product Binaries: Let’s assume you have uploaded below ova’s in /data/repo

  • VMware-vRealize-Log-Insight-
  • vRealize-Operations-Manager-Appliance-

Below API call will map the uploaded ova’s to the /data/repo and then you will be able to install both vRLI and vROPS via vRSLCM.

8: Create Datacenter

9: Create Region

10: Create Zones

11: Add vCenter Server

12: Create Certificate: We need to create self-signed certificate using vRSLCM before we can create any environment. We can use same certificate for all the vRealize products that will be deployed via vRSLCM or we can create certificates for individual products as well.

In this example I have created a certificate that will be used by all the products that will be deployed later.

13: Add Licenses: We need to add product specific licenses in vRSLCM.

14: Create Global Environment: The very first environment that is created in vRSLCM is globalenvironment. vIDM is also deployed as part of global environment creation.

15: Check Environment Creation Status: First we will do a GET call to get all request and search for “requestType”: “CREATE_ENVIRONMENT” and vmName field and find associated vmid. This vmid is the request id which will be used to track status of environment creation

To track status, use below API and look for “state”: “COMPLETED”

GET https://vrslcm2.mgmt.vmw/lcm/request/api/requests/<req-id>

And that’s it for this post. In next post of this series i will demonstrate how to deploy vRealize Products via API.

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing :)