vCenter install made easy

Okay so if you have recently had to install vCenter 5.0 or 5.1 you will know that it has become the most annoying thing since sliced bread.

This might make is a little easier.

Note.. this is an install for windows 2008 R2 server and Microsoft SQL 2008 R2..

Okay so you have windows installed and sql installed on the same server, that is okay this process will work for both variants. SQL installed on the same server or seperate.

1. Ensure you SQL server is setup for Windows and SQL authentication.

1a. Open SQL Server Management Studio and right click the sql server name in the left pane. Go to properties and click on the security tab. Choose the second option – SQL Server and Windows Authentication mode.

2. JDBC… for the win.. Okay if you are anything like us, we have a build vlan and then a production vlan. When SQL gets installed the server is still in the build vlan, so retains some of the ip address from the build vlan. On the sql server, start – Microsoft Sql Server Configuration Tool – SQL Server Configuration Manager. Select SQL Server Network Configuration – Protocols. Open TCP/IP properties and look for the ip4 and ensure the ip address is correct for your server. Whilst in this area ensure that on the ip addresses tab that it is set to active. Then restart the sql server service, right click on the server name in management studio and restart.

We setup our drive letters in the following way for a one server to rule them all scenario.

c:\ System

d:\Apps – all vcenter apps get installed on here

g:\Data – Sql databases’ belong here

l:\Logs – both sql and vmware logs where possible below here.

Setup of the database’s … this is where most people throw there hands in the air and run around like headless chooks.. and there is a good reason why, it can be frustrating.

1. Open SQL Server Management Studio.

New Query

Paste the following scripts in order – each script should be seperated.

SSO.sql

USE MASTER
GO

CREATE DATABASE RSA ON PRIMARY(
    NAME='RSA_DATA',
    FILENAME='G:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\RSA\RSA_DATA.mdf',
    SIZE=10MB,
    MAXSIZE=UNLIMITED,
    FILEGROWTH=10%),
FILEGROUP RSA_INDEX(
    NAME='RSA_INDEX',
    FILENAME='G:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\RSA\RSA_INDEX.ndf',
    SIZE=10MB,
    MAXSIZE=UNLIMITED,
    FILEGROWTH=10%)
LOG ON(
    NAME='translog',
    FILENAME='L:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\RSA\translog.ldf',
    SIZE=10MB,
    MAXSIZE=UNLIMITED,
    FILEGROWTH=10% )
GO

-- Set recommended performance settings on the database
ALTER DATABASE [RSA] SET AUTO_SHRINK ON
GO
ALTER DATABASE [RSA] SET RECOVERY SIMPLE
GO

CHECKPOINT
GO

USE MASTER
GO

CREATE LOGIN RSA_DBA WITH PASSWORD = 'P@ssw0rd, DEFAULT_DATABASE = RSA
GO
CREATE LOGIN RSA_USER WITH PASSWORD = 'P@ssw0rd', 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

vCenter Server Database

vcdb-1.sql

use [master] 
go 
CREATE DATABASE [VCDB] ON PRIMARY 
(NAME = N'vcdb', FILENAME = N'G:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\VCDB.mdf', SIZE = 3000KB, FILEGROWTH = 10% ) 
LOG ON 
(NAME = N'vcdb_log', FILENAME = N'L:\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\VCDB.ldf', SIZE = 1000KB, FILEGROWTH = 10%) 
COLLATE SQL_Latin1_General_CP1_CI_AS 
go
use VCDB 
go 
sp_addlogin @loginame=[vpxuser], @passwd=N'Mopipys!86', @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
--The waitfor is just to let sql catch up with the user creation before the next script is run
WAITFOR DELAY '00:00:07';
 

vcdb-2.sql

USE [VCDB]
go
CREATE SCHEMA [VMW]
go
ALTER USER [vpxuser] WITH DEFAULT_SCHEMA =[VMW]
go

if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_ADMIN_ROLE')
CREATE ROLE VC_ADMIN_ROLE;
GRANT ALTER ON SCHEMA :: [VMW] to VC_ADMIN_ROLE;
GRANT REFERENCES ON SCHEMA :: [VMW] to VC_ADMIN_ROLE;
GRANT INSERT ON SCHEMA ::  [VMW] to VC_ADMIN_ROLE;

GRANT CREATE TABLE to VC_ADMIN_ROLE;
GRANT CREATE VIEW to VC_ADMIN_ROLE;
GRANT CREATE Procedure to VC_ADMIN_ROLE;

if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_USER_ROLE')
CREATE ROLE VC_USER_ROLE
go
GRANT SELECT ON SCHEMA ::  [VMW] to VC_USER_ROLE
go
GRANT INSERT ON SCHEMA ::  [VMW] to VC_USER_ROLE
go
GRANT DELETE ON SCHEMA ::  [VMW] to VC_USER_ROLE
go
GRANT UPDATE ON SCHEMA ::  [VMW] to VC_USER_ROLE
go
GRANT EXECUTE ON SCHEMA :: [VMW] to VC_USER_ROLE
go
sp_addrolemember VC_USER_ROLE , [vpxuser]
go
sp_addrolemember VC_ADMIN_ROLE , [vpxuser]
go
use MSDB
go
if not exists (SELECT name FROM sysusers WHERE issqlrole=1 AND name = 'VC_ADMIN_ROLE')
CREATE ROLE VC_ADMIN_ROLE;
go
GRANT SELECT on msdb.dbo.syscategories to VC_ADMIN_ROLE
go
GRANT SELECT on msdb.dbo.sysjobsteps to VC_ADMIN_ROLE
go
GRANT SELECT ON msdb.dbo.sysjobs to VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_add_job TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_delete_job TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_add_jobstep TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_update_job TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_add_jobserver TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_add_jobschedule TO VC_ADMIN_ROLE
go
GRANT EXECUTE ON msdb.dbo.sp_add_category TO VC_ADMIN_ROLE
go
sp_addrolemember VC_ADMIN_ROLE , [vpxuser]
go

vcdb-2.sql

use [VCDB]
go
sp_addrolemember @rolename = 'db_owner', @membername = 'vpxuser'
go
use MSDB
go
sp_addrolemember @rolename = 'db_owner', @membername = 'vpxuser'
go

 

Now create the odbc’s… (logon as the vcenter service account that you have setup)

Start Control Panel – Administrative tools (if you don’t see it change to small icons or large icons)
System – Add – SQL Server Native Client xx – Finish
Name – VCDB
Description – vCenter Server
Server – hostname

Next

With intergrated Logon

Next

Change the database to the VCDB that the scripts above created.

Next

Finish

TEST

Ok

vCenter Updata Manager ODBC

Navigate to and run…
C:\Windows\SysWOW64\odbcad32.exe
Yeah I know it says 64 but this is the 32bit odbc

Follow the same process as the VCDB but choosing VUM as the database.

….

Now you are ready to run the autorun from the vcenter dvd – do the simple install and follow the bouncing ball changing c:\ for d:\ for location of software install.

More to follow, just short of time.

Of course the easiest way to get a good vcenter up and running is just to use the Linux version.