WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Extracting Information from VIN (vSphere Infrastructure Navigator) Part 2

11.08.2012 by William Lam // 2 Comments

In my previous article Extracting Information from VIN (vSphere Infrastructure Navigator) Part 1, we took a look at the data VIN was collecting through an interface called Jolokia. Utilizing a tool called j4psh, we were able to easily view and explore the data in VIN remotely. In this article, we will take a look at how easily you can extract the data we explored in the previous article using a very simple script.

While going through the Jolokia website and walking through the tutorial, I found there were several programmatic clients that could be used to connect to the Jolokia service which includes Java, Javascript and Perl. Since I am most familiar with Perl, I wrote a very simple Perl script called getVINData.pl leveraging the information from my previous article.

Disclaimer: This is not officially supported by VMware, use at your own risk.

Before using the script, you will need to run through the two per-requisites outlined in the previous blog article: VIN appliance setup and installation of Jmx4Perl. Once you have completed these two steps, you are now ready to execute the script (make sure the script has the executable permission set). The script is pretty straight forward it accepts two input parameter: VIN hostname/IP Address and the name of the virtual machine you wish to query.

In the example below, I am connecting to my VIN host which has an IP Address of 172.30.0.150 and I am querying a virtual machine with the name Analytics VM (one of the vC Ops VMs).

From the screenshot above we can see the following:

  • The vCenter Server that VIN is currently registered to
  • VM Summary information
  • Applications/Services currently running on the VM
  • VM Dependencies

If we take a look at the vSphere Web Client and the VIN data for this particular VM, we should see the same set information:

Though the script already contains quite a bit of information, it is just a sample of what can be done. With further exploration you can easily extend the script to extract other pieces of information and possibly even use other scripting/programming languages to connect to this interface. As I mentioned before, VIN is a very powerful tool for your vSphere infrastructure and now you can gain additional benefits by leveraging it's valuable data externally!

Categories // Uncategorized Tags // infrastructure navigator, jmx, jmx4perl, jolokia, notsupported, perl, vIN

Extracting Information from VIN (vSphere Infrastructure Navigator) Part 1

11.06.2012 by William Lam // 4 Comments

vSphere Infrastructure Navigator or VIN for short is a really useful tool that helps you map out and visualize application services and dependencies between your virtual machines. This is extremely helpful when trying to identify what applications or ports a given virtual machine is running and how it is related or dependent on other virtual machines within your virtual infrastructure.

One thing that I found lacking in VIN today is the ability to export or extract some of this useful information for external use such as a CMDB (Configuration Management Database) as one potential use case. This would allow users to always have an up-to-date CMDB that does not rely on a manual process of adding CI (Configuration Items) and services to your CMDB which can potentially lead to incorrect or more importantly, out of date information (I have seen this happen in the past as an System Admin).

While deploying the latest release of VIN 1.2 in my home lab, I decided to poke around in the VIN appliance and I noticed a web application called Jolokia (not the hot pepper) that was running. After a quick Google, I came across this Jolokia tutorial and with some trial and error, I was able to validate the steps against VIN and was able to access the data VIN was discovering about the virtual machines.

In part 1 of this article, I will show how to get setup and start exploring the data VIN is collecting and in part 2, I will provide a sample script which can be used to automate the extraction of some of this data found in VIN. In the example below, I will be leveraging the vMA appliance, you could use another system that can install the Jolokia client packages, please refer to tutorial for more details.

Disclaimer: This is not officially supported by VMware, use at your own risk.

VIN Appliance Setup:

Before we begin, we need to configure a few things on the VIN appliance which will allow us to connect remotely which is disabled by default.

Step 1 - Edit the following configuration file /opt/vadm-engine/webapps/jolokia/WEB-INF/classes/jolokia-access.xml and specify the remote IP Address you wish to connect to VIN from. By default, VIN is configured to only allow connections from localhost (127.0.0.1).

Step 2 - Run the following script called /opt/vadm-engine/bin/disable_security.sh which disables some of the security configurations such as firewalls, JMX security, etc. which is required to connect to Jolokia interface remotely.

Step 3 - Finally, for the changes to go into effect, you will need to restart the VIN discovery engine by running the following command: /etc/init.d/vadm-engine restart

Step 4 - To verify the configuration above, go ahead and login to the remote host of the IP Address that you added to the jolokia-access.xml file and perform the following curl command: curl http://[VIN_IP_ADDRESS]:8080/jolokia and you should get back a reply which confirms you can communicate with the Jolokia service on your VIN host remotely.

Note: You can also take the URL and paste that into a web browser and it should also respond with the same information. If you do use a browser, make sure you add the IP Address of the desktop that is running the browser to jolokia-access.xml file.

Installing Jmx4Perl on vMA:

 
Step 5 - To explore the data in VIN, we will be installing Jmx4Perl as noted in the Jolokia tutorial which includes an interactive utility called j4psh which will make it easier to view the information in VIN. You will need to install Jmx4Perl via CPAN or manually install the following Perl packages in this order:

  • JSON-2.53
  • Term-Clui-1.66
  • Config-General-2.51
  • Term-ShellUI-0.92
  • Module-Find-0.11
  • jmx4perl-1.06

Luckily, you do not need to manually do this as I wrote a quick shell script called setupJMX4PERL.sh which will download the packages above and install Jmx4Perl for you. All you need to do is just execute the script and then select "yes" when prompted.

Step 6 - Once Jmx4Perl has been installed, you should now have a utility called j4psh which we will use to connect to the Jolokia service running on your VIN appliance remotely from vMA. Run the following command: j4psh http://[VIN_IP_ADDRESS]:8080/jolokia 

Note: This can take awhile, in my lab environment it took up to 10 minutes before it connected. Please be patient as it could take longer, I can only assume some amount of data is being cached on the client.

Once you have successfully connected, you should now have a prompt displaying the VIN address. There are multiple namespaces or MBeans and we will be looking at the com.vmware.vadm which is the VIN application. To change into this specific Mbean, run the following command: cd com.vmware.vadm as shown in the screenshot above. Once you have switched to VIN's MBean, you can then run the ls command, similar to UNIX/Linux ls (list) command. You can also just type help for all available commands.

What you see listed above in the screenshot are the different sub-MBeans that are available in the com.vmware.vadm Mbean and we will take a look at a few of these to show you how to navigate your way around.

Exploring VIN MBeans:

Note: Please be very careful when executing operations, I would highly recommend you do this in a lab environment to ensure you do not impact your VIN system.

The first MBean we will take a look at is name=inceptionConfigurationMBean,type=ConfigurationMBean and as you might have guessed from the name it is related to some type of configuration. Go ahead and cd into that Mbean and then type ls.

We can see from this Mbean, there are a bunch of attributes that we can access. To view an attribute, we just run the cat command and the name of the attribute. In this example, I am checking the value of vc.credentials.host which should contain the address of the vCenter Server that the VIN Server is currently registered with. Before proceeding to the next Mbean, you will need to cd back out to main MBean, to do so, just type cd .. as you would on a UNIX/Linux machine to change to previous directory.

The next Mean we will take a look at is name=vcInventory,type=VcConnector and as you might have guess this is dealing with the vCenter inventory. Go ahead and cd to this Mbean and type ls.

For this Mbean, when we perform the list command, we are only shown operations or methods for this Mbean. The operations shown on the left will display the required parameters and we can see they all require a string input except for the getAllVms() so let's go ahead and execute that and see what happens (of course we can probably guess, a list of all VMs will be displayed). To execute an operation, you will need to run the exec command, go ahead and run the following command: exec getAllVms as shown in the screenshot above. As you can see from the screenshot, we are listing all VMs that have been discovered by VIN including a nice summary of each virtual machine.

Let's go ahead and run through two additional operations that accept parameters such as getVmByName and getVmByIp. You will use the exec command but now you will need specify an additional parameter based on the operation. The screenshot below demonstrates calling both of these operations and specifying the appropriate input parameter:

The next two operations will be located in the same Mbean which deals with the application services found on each VM as well as any external VM dependencies. The first operation is name=ApplicationService,type=ApplicationService and we will be looking specifically at the findApplicationComponentsByInfrastructureElemenBusinessKeys operation which accepts the MoRef Id of the VM in question which must be in JSON format (this took me awhile to figure out). From the previous operations above, you will need a MoRef Id of a VM you are interested in seeing what application services are running and run the following command: exec findInfrastructureElementsByBusinessKeys '[{"moid":"vm-232"}]' and be sure to replace the MoRef Id with your own.

As you can see from the output, it contains quite a bit of information including the three services this VM is running and one of these services is vCenter Operations. If you hop over to the vSphere Web Client and find this VM, you should see the same set of services listed.

The second operation that we will take a look at is called findOutgoingDependentInfrastructureElements and it also accepts MoRef Id as input and noticed the help option shows it requiring a single entry as well as an array entry of the MoRef Id, again in JSON format. To view the dependency of this VM to other VMs in your virtual infrastructure, run the following command:  exec findOutgoingDependentInfrastructureElements '{"moid":"vm-385"}' '[{"moid":"vm-385"}]' and be sure to replace the MoRef Id with your own.

From the output, you can see the VM's that are depended on by this VM as well as other information.

I have not explored all the Mbeans and operations, but I highly encourage you to browse around and see what you can find. Just be careful when executing operations that you are performing READ operations and not WRITE operations as you can impact your VIN system. In part 2 of this article, I will show you how to easily export some of this useful information found in VIN using a simple script.

Categories // Automation Tags // infrastructure navigator, jmx, jmx4perl, jolokia, notsupported, vIN

What's New in VMware Vsish for ESXi 5.1

10.19.2012 by William Lam // Leave a Comment

While going through and cleaning up my ghettoSkunkworks projects folder before going on PTO, I came across this little post which I must have forgotten to publish. With the latest release of ESXi 5.1, there are now a total of 162 new vsish configuration parameters, with 63 of those being hidden parameters.
***As usual with any hidden configurations, please be careful and use at your own risk as the vsish interface is not officially supported by VMware***
Here is the complete list of new vsish configurations in ESXi 5.1 - https://s3.amazonaws.com/virtuallyghetto-download/complete_vsish_config_510.html
 Additional Resources:
  • What Is VMware Vsish
  • What's New in VMware Vsish for ESXi 5

Categories // Uncategorized Tags // ESXi 5.1, notsupported, vsish, vSphere 5.1

  • « Previous Page
  • 1
  • …
  • 469
  • 470
  • 471
  • 472
  • 473
  • …
  • 560
  • Next Page »

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