VMware {code} Community
znmeb
Contributor
Contributor

Can the VI Perl Toolkit retrieve data from the Virtual Infrastructure database?

I want to collect data with Virtual Center (Level 4), and then fetch the collected statistics from the MS SQL database that Virtual Center uses to store the statistics. Can the VI Perl Toolkit do this, or is it only capable of interacting with the hosts and guests directly in real time?

Reply
0 Kudos
6 Replies
lamw
Community Manager
Community Manager

I believe you can pull out realtime statistics from each of the ESX Hosts but if you want to pull that data out of Virtual Center, you can just look at the statistics schema tables. There's lots of useful information you can pull from the VCDB using basic SQL code if you've worked with a relational database before. You can use JAVA or standard PERL embedded with your SQL query to pull that data out and integerate it into other scripts or reports. I would recommend something like dbvisualizer to look at the schema and figure out how things are tied together, once your query works, you can then insert that into your PERL script for automation.

Reply
0 Kudos
tos2k
Expert
Expert

Accessing data directly in the VC database is not within the scope of the Management API, no.

Tos2k

Reply
0 Kudos
znmeb
Contributor
Contributor

It looks like there is a way to do it with the VI Perl Toolkit. So as far as I'm concerned, attempting to reverse-engineer the database is not a valid approach.

http://www.vmware.com/vmtn/technology/developer/webinars/vi-perl-toolkit_webcast_2006-10-11.pdf

Reply
0 Kudos
tos2k
Expert
Expert

Hehe, think you have not read the webcast/pdf. You cant!

Of course a part of the data "available" via ViPerlToolkit comes from the VC-database, but it does not give you access to the data directly or besided the "data access layer".

Tos2k

Reply
0 Kudos
lamw
Community Manager
Community Manager

I suggest getting a read-only account and pull out the statistiscs using SQL query as your option, the data has already been collected by VC per the vpx agents, so if you want to consolidate and manage the stats, just pull from your primary source. Again, the caveat is that not all the data is always up to date, I've seen this many times on location of VMs/etc, but if you're just looking at an average across your stats, that should be good enough.

Reply
0 Kudos
znmeb
Contributor
Contributor

I'm not interested in raw data or figuring out what counters mean ... I think the documented tools in the PDF are what I'm going to use.

Reply
0 Kudos