Building a Private Cloud with vCloud Director-Configuring Database for vCloud Director
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.
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
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
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
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
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.
I have saved my vcloud.sql file on my desktop
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.
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.
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.
Verify the presence of “vcloud” database under section “Databases” and vcloud user under section “Security” by expanding your database instance
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.
Now database setup have been setup correctly. In my next post of this series I will cover vCloud director installation on Redhat server.
Comments
Post a Comment