SQL Connection Delay!?

Summary:
Just another standard maintenance, upgrading vCenter from 5.0 U2 to U3.  Nothing special to see here.  Oh wait, it failed?  CRAP.  Restore database, try again.  Can't build vCenter Repository?!  Crap, restore database, try again.  AGAIN!!?  Long story short, SQL Authentication specified in the ODBC connection was experiencing intermittent connection issues.  Windows integrated was much more stable.

Behavior:
Opened ODBC --> Configure ODBC connection --> Enter SQL Credentials -->  Next... wait --> Error (See below for errors) --> Click OK --> Select Next again --> successfully connects and tests successfully.  Repeat...

Hypothesis:
This problem was likely due to the firewall in-between the vCenter server and SQL server.  As to what that problem was exactly, I have no clue.

Solution/WorkAround:
Changed ODBC connection from SQL Authenticated User to Windows Integrated.  For this to work, you have to change the following:

  1. Change the following services to start as a windows service account that has dbo control over the vCenter database.
    1. VMware VirtualCenter Server
    2. VMware VirtualCenter Management Webservices
    3. VMware vSphere Profile-Driven Storage Service
  2. Change ODBC connection from SQL authenticated to Windows Integrated.
  3. Open Registry and go this path: HKLM/Software/VMware, Inc/VMware VirtualCenter/DB
    1. Blank out entries for 2 and 3 (SQL username and crypted password)
  4. Modify vcdb.properties file to enable integrated authentication. (Assuming you are using MSSQL)
    1. vcdb.properties file is normally located under C:\programdata\VMware\VMware VirtualCenter\
    • usevcdb=true
    • url=jdbc:sqlserver://YourSQLServerName\\SQLServerInstanceNameifApplicable;databaseName\=YourvCenterDB;integratedSecurity\=true
    • dbtype=mssql
    • driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
      • By not changing the vcdb.properties, you may end up w/ errors for the License Services and vCenter Storage Monitoring Service.
        • vCenter Storage Monitoring Service: Service initialization failed.
        • License Services: Unable to get license usage data
        • etc.
  5. Start vCenter services or update vCenter @ this point.
Errors:

sqlstate 08001 Server Error 0

Microsoft SQL Server Native Client Version 10.50.1600

Running connectivity tests...

Attempting connection
[Microsoft][SQL Server Native Client 10.0]Unable to complete login process due to delay in opening server connection

TESTS FAILED!


No comments: