VMware Communities > VMTN > VMware vCenter™ > VMware vCenter™ Server > Discussions

This Question is Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
1 Replies Last post: Aug 22, 2008 7:00 AM by Allsopp
Reply

Extract CPU and Memory history

Aug 21, 2008 9:25 AM

Click to view Allsopp's profile Enthusiast Allsopp 32 posts since
Jun 8, 2007
I get constant requests from application developers to provide CPU and memory usage for their virtual servers. The graphs in Virtual Center are fine but it's a manual process to extract them. I would like to pull the past 24 hours of CPU usage and Memory usage for each VM from VC SQL database but I'm having difficulty figuring out the schema. Th only documentation I can find is for VC 2.0 and it is a little different.

I can get the static VM information (ip address, number of cpu's assigned memory etc.) but I haven't figured out the performance data yet. I want to automate this to post graphs on an internal site. The Vizioncore products are good but provide far more than I need and are a little hefty in price.

Does anyone have an example SQL script for VC 2.5 that can pull this data?
Reply Re: Extract CPU and Memory history Aug 22, 2008 7:00 AM
Click to view Allsopp's profile Enthusiast Allsopp 32 posts since
Jun 8, 2007
Questions similar to this have been posted before but I couldn't find all I needed until I tracked down these two documents. Thanks to the people who put them together.

The first is the schema from VC 2.0. It's a little different from 2.5 but not much. I used this to figure out where to get guest vm ID's, installed memory and current disk information.

http://vmprofessional.com/material/VcER_Diagram.pdf

Next is a description of database views that are installed by VC. Not being a database person I was looking through tables. The views have a much cleaner structure for pulling daily, weekly, monthly data for cpu usage etc.

http://www.vmware.com/pdf/vc_dbviews_2x.pdf

With this information and some basic SQL knowledge the data can be extracted easily.
Actions