Building a Private Cloud with vCloud Director- Part-3-Configuring Database for vCloud Director


In our last 2 posts of this series we understood the components of vCloud suite and had a look on my Lab Infrastructure. Lets move ahead and start configuring vCloud director components one by one.

vCloud Director supports MSSQL and Oracle as backend database. I am using MSSQL database for my Lab and this post will be covering the steps needed to configure the database prior to vCloud Director Installation.

Setting up MSSQL database is very easy task. Vmware provides the SQL commands to configure the database on the vCloud Director Documentation page. You can access this page by clicking on vCloud Director Documentation page.

Pre-requisite: Make sure your system meet following 2 pre-requisites before using the database setup script:

1: MSSQL database installed and running

2: SQL Server Management Studio installed

The below script will be used in configuring the database. You have to make minor changes in the script to setup according to your infrastructure

USE [master]
GO
CREATE DATABASE [vcloud] ON PRIMARY
(NAME = N’vcloud’, FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL10_50.VIM_SQLEXP\MSSQL\DATA\vcloud.mdf’, SIZE = 100MB, FILEGROWTH = 10% )
LOG ON
(NAME = N’vcdb_log’, FILENAME = N’C:\Program Files\Microsoft SQL Server\MSSQL10_50.VIM_SQLEXP\MSSQL\DATA\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 = ‘svcvcloud’, 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

Note: You may need to change the path of the directory where your SQL server files are located. Mine was located in C:\ drive so I modified the path to include path up to the DATA directory. Your database file will be saved by name vcloud.mdf in DATA directory.

(“C:\Program Files\Microsoft SQL Server\MSSQL10_50.VIM_SQLEXP\MSSQL\DATA”)

Also you have to use a password for your vcloud user. In above example i am using svcvcloud as password for my setup. You have to use your own password.

Steps for Executing the script

1) Copy the above script in a notepad and do the necessary modification and save it on your desktop by name filename.sql. For simplicity I saved mine as vcloud.sql

2) Launch SQL Server Management Studio and connect to your database

3) Once the connection is successful go to File> Open > File and browse to the path to your sql file saved in step 1.

vc-db1

I have saved my vcloud.sql file on my desktop

vc-db2

By default when you copy the script from the vCloud documentation page it includes the path to save vcloud.mdf file in C:\ drive. You have to make changes to reflect it to correct path as I explained earlier.

vc-db3

I changed the path according to my setup so my script looks like below. Make sure to change the database password from default “vcloudpass” to your password.

vc-db4

Once the changes are made you are good to go. Hit the Execute button located just above from where your script starts. If the query is executed successfully it will show you the result in left hand side bottom corner.

vc-db5

Verify the presence of “vcloud” database under section “Databases” and vcloud user under section “Security” by expanding your database instance

vc-db6

You can also verify that vcloud user have been correctly mapped to the vcloud database and has been granted db_owner role by clicking on vcloud database and selecting properties and go to user mapping tab in the new window that pop up.

vc-db7

Now database setup have been setup correctly. In my next post of this series I will cover vCloud director installation on Redhat server.

About Alex Hunt

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in VMware Software India Pvt Ltd as Operations System Engineer (vCloud Air Operations). I have around 5 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in vCloud Director, Vmware and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s