In this post, I will walk through the steps of installing vCD Management Pack in vROPS via API. Installation of the management pack is leveraged via vROPS CaSA API. The adapter configuration is done via regular suite-api.
What is vROps CaSA API?
CaSA stands for Cluster and Slice Administration. The CaSA API manages the internal working of vRealize Operations Manager and runs on a standalone vFabric tcServer. CaSA API can be explored directly from vROPs by typing https://<vrops-fqdn>/casa/api-guide.html
Install and Configure vCD Management Pack & Adapter
1: Upload vCD Management Pack: First we need to upload vCD MP to vROPs via POST call.
Note: I am executing all API calls via Postman. If you have never used postman to upload files to the server, then please read this post for instructions.
1 2 3 4 5 6 7 8 9 |
Method: POST URL: https://<vrops-fqdn>/casa/upgrade/cluster/pak/reserved/operation/upload?pak_handling_advice=CLOBBER&force_content_update=true Auth: Basic: vROPS-User/Password Headers: Accept: application/json Body: form-data, key:contents , value: MP file name |
Sample Output: Make a note of pak_id from response output. We need to pass pak_id in the next call for installing MP.
1 2 3 4 5 6 |
{ "filename":"MP for vCD-5.2.0-14835309.pak", "signed":true, "pak_id":"vCloud-52014835309", "is_signed":true } |
2: Install vCD Management Pack
1 2 3 4 5 6 7 8 9 |
Method: POST URL: https://<vrops-fqdn>/casa/upgrade/cluster/pak/<pak_id>/operation/install Headers: Content-Type:application/json Auth: Basic, vROPS-User/Password |
Response Output: Response output of the above call will return 2 URL’s which we can use to track the status of MP install.
1 2 3 4 5 6 7 8 9 10 |
[ { "rel":"pak_cluster_status", "href":"https://<vrops-fqdn>:443/casa/upgrade/cluster/pak/vCloud-52014835309/status" }, { "rel":"pak_current_activity", "href":"https://<vrops-fqdn>:443/casa/upgrade/cluster/pak/reserved/current_activity" } ] |
3: Check MP Installation Status
1 2 3 |
Method: GET URL: https://<vrops-fqdn>:443/casa/upgrade/cluster/pak/<pak_id>/status |
Response Output:
When MP install in progress, cluster_pak_install_status will return CANDIDATE. Once MP installation is completed, cluster_pak_install_status” returns status COMPLETED in response output.
4: Create vCD Credentials
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 |
Method: POST URL: https://<vrops-fqdn>/suite-api/api/credentials Headers: Content-Type : applicationjson Accept : applicationjson Authorization: vRealizeOpsToken {{vROPS-Token}} Payload: { "name":"vCD-Creds", "adapterKindKey":"vCloud", "credentialKindKey":"VCLOUDCRED", "fields":[ { "name":"USERNAME", "value":"administrator" }, { "name":"PASSWORD", "value":"VMware123!" }, { "name":"AMQP_PASSWORD", "value":"VMware123!" } ] } |
Sample Output: Response output of above POST call returns ID for credential in response. We need this id in next API call for configuring vCD Adapter.
1 2 3 4 5 6 |
{ "id":"067d7b5a-2741-4498-9fa4-ee3694a68ca1", "name":"vCD-Creds", "adapterKindKey":"vCloud", "credentialKindKey":"VCLOUDCRED" } |
5: Configure vCD Adapter
1 2 3 |
Method: POST URL: https://<vrops-fqdn>/suite-api/api/adapters |
Request Payload
Response Output: Make a note of adapter id from response output. Adapter uuid corresponds to field “id” in output. We need this id when we are going to kick data collection from vCD adapter.
Note: Below output is a trimmed output. The actual output is a slightly big json which we need to pass in the next API call.
1 2 3 4 5 6 7 8 9 10 |
{ "name":"vCD-Adapter", "adapterKindKey":"vCloud", "resourceKindKey":"VCloudAdapter Instance", "description":"vCD-Adapter", "collectorId":2, "credentialInstanceId":"067d7b5a-2741-4498-9fa4-ee3694a68ca1", "monitoringInterval":5, "id":"c30c4f77-955b-472a-9cc3-d2d7e91730ef" } |
6: Patch vCD Adapter: In this step we tell vROPS to start trusting certs returned by vCD.
1 2 3 4 5 6 7 8 9 |
Method: PATCH URL: https://<vrops-fqdn>/suite-api/api/adapters Payload: { full response output json from step 5 } |
7: Start vCD Data Collection
1 2 3 4 5 6 7 |
Method: PUT URL: https://<vrops-fqdn>/suite-api/api/adapters/<adapter-id>/monitoringstate/start Example: https://vrops01.mgmt.vmw/suite-api/api/adapters/c30c4f77-955b-472a-9cc3-d2d7e91730ef/monitoringstate/start |
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing 🙂