WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Extracting VIN (vSphere Infrastructure Navigator) information using PowerCLI & vROps REST API

Extracting VIN (vSphere Infrastructure Navigator) information using PowerCLI & vROps REST API

02.22.2017 by William Lam // 2 Comments

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.

More from my site

  • Automate Deployment & Configuration of vRealize Operations Manager 6.0 Part 1
  • Quick Tip - Connect-OMServer throws The request was aborted: Could not create SSL/TLS secure channel.
  • Automate forwarding of vRealize Operations Manager logs to Syslog Server
  • Automating Deployment & Configuration of vRealize Operations Manager 6.0 Part 2
  • Configuring vSphere Infrastructure Navigator (VIN) To Manage An Alternate vCenter Server

Categories // Automation, PowerCLI, vRealize Suite Tags // infrastructure navigator, PowerCLI, vIN, vRealize Operations Manager, vROps

Comments

  1. *protectedIan says

    05/30/2017 at 2:16 pm

    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

    Reply
  2. *protectedKrishna says

    05/02/2024 at 1:21 am

    Thank you very much for this article. It was very helpful.

    Reply

Leave a Reply to IanCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...