Troubleshooting vCenter database connection

We are testing out the latest VMware View release, 4.5, and during an uninstall of an older release, somehow the vCenter service lost its connection to the SQL Server 2005 Express database that we are using and it would not start.

After some poking around, the vCenter log (C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\Logs\vpxd-*.log) contained these telling lines:

[2010-09-15 09:14:55.354 03728 info ‘App’] [Vpxd::ServerApp::Init:759] Calling: VpxdVdb::Init(Vdb::GetInstance(), false, false)
[2010-09-15 09:14:55.354 03728 error ‘App’] ODBC error: (IM002) – [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
[2010-09-15 09:14:55.354 03728 error ‘App’] Error getting configuration info from the database
[2010-09-15 09:14:55.354 03728 error ‘App’] [Vpxd::ServerApp::Init] Init failed: VpxdVdb::Init(Vdb::GetInstance(), false, false)
[2010-09-15 09:14:55.354 03728 error ‘App’] Failed to intialize VMware VirtualCenter. Shutting down…
[2010-09-15 09:14:55.354 03728 info ‘App’] Forcing shutdown of VMware VirtualCenter now

Poking around the VMware Knowledge Base, I found the article 1003928: Troubleshooting the database data source used by VirtualCenter Server which mentions the registry key “HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VirtualCenter\DB”.  The value for the key “1” was blank, meaning no DSN was specified. I changed the value to our System DSN “vcenter”.

Next I opened up odbcad32 to actually look at the “vcenter” System DSN but could not open it because the SQL Native Client 10.0 driver was missing! I downloaded it from the Microsoft SQL Server 2008 Feature Pack, August 2008 and installed it and then was able to open the DSN. I found that the “Server” field was simply set to “localhost” and when I tried to test the connection, it timed out. I looked at the old ViewComposer DSN and it had a server and instance specified – “VIEW45-VC\SQLEXP_VIM”. I put this in the “vcenter” DSN and then with integrated Windows authentication, I was able to change the default database to “VIM_VCDB” and test the connection and it succeeded. I saved the DSN and attempted to start the vCenter service. This time it started and stayed running and the logs looked good.

VMware KB wins again!