Configuring a database for vCenter Server
In case you choose not to use the bundled database option for vCenter Server deployment, there are certain requirements and steps that need to be done to set up a database.
Using Microsoft SQL Server is the most common practice, and further on in this section, we will be assuming this database is used. More information on other supported databases—IBM DB2 and Oracle—can be found in the VMware vCenter Server documentation.
Microsoft SQL Server 2008 R2 Express can be used only as a bundled option for deployments with up to five hosts and 50 virtual machines. If you choose to use Microsoft SQL Server 2005 or Microsoft SQL Server 2008, make sure the machine has a valid ODBC DSN entry.
The first step is to create a database and user. This can be accomplished from Microsoft SQL Server Management Studio using the following script from /<installation directory>/vpx/dbschema/DB_and_schema_creation_scripts_MSSQL.txt
:
use [master] go CREATE DATABASE [VCDB] ON PRIMARY (NAME = N'vcdb', FILENAME = N'C:\VCDB.mdf', SIZE = 2000KB, FILEGROWTH = 10% ) LOG ON (NAME = N'vcdb_log', FILENAME = N'C:\VCDB.ldf', SIZE = 1000KB, FILEGROWTH = 10%) COLLATE SQL_Latin1_General_CP1_CI_AS go use VCDB go sp_addlogin @loginame=[vpxuser], @passwd=N'vpxuser!0', @defdb='VCDB', @deflanguage='us_english' go ALTER LOGIN [vpxuser] WITH CHECK_POLICY = OFF go CREATE USER [vpxuser] for LOGIN [vpxuser] go use MSDB go CREATE USER [vpxuser] for LOGIN [vpxuser] go
Once the database and user have been created, the user needs to be assigned the db_owner
role for the database.
The next step is to configure the ODBC connection. As described earlier, this can be done by navigating to Control Panel | Administrative Tools | Data Sources (ODBC).
For vCenter statistics to function properly, the remote SQL server needs TCP/IP to be enabled for the database. To accomplish this, perform the following steps:
Navigate to Start | All Programs | Microsoft SQL Server | Configuration Tool and click on SQL Server Configuration Manager.
Navigate to SQL Server Network Configuration | Protocols for Instance name.
Enable the TCP/IP option.
Click on TCP/IP Properties.
In the Protocol tab, make the following entries:
Enabled:
Yes
Listen All:
Yes
Keep Alive:
30000
In the IP Addresses tab, make the following selections:
Active:
Yes
TCP Dynamic Ports:
0
Restart the SQL Server service by navigating to SQL Server Configuration Manager | SQL Server Services.
Start the SQL Server Browser service by navigating to SQL Server Configuration Manager | SQL Server Services.