A request that I continue to receive from customers on a fairly regular basis is a way to extract the virtual machine application services and dependencies that is provided by vSphere Infrastructure Navigator (VIN) solution. Below is an example of what a VIN discovery might look like and in this case, it is actually mapping out the application and dependencies of itself.
Today, there is not a public API for VIN and although I have published several methods here, here and here on how to extract the information from VIN, the experience is still not very user friendly or easy to do.
Last week, while talking to a fellow colleague who works in our VMware Validated Design team, I found out that VIN actually has a vRealize Operations Manager (vROps) Management Pack and could potentially be useful in helping us retrieve the information generated by VIN.
Not having spent much time with vROps Management Packs, I understood at a high level they provided custom dashboards for vROps, but I was not sure if the data provided by the management packs could also be retrieved programmatically? It has also been some time since I have looked at the vROps REST API and specifically the "public" REST API which allows customers to retrieve the metrics collected from within vROps.
As of writing this, there is currently not a compatible version of VIN for vSphere 6.5, so I decided to quickly spin up a vSphere 6.0 Update 2 environment and I deployed vROps 6.4, VIN 5.8.7 and VIN's MP to take a closer look at what we might be able to retrieve. After a few minutes of looking around the vROps REST API, which is actually quite simple to use, I found what I was looking for 🙂
It turns out that if you have the VIN MP deployed, the information collected by VIN is also available for retrieval using the vROps REST API. Using your favorite REST Client (which could even just be cURL), you simply perform a "GET" on /resources (e.g. https://vrops.primp-industries.com/suite-api/api/resources) to find VM you would like to inspect. Once you have identified the VM, you simply perform another "GET" on /resources/[RESOURCE-ID]/properties (e.g. https://vrops.primp-industries.com/suite-api/api/resources/8cbd7e86-53bf-40b3-b24d-d9944f343157/properties) to retrieve all the properties for that given VM or resource.
As you can see from the screenshot below, all the properties shown in the UI for VIN MP is also available using the vROps REST API.
As you can imagine, this is pretty awesome and not only is this officially supported, the process to retrieve the VIN information is also very straight forward. Now, the vROps REST API is great for those wanting a more programmatic approach, but it is not the only way you can retrieve the VIN information. Customers familiar with PowerCLI can leverage the vROps cmdlets to easily retrieve this exact same information using a few lines of PowerCLI code.
To do so, you first need to connect using the Connect-OMServer cmdlet and use either your vROps credentials or your vCenter Server credentials if you have that connected.
Next, we need to identify our vROps resource and in this case, it is the name of the VM. In my example, it is vin587-1 and to retrieve the resource, we just use the Get-OMResource cmdlet as shown in the example below:
$resource = Get-OMResource -Name vin587-1
Once we have our vROps resource object, similarly to the vROps REST API, we need to retrieve the properties on that resource which can do by calling into the ExtensionData and using the GetResourceProperties() method:
$resourceProperties = ($resource.ExtensionData.GetResourceProperties()).Property
The result from the above snippet will return an array of all the key/value pairs for all the properties defined for a given vROps resource.
You can obviously filter the results further, in this example, if we just want the "relation" and "RunsOnAppliationComponents" keys, we can do something like the following:
foreach ($rp in $resourceProperties) { if($rp.name -eq "RunsOnApplicationComponents" -or $rp.name -like "relation|*") { $rp } }
Although not everything that is currently available in VIN is in the VIN MP, for example, the application dependency diagrams which can be exported out using VIN. I have heard the teams are working to further enhance the integration between vROps and VIN where it will be much more seamless in the future.
Hi William,
Firstly excellent article as are the others of yours I've read. I am having an issue maybe you can shed some light on here with this one...
I can perform either operation... the GET or the PowerCLI Get-OMResource function and get a list of all the properties associated with a particular VM but I'm not getting a "relation" property via either method while in the VSphere GUI I can see that the host has dependancies... and I've tried hosts with both ingoing and outgoing dependencies. Do you know why I might not be getting this property under the circumstance?
Thanks!
ian
Thank you very much for this article. It was very helpful.