vRSLCM is such a great tool that it lifts all the complexity of deploying vRealize suite in just few clicks. Whether you are looking for standalone deployment or a distributed one, you are shielded from all the complexity that goes behind in setting up an environment.
Recently while working on my new project, I was tasked to find out a way where all the UI operations related to vRSLCM can be automated. In my last post I listed all the API’s that are needed to perform end to end vRSLCM configuration. We need to fetch few details before starting install/upgrade of any vRealize product.
This post is extension to my last post and I will be demonstrating how to deploy/upgrade various vRealize products using vRSLCM API. The first in this list will be vROPs. So lets get started.
At this point, I assume you have already fetched details about:
- Certificate Name/UUID (From Locker)
- Default Password Name/UUID (From Locker)
- License Name/UUID (From Locker)
- Infra details (DNS, NTP, Datacenter name, cluster name etc)
- Local Repo configured and all product install/upgrade binaries uploaded there.
Install/Upgrade are done via POST call which accepts a json payload which contains all those parameters which you pass in UI.
vROPs Deployment Procedure
Step 1: Pre-Validate Environment Creation: Before kicking environment creation task, we have to validate that the json payload which will be used for creating environment is OK and all pre-requisites (mentioned above) are in place.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
Method: POST URL: https://<vrslcm-fqdn>/lcm/lcops/api/environments/import/prevalidate Payload: { "requestType":"VALIDATE_CREATE_ENVIRONMENT", "requestState":"SUBMITTED", "environmentRequestDTO":{ "environmentId":"vROPS-Clustered", "environmentName":"vROPS-Clustered", "infrastructure":{ "properties":{ "dataCenterName":"SDDC-MAAS", "regionName":"default", "zoneName":"default", "vCenterName":"vcenter.mgmt.vmw", "vCenterHost":"vcenter.mgmt.vmw", "vcUsername":"administrator@vsphere.local", "vcPassword":"locker:password:e1dfebff-4600-4439-afb5-851e1830a71e:VC-Password", "acceptEULA":"true", "enableTelemetry":"false", "adminEmail":"xyz@vmware.com", "defaultPassword":"locker:password:26c77689-e7a8-4f27-8c85-c9a51a77689c:Default-Password", "certificate":"locker:certificate:789724a6-07ef-4076-9f6b-0c72d35110fd:vRealize-Wildcard", "cluster":"MGMT_DC#MGMT_CLU", "storage":"vsanDatastore", "folderName":"group-v50(MGMT_VMs)", "resourcePool":"resgroup-43(MGMT-ResourcePool)", "diskMode":"thin", "network":"VM_MGMT", "masterVidmEnabled":"true", "dns":"x.x.x.x.5", "domain":"mgmt.vmw", "gateway":"x.x.x.x.1", "netmask":"255.255.255.0", "searchpath":"mgmt.vmw", "timeSyncMode":"ntp", "ntp":"x.x.x.x", "isDhcp":"false" } }, "products":[ { "id":"vrops", "version":"7.5.0", "properties":{ "certificate":"locker:certificate:789724a6-07ef-4076-9f6b-0c72d35110fd:vRealize-Wildcard", "productPassword":"locker:password:26c77689-e7a8-4f27-8c85-c9a51a77689c:Default-Password", "licenseRef":"locker:license:83436c31-0d0d-4273-85e8-0840b870f6a7:vROPS-7-ENT", "disableTls":"TLSv1", "timeSyncMode":"ntp", "ntp":"x.x.x.x", "affinityRule":true, "configureAffinitySeparateAll":"true", "deployOption":"small" }, "clusterVIP":{ "clusterVips":[ ] }, "nodes":[ { "type":"master", "properties":{ "vmName":"vROPs-Master", "hostName":"vrops01.mgmt.vmw", "ip":"x.x.x.x.121" } }, { "type":"replica", "properties":{ "vmName":"vROPs-Replica", "hostName":"vrops02.mgmt.vmw", "ip":"x.x.x.x.122" } } ] } ] } } |
Response output of above call will be a request-id. Make a note of this id as we will be using it in subsequent call.
2: Check Pre-Validation Report: Environment creation pre-validate task status can be fetched via below API. Make sure that in response output, all checks have passed.
1 2 3 |
Method: GET URL: https://<vrslcm-fqdn>/lcm/lcops/api/prevalidationreport?requestId=<request-id> |
3: Deploy vROPs: Once pre-validation is successful, environment creation can be kicked by using below API call and sample payload.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
Method: POST URL: https://<vrslcm-fqdn>/lcm/lcops/api/environments/create Payload: { "environmentId":"vROPS-Clustered", "environmentName":"vROPS-Clustered", "infrastructure":{ "properties":{ "dataCenterName":"SDDC-MAAS", "regionName":"default", "zoneName":"default", "vCenterName":"vcenter.mgmt.vmw", "vCenterHost":"vcenter.mgmt.vmw", "vcUsername":"administrator@vsphere.local", "vcPassword":"locker:password:e1dfebff-4600-4439-afb5-851e1830a71e:VC-Password", "acceptEULA":"true", "enableTelemetry":"false", "adminEmail":"xyz@vmware.com", "defaultPassword":"locker:password:26c77689-e7a8-4f27-8c85-c9a51a77689c:Default-Password", "certificate":"locker:certificate:789724a6-07ef-4076-9f6b-0c72d35110fd:vRealize-Wildcard", "cluster":"MGMT_DC#MGMT_CLU", "storage":"vsanDatastore", "folderName":"group-v50(MGMT_VMs)", "resourcePool":"resgroup-43(MGMT-ResourcePool)", "diskMode":"thin", "network":"VM_MGMT", "masterVidmEnabled":"true", "dns":"x.x.x.x", "domain":"mgmt.vmw", "gateway":"x.x.x.x", "netmask":"255.255.255.0", "searchpath":"mgmt.vmw", "timeSyncMode":"ntp", "ntp":"x.x.x.x", "isDhcp":"false" } }, "products":[ { "id":"vrops", "version":"7.5.0", "properties":{ "certificate":"locker:certificate:789724a6-07ef-4076-9f6b-0c72d35110fd:vRealize-Wildcard", "productPassword":"locker:password:26c77689-e7a8-4f27-8c85-c9a51a77689c:Default-Password", "licenseRef":"locker:license:83436c31-0d0d-4273-85e8-0840b870f6a7:vROPS-7-ENT", "disableTls":"TLSv1", "timeSyncMode":"ntp", "ntp":"x.x.x.x", "affinityRule":true, "configureAffinitySeparateAll":"true", "deployOption":"small" }, "clusterVIP":{ "clusterVips":[ ] }, "nodes":[ { "type":"master", "properties":{ "vmName":"vROPs-Master", "hostName":"vrops01.mgmt.vmw", "ip":"x.x.x.x" } }, { "type":"replica", "properties":{ "vmName":"vROPs-Replica", "hostName":"vrops02.mgmt.vmw", "ip":"x.x.x.x" } } ] } ] } |
4: Environment Creation Status Check: This task typically takes some time. If you are using some kind of automation to fire these API’s, then you can poll the below GET call until you get a “status”:”COMPLETED” (or failed if any issues are encountered later during deployment).
1 2 3 |
Method: GET URL: https://<vrslcm-fqdn>/lcm/lcops/api/environments/<environment-id> |
For a successful environment creation, you will typically see output similar to as shown below:
1 2 3 4 5 6 7 8 |
{ "vmid":"fc5cc2f3-745f-41dc-9fc8-73d05ea213c8", "transactionId":null, "environmentName":"vROPS-Clustered", "environmentId":"vROPS-Clustered", "state":null, "status":"COMPLETED" } |
vROPS Upgrade Procedure
1: Fetch Upgrade Repo URL: For upgrading any vRealize product via vRSLCM, upgrade binaries should be present in LCM repository. Every upgrade bundle has a unique url and it can be fetched by using below call:
1 2 3 |
Method: GET URL: https://<vrslcm-fqdn>/lcm/lcops/api/products/vrops/version/8.0.0/lcmrepositoryurl |
Sample Output: Make a note of the url returned in response output. We need to pass this in json payload that we will use in next call.
1 2 3 |
{ "url" : "http://<vrslcm-fqdn>/repo/productBinariesRepo/vrops/8.0.0/upgrade/vRealize_Operations_Manager-VA-8.0.0.14857694.pak" } |
2: Pre Upgrade Validation: Similar to new install of vROPs, we need to validate that if an already deployed vROPs environment can be upgraded or not.Â
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Method: POST URL: https://<vrslcm-fqdn>/lcm/lcops/api/environments/upgrade/prevalidate Payload: { "upgradeProductRequestDTO":{ "environmentId":"vROPS-Clustered", "productId":"vrops", "productVersion":"8.0.0", "repositoryType":"lcmrepository", "repositoryUrl":"http://<vrslcm-fqdn>/repo/productBinariesRepo/vrops/8.0.0/upgrade/vRealize_Operations_Manager-VA-8.0.0.14857694.pak", "preValidate":true, "snapshotIaasAfterVaUpgrade":false } } |
Sample Output: Make a note of the request id returned in response output.
1 2 3 |
{ "requestId": "b92c360e-2bc3-422b-9b3b-f3c4256a871f" } |
3: Check Pre-Validate Report: Response output of pre-validate task is a very big json file which contains details of type of checks that were performed and their status.Â
1 2 3 |
Method:GET URL: https://<vrslcm-fqdn>/lcm/request/api/prevalidationreport?requestId=b92c360e-2bc3-422b-9b3b-f3c4256a871f |
Trimmed version of response output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[ { "id":null, "checkName":"Validating data nodes are reachable.", "checkType":"ERROR", "status":"PASSED", "recommendations":null, "resultDescription":"skipping_check_not_run_on_master.description", "elementType":"CHECK", "childElements":null }, { "id":null, "checkName":"Validating free disk space on all nodes required to perform the upgrade.", "checkType":"ERROR", "status":"PASSED", "recommendations":null, "resultDescription":null, "elementType":"CHECK", "childElements":null } ] |
4: Trigger vROPS Upgrade: This task returns a request id in response which is used to track status of upgrade task.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Method: POST URL: https://<vrslcm-fqdn>/lcm/lcops/api/environments/upgrade Payload: { "requestState":"SUBMITTED", "resultData":"", "requestType":null, "upgradeProductRequestDTO":{ "environmentId":"vROPS-Clustered", "productId":"vrops", "productVersion":"8.0.0", "repositoryType":"lcmrepository", "repositoryUrl":"http://<vrslcm-fqdn>/repo/productBinariesRepo/vrops/8.0.0/upgrade/vRealize_Operations_Manager-VA-8.0.0.14857694.pak", "preValidate":false, "snapshotIaasAfterVaUpgrade":false } } |
5: Check Upgrade Status
1 2 3 |
Method: GET URL: https://<vrslcm-fqdn>/lcm/lcops/api/requests/<req-id> |
And that’s it for this post. In next post of this series i will demonstrate how to install/upgrade vRLI via vRSLCM API.
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharingÂ
This actually saved me on my LCM upgrade of VRA to 8.8.2. For some reason the proceed button in the UI was not working, so the request was never submitted.
Was able to work around it with this article and postman.
Thanks so much!