Building a vCloud Lab Part 4: vCD Database Prep

One part that I forgot to mention that is in the vCloud Installation Guide is preparing your database server for use with vCloud Director. This isn’t a difficult process if you know how to use SQL. Because I decided to go with MS SQL with my vCloud 1.5 installation instead of Oracle, this article will focus on how to prep the MS SQL database; Although the Oracle prep work isn’t much different. Before we get started I would like to mention that we need to install SQL in Mixed Mode Authentication, so make sure to check that and set an “SA” user password during install.

Allowing remote TCP/IP connections to SQL

By default SQL 2008 R2 Express (like the others I assume) do not allow remote connections via TCP/IP, therefore we need to enable that before we can connect our vCloud Director Server to the database we will create later on. The simplest way I found do do this is from this article on the WebECS Support pages. It will take you through step by step on how to enable remote connections, but remember to restart SQL at the end because the changes won’t take affect until you do.

Creating a vCloud Database

The first step is to create our vCloud database, to do that we need to open up the Microsoft SQL Management Studio and login. After logging in click the “New Query” button below the File menu. Then paste the following query into the window, note there are several things you may want to change, including the “vcloud” user password as well as the database location, otherwise just paste in everything below:


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
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
USE [vcloud]
GO
CREATE LOGIN [vcloud] WITH PASSWORD = 'vcl0ud', DEFAULT_DATABASE =[vcloud],
DEFAULT_LANGUAGE =[us_english], CHECK_POLICY=OFF
GO
CREATE USER [vcloud] for LOGIN [vcloud]
GO
USE [vcloud]
GO
sp_addrolemember [db_owner], [vcloud]
GO

After pasting that in you should have something similar to this, and once you do click the “Execute” button right above the code in the ribbon bar.


You should now have a new user account called vcloud with a password of vcl0ud, and a new database called vcloud, unless of course you changed the parameters before executing. These queries also set the new vcloud database as the default database for the vcloud user, and it assigns that user the db_owner role.

We are now ready to connect up a vCloud Director server to our database… Check out the next part of this series to find out how to do the vCD install on a RedHat OS.

Share This Post