vCloud Director Install and Setup – Database Configuration

This entry is part 1 of 5 in the series vCloud Director Install and Setup Series

Overview

In vCloud Director Install and Setup – installing vCD I run through the install and setup of a vCloud Director Host.  This procedure requires an Oracle or MSSQL DB backend.  I opted for MSSQL as I am more familiar with it.  In this post I will go through the install and setup of the DB in preparation for use with vCloud Director.

MSSQL DB Install and Setup

In this example I am using a Windows 2008 R2 VM to install MSSQL 2008 R2 Standard Edition on.  VMware say this about the proper recommended spec for a vCD DB:

A database server configured with 16GB of memory, 100GB storage, and 4 CPUs should be adequate for most vCloud Director clusters.

Install SQL with the appropriate disk partitions.  As I’m running this in a Lab I’m just installing the DB, tempdb and Logs to the D: Drive.  Obviously, if this is for a proper environment then the appropriate partitions need to be configured (and if virtualised then also on thick provisioned disks).

NOTE: For optimal setup of tempdb see http://msdn.microsoft.com/en-us/library/ms175527.aspx.

  • Create local user for SQL with a nice long random password
  • Run setup.exe from ISO, allow any pre-reqs to auto-install
  • Installation – New installation – Enter Product Key, Accept the Licence Terms and Install the “Setup Support Files”
  • Setup Role – SQL Server Feature Installation
    • Select Database Engine Services, Client tools Connectivity, Integration Services and Management Tools (Basic and Complete)
    • change directories to:
      • D:\Program Files\Microsoft SQL Server\
      • D:\Program Files (x86)\Microsoft SQL Server\
  • Instance Configuration – change “Instance root directory” to D:\Program Files\Microsoft SQL Server\
  • Server Configuration
    • Click “Use the same account for all SQL Server services” and enter the account information for the ‘sqldb’ user you created.
    • Set “SQL Server Agent” to startup type of Automatic. Ensure the “SQL Server Database Engine” is also set to Automatic.
  • Database Engine Configuration
    • On the “Account Provisioning” tab choose Mixed Mode (SQL Server authentication and Windows authentication) as according to the vCD install Docs:

Windows Authentication is not supported when using SQL Server with vCloud Director

    • Set a password for the built-in SQL Server system administrator (sa) account that is nice and random. This is the superuser account for the database.
    • Under “Specify SQL Server administrators” add any additional users that will need to maintain the SQL Server (such as yourself). This makes it easy to log in and do things. The “Add Current User” button is helpful too so click this
    • On the “Data Directories” tab just run a quick check to verify your directories are setup correctly.
  • Click through to the finish and then run all Windows updates and MSSQL Service Packs. You can grab SQL 2008 R2 SP2 from http://www.microsoft.com/en-us/download/details.aspx?id=30437.  Reboot.

DB Config

So now we need to start the Microsoft SQL Server Management Studio and log in as the ‘sa’ user.  The docs give use some scripts to use to create the DB and other stuff so lets use them.

[code lang=”sql”]
USE [master]
GO
CREATE DATABASE [vcloud] ON PRIMARY
(NAME = N’vcloud’, FILENAME = N’C:\vcloud.mdf’, SIZE = 100MB, FILEGROWTH = 10% )
LOG ON
(NAME = N’vcdb_log’, FILENAME = N’C:\vcloud.ldf’, SIZE = 1MB, FILEGROWTH = 10%)
COLLATE Latin1_General_CS_AS
GO
[/code]

So in Management Studio copy/paster the script and adjust your file paths and SIZE values accordingly and hit “Execute”.

Now set the transaction isolation level.

[code lang=”sql”]
USE [vcloud]
GO
ALTER DATABASE [vcloud] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [vcloud] SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE [vcloud] SET READ_COMMITTED_SNAPSHOT ON WITH NO_WAIT;
ALTER DATABASE [vcloud] SET MULTI_USER;
GO
[/code]

Management Studio

Now lets create the vCloud Director database user account.  Again from the docs the following script creates database user name vcloud with password vcloudpass so change accordingly.

[code lang=”sql”]
USE [vcloud]
GO
CREATE LOGIN [vcloud] WITH PASSWORD = ‘vcloudpass’, DEFAULT_DATABASE =[vcloud],
DEFAULT_LANGUAGE =[us_english], CHECK_POLICY=OFF
GO
CREATE USER [vcloud] for LOGIN [vcloud]
GO
[/code]

Management Studio:

Again the docs tell us to assign permissions of db_owner to DB user account created above.

[code lang=”sql”]
USE [vcloud]
GO
sp_addrolemember [db_owner], [vcloud]
GO
[/code]

Management Studio:

And now we are all done, you now be able to connect your vCloud Director Host to the new DB instance using the credentials used in the setup.

Series NavigationvCloud Director Install and Setup – NFS Server >>

Leave a Reply

Your email address will not be published. Required fields are marked *