Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
Why this presentation? To get a better overview of your vCenter Database and its data! Write your own tools to gather information from the vCenter Database. For who? Administrators, consultants, developers who want to create reporting and do analysis from the database.
Agenda
vCenter Architectuur Setup (the installation) Database Architecture SQL Some applications
vCenter Architecture
Requirements
Microsoft SQL Server 2000 Standard Microsoft SQL Server 2000 Enterprise Microsoft SQL Server 2005 Standard Microsoft SQL Server 2005 Enterprise Microsoft SQL Server 2005 Express SP2 Oracle 9i release 2 Standard* Oracle 9i release 2 Enterprise* Oracle 10g Standard Release 1 (10.1.0.3.0) Oracle 10g Enterprise Release 1 (10.1.0.3.0) Oracle 10g Standard Release 2 (10.2.0.1.0)* Oracle 10g Enterprise Release 2 (10.2.0.1.0)*
*Be aware: patches needed! See p. 19 in ESX Server 3 and VirtualCenter Installation Guide
Database Maintenance
Monitoring the growth of the log file and compacting the database log file, as needed. Scheduling regular backups of the database. Backing up the database before any vCenter upgrade.
Setup
Oracle local Oracle remote SQL local SQL remote
In this example, HOST is the managed host to which the client needs to connect.
Database Details
1 relational database 88 tables
select * from information_schema.tables where table_type='BASE TABLE'
23 views
select * from information_schema.tables where table_type='VIEW'
8 stored procedures
SQL Rules
Number should not be between quotes: SELECT * FROM VPX_ENTITY WHERE (TYPE_ID = 1)
Text MUST be between quotes: SELECT NAME, VALUE FROM VPX_PARAMETER WHERE (NAME = 'log.level')
OUTER JOIN
LEFT OUTER JOIN
All values from the left table, including the non-matching records
CROSS JOIN
All values from both tables, creates matches, but also records without matches (10 rows from 1 table and 7 rows from the other will result in 70 rows). Be aware: Cartesian product.
IMPORTANT!!!
What is possible?!?
Historical overview of the amount of VMs in VI over time Total VMotions Performance graphics in a webinterface List with all VMFS partitions with free-space Properties of the objects All WWNs of HBAs Etc., etc.
But be carefull: database = completely empty (all ESX servers, VMs, settings, alarms, counters, etc. are erased!!!)
Few demos
SQL Server Profiler Total VMotions Performance stats in webinterface Free Diskspace
Links
Basis SQL Querys? http://www.w3schools.com/sql/sql_intro.asp http://en.wikipedia.org/wiki/Join_(SQL) VMware vCenter DB Application development http://www.vmguru.com/files/VCDBApps.pdf Examples http://ict-freak.nl/2008/06/12/vmware-vmotioninfo-in-excel-2007/ http://www.jume.nl
vCenter Database
Bouke Groenescheij Jum B.V. bouke@jume.nl, www.jume.nl Follow me on twitter: boukeg