Quick guide how to prepare databases for vSphere 5.1 deployment. Part one focus on Microsoft SQL database which is most common database platform for vSphere deployments. Before vSphere 5.1 installation or upgrade three databases have to be ready:
- VMware vSphere 5.1 Single Sign-On
- VMware vSphere vCenter server
- VMware Update Manager
vSphere 5.1 vCenter server DB
Create  VMware vSphere vCenter database and user.
- Execute below script from MSSQL management studio. Change path to DB files, user names and passwords accordingly
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
Configure MS SQL ODBC on vCenter server
- On vCenter server go to menu start –> Administrative tools –> Data sources
- From a Data sources window click on System DSN tab and ADD button, Â choose SQL server from data sources driver
- Specify ODBC name, description, MS SQL server name or IP address
- I next window select authentication modes , provide username and password
- Choose default DB
- Test connectivity
VMware vSphere Update Manager (VUM)
Create database
- Execute below SQL script in MSSQL management studio tool
go CREATE DATABASE [VUM] ON PRIMARY (NAME = N'vum', FILENAME = N'C:\DB\VUM.mdf', SIZE = 2000KB, FILEGROWTH = 10% ) LOG ON (NAME = N'vum_log', FILENAME = N'C:\DB\VUM.ldf', SIZE = 1000KB, FILEGROWTH = 10%) COLLATE SQL_Latin1_General_CP1_CI_AS go use VUM go sp_addlogin @loginame=[vumuser], @passwd=N'Adm1npw01', @defdb='VUM', @deflanguage='us_english' go ALTER LOGIN [vumuser] WITH CHECK_POLICY = OFF go CREATE USER [vumuser] for LOGIN [vumuser] go use MSDB go CREATE USER [vumuser] for LOGIN [vumuser] go
- Verify DB user rights and make sure that the database user has either a sysadmin server role or the db_owner fixed database role on the Update Manager database and the MSDB database.
- Go to SQL management studio, Log in to MSSQL server where VUM DB was created.
- Go to Security – Logins – vmuser – properties, click on server role and mark sysadmin server role
- click on user mapping – click VUM — from DB role membership click on db_owner
Create ODBC for VMware Update Manager
- start 32bit ODBC from path c:\Windows\SysWOW64\odbcad32.exe
- Add new ODBC in system DSN tab
- Scroll down and click on SQL Server
- Provide name, description and sql server IP address or name
- choose authentication type and provide DB credentials
- choose default DB and finish
- test database connectivity
VMware vSphere 5.1 Single Sign-On database
Create DB and table space RSA_INDEX and RSA_DATA
- Execute script rsaIMSLiteMssqlSetupTablespaces.sql. The script is included in the vCenter Server installer download package, at vCenter Server Installation directory\Single Sign On\DBScripts\SSOServer\schema\mssql. You can run this script prior to the installation, or during the installation, when you are prompted by the installer. make sure you provided path to database files by change a section CHANGE_ME in a scrip.
-- PROJECT IMS -- MODEL IDENTITY MANAGEMENT SERVICE -- COMPANY RSA, the Security Division of EMC -- DATABASE MSSQLUSE MASTER GO------------------------------------------------------------------------------------- -- Create database -- -- Using this script is not mandatory. The database can be created with -- SQL Management Studio, ensuring that there are two tablespaces, named RSA_DATA -- and RSA_INDEX, and that there are only alphanumeric characters in the database name. -- -- Before running this script, customize the file paths (CHANGE ME) below. -- 1. Decide on a folder to hold the database files (10 GB of space required). -- For example, it can be the DATA folder of the SQL Server, usually -- C:\Program Files\Microsoft SQL Server\MSSQL10_50.<instance name>\MSSQL\DATA -- 2. Replace all 3 occurrences of C:\CHANGE ME with the path to the folder-- The database name can also be customized, but it is forbidden to include -- reserved keywords like database or any characters other than letters, numbers, -- _, @ and #.-- Advanced users can put the different files (RSA_DATA, RSA_INDEX and LOG) -- on different storage devices to improve performance. RSA_INDEX is a small file which -- is recommended to be stored on a fast device. -- For more details, please refer to Microsoft documentation at http://technet.microsoft.com/en-us/library/ms143547.aspx ------------------------------------------------------------------------------------- CREATE DATABASE RSA ON PRIMARY( NAME='RSA_DATA', FILENAME='C:\CHANGE ME\RSA_DATA.mdf', SIZE=10MB, MAXSIZE=UNLIMITED, FILEGROWTH=10%), FILEGROUP RSA_INDEX( NAME='RSA_INDEX', FILENAME='C:\CHANGE ME\RSA_INDEX.ndf', SIZE=10MB, MAXSIZE=UNLIMITED, FILEGROWTH=10%) LOG ON( NAME='translog', FILENAME='C:\CHANGE ME\translog.ldf', SIZE=10MB, MAXSIZE=UNLIMITED, FILEGROWTH=10% ) GO-- Set recommended perform settings on the database EXEC SP_DBOPTION 'RSA', 'autoshrink', true GO EXEC SP_DBOPTION 'RSA', 'trunc. log on chkpt.', true GOCHECKPOINT GO ------------------------------------------------------------------------------------- -- To drop the database, the commands is: ------------------------------------------------------------------------------------- -- DROP DATABASE RSA
Create RSA_USER and RSA_DBA
-  To create these users, run the script rsaIMSLiteDBNameSetupUsers.sql. The script is included in the vCenter Server installer download package. \Single Sign On\DBScripts\SSOServer\schema\mssql . Make sure you changed password for both users by changing CHANGE DBA PASSWORD and CHANGE USER PASSWORD in script.
-- PROJECT IMS -- MODEL IDENTITY MANAGEMENT SERVICE -- COMPANY RSA, the Security Division of EMC -- DATABASE MSSQL ------------------------------------------------------------------------------------- -- Create users -- Change the user's passwords (CHANGE USER PASSWORD) below. -- The DBA account is used during installation and the USER account is used during -- operation. The user names below can be customised, but it is forbidden to include -- reserved keywords like table or any characters other than letters, numbers, and _ . -- Please execute the scripts as a administrator with sufficient permissions. ------------------------------------------------------------------------------------- USE MASTER GO CREATE LOGIN RSA_DBA WITH PASSWORD = '<CHANGE DBA PASSWORD>', DEFAULT_DATABASE = RSA GO CREATE LOGIN RSA_USER WITH PASSWORD = '<CHANGE USER PASSWORD>', DEFAULT_DATABASE = RSA GO USE RSA GO ALTER AUTHORIZATION ON DATABASE::RSA TO [RSA_DBA] GO CREATE USER RSA_USER FOR LOGIN [RSA_USER] GO CHECKPOINT GO
- Verify if users appeared in system
- Done, DB ready for SSO deployment.
Thanks Arthur for article. It has very good information.
I have made RSA DB with rsaIMSLiteMssqlSetupTablespaces.sql and users with the rsaIMSLiteDBNameSetupUsers.sql without getting any errors during execution but I still get the Error 29119. I have already created VCDB database using the pethod in the vmwares quide, that also requires to excecute about 20 scripts that this is not instructed in your documentation. What else should I check not receiving Error 29119? (I still do not have create VUM DB? I use the installation with the simple sign on.
Do I need to create an ODBC DSN for RSA database? Thanks a lot!
The article is very usefull for SQL Server;
Waiting for Oracle Steps for vCenter SSO Database creation
Could you comment on the compatibility of BL460c G1 with ESXi 5.1? Thanks!
Hi.. I will try this and let you know
Do you also have scripts for Maintenance tasks ?
1. Maintenance Plan Cleanup History Files
2. Maintenance Plan Backup Database vcdb and vumdb
3. Maintenance Plan Backup Transaction Log
Hi.
you wrote “vSphere 5.1 vCetner.”
it should be “vSphere 5.1 vCenter.” 🙂