Hi, all.
I'm working on vRA testing automation through back-end rest API.
Scenario:
As a functional QE, I want a keyword to do data collection on different compute resource in vRA, so that user could use resource of different cluster directly.
I know how to send this request from vRA GUI, but our automation need to go through back-end rest API.
I failed to find any clues from vRA REST API documentations. Does anyone know how to figure it out through any API or SDK?
Thanks.
Take a look at vRealize Orchestrator and the vRA plugin. It has a Data Collection workflow which would point you in the right direction.
Grant
It seems this workflow will trigger data collection on the VMs which are under management from a cluster, but for a new added VM which hasn't been registered to vRA, it doesn't work. Do you have any idea about this? Or is there any other workaround?
Are you referring to Inventory data collection or Performance data collection metrics?
Inventroy data collection and state data collection.
Well data collection is performed against a cluster, so I'm perhaps missing what you're trying to achieve here.
Could you break it down a little?
Grant
Yes. What I'd like to do is:
1. After some changes happened on a cluster which has been managed by vRA (for example, a VM is added to the cluster manually), trigger inventory data collection on this cluster to update the inventory items.
2. After the inventory data collection request complete, check the completion status.
All this operation need to be performed through API or SDK. Do you have any idea about it?
Ok, I may still be missing something here. The addition of an unmanaged VM to vCenter has zero impact to vRA. It doesn't change the available resources on the compute resource, it won't affect any reservations, it doesn't become available to any users of vRA. What purpose does the data collection have in this scenario?
Grant
Yes, it won't be available to any users of vRA. But the vRA database will be refreshed with information of the new added VM and it can be registered to vRA through Bulk Import.
Ok, now I get it!
To the best of my knowledge the standard data collection will identify that. The data collection is still not a function that's available via the vRA API, but it can be called from the IaaS API per that orchestrator workflow. I'll test this out tomorrow (bed time here in Oz) and let you know.
Grant
Thanks a lot, Grant.
BTW could please offer me any reference about IaaS API? I wasn't able to find any document about it through my exploration. Thank you.
Cyan
Hi Cyan,
Did you get how to trigger the inventory data collection?
Regards,
Jose
Hi Grant,
I realize this is an old thread, but I'm searching for the same capability. Specifically, I want to automate this capability in vRA:
I found this API, but is seems not to be doing the job.
/container-service/api/data-collection
And now it looks like IaaS Proxy Provider Service is deprecated.
We are using vRA version 7.5.
Any suggestions are appreciated.
Thanks,
Jason Davis
Hi Cyan1ni,
The easiest way is to use the Orchestrator Workflow called "Force data collection". You can find it in Workflows > Library > vRealize Automation > Infrastructure Administration > Extensibility but this will fire all Datacollections in all clusters.
If you need to run just an Inventory data collection in a specific Compute Resource, it can be done but is a little tricky because there are some IaaS internal IDs that are difficult to find. I've done it because I manage a platform with several vCenters in more than one location.
Please let me know if this helps you.
D.
Damian,
Great job! Your advice works perfectly! Only thing I noticed is there is about a 2-3 minute delay between executing the script, and when the updated inventory can be visible inside of vRA. Not ideal but I can definitely live with it.
Now I just need to automate this via the vRO rest api, and I should be in business.
I want to mark this as the correct answer, but I don't know how. If you can suggest would be appreciated.
Thanks,
Jason Davis
jason_davis,
That delay is because the Workflow is Async. It's not too hard to create a new workflow to execute the "Force data collection" and waits until it finishes. In fact, you should wait for a previous data collection, then run the new Data Collection, and finally wait until it's done.
If you have problems with that, I can create the workflow and post it here.
D.
Hi Damian,
I was able to improve the script somewhat. I made a small modification to ensure that I am only forcing data collection on inventory.
This speeds up the process from 2.5 minutes down to about 30 seconds. It's pretty reasonable for me.
I could not figure out how to go further and make the procedure synchronous. Would that be a change to the properties (parameters) passed to upDateModelEntity? Or is there some other API I need to poll to check status on the process? The documentation is very sparse, so it's a little hard to figure out what each API does.
This is low priority for me, but if you have some idea how to improve further, I am curious to hear your thoughts.
What I did was a new workflow called "wait for data collection" that check the status every 5 seconds. Then create a new workflow called "Start Data Collection" with 3 elements:
That make sense?
D.
Damian,
Based on your feedback, I was able to find the following link which I think covers your idea
Advanced "force data collection" workflow
I am confident to take it from here. Thanks for the excellent and timely advice!
Jason