You are on page 1of 21

1

How to create SQL Server 2005 Clustering with Virtual Server 2005 (Part 1)
After delivering SQL Training, I realized that there is a need to write a blog which talks about Installing
SQL Server 2005 cluster on Virtual Environment. Many DBA wants to see how Cluster looks like and
they don't have capability to buy/see actual cluster.
There is an easy solution to the problem by using Virtual Server 2005.
I will try to be as descriptive as possible. In case something is not clear, please provide feedback.
Prerequisites
You also have to download Microsoft Virtual Server (http://technet.microsoft.com/hi-in/bb738033(en-
us).aspx)
You also need to download ISO image for SQL Server 2005 evaluation
edition(http://www.microsoft.com/downloads/details.aspx?FamilyID=6931fa7f-c094-49a2-a050-
2d07993566ec&DisplayLang=en)
You should also have virtual hard disk of operating system. (Download
availablehttp://www.microsoft.com/downloads/details.aspx?FamilyID=77f24c9d-b4b8-4f73-99e3-
c66f80e415b6&DisplayLang=en)
Above link has three files to download. You have to download all files. Once you download content
from above link, you need to extract to a folder in local machine using WIN2K3R2EESP2.part1.exe. I
extracted in (E:\Virtual Server)

Please refer the readme file in above folder after you download.
NOTE: THIS SETUP WILL WORK ONLY FOR 30 days(depends on Read Me)
One you extracted the files, make three copies of virtual hard disk. One for Domain Controller, second
for node1 and third for node2. I have created files as below:
E:\Virtual Server\MyDC\MyDC.vhd
E:\Virtual Server\MyNode1\MyNode1.vhd
E:\Virtual Server\MyNode2\MyNode2.vhd


Once you have downloaded and installed Virtual Server you should see new menu item in Programs.


Now, we will configure the Virtual Servers. First we need to Create Virtual Machine so that we have
three separate virtual servers available. Make sure you set the Search Path at below screen.
On Left Side Menu choose Virtual Server > Server Properties > Search Path
2


Create Domain Controller
below is the screen shot of "MyDC" setting. Information which I filled in is
Virtual Machine Name MyDC
Memory 256
Use Existing hard disk Use the location from drop
down (E:\Virtual
Server\MyDC\MyDC.vhd)
Connected To Internal Network


Click on Create.
Now, Go to Master Status and try to "Turn ON" the domain controller (I know its not yet a DC but in
next step we are going to make it)
One you log in to MyDC, rename the machine to MyDC (by right click on My Computer > Properties)
You need to restart the computer after renaming.
Next step is to run "dcpromo" command to make this machine as domain controller.
Start>Run>dcpromo
3


Accept all settings as default, below are few which you need to modify.


During setup if it asks for windows installation CD, please point it to C:\WindowsInstallationFiles\I386
folder. Also, when prompted, please provide IP address as 192.1.1.1. You will be prompted to restart the
machine.
When you can logon screen after reboot, "Log on to" should have MyCluster selected.
4


Now we have one machine ready which will act as domain controller for our cluster setup.
Create Member Servers
You are now having one Domain Controller in your Virtual Network. Now, lets add two member servers
in the domain. As we did earlier, we have to add rest two vhd to server. Below screen shot is for Node2.


After configuration on Virtual Servers, follow below steps
1. Rename the nodes to MyNode1 and MyNode2 (still in Workgroup).
My Computer > Right Click > Properties > Computer Name
5


Then Restart MyNode1 and MyNode2
2. Disable the Firewall on all three machines.
Control Panel > Windows Firewall

Select "Off" from the UI.
3. Change the IP address of machines.
MyNode1 - 192.1.1.2 (DNS Server 192.1.1.1)
MyNode2 - 192.1.1.3 (DNS Server 192.1.1.1)
4. Join the machine to domain (MyCluster.com) Below screen shot.

This finishes setup of one domain controller and two member servers.
6

Now we have to make MyNode1 and MyNode2 as single cluster.
lets move on to Part 2
How to create SQL Server 2005 Clustering with Virtual Server 2005 (Part 2)
In Part 1 we have made our Virtual network ready which is having a domain controller and two member
servers (MyNode1 and MyNode2)
Lets start making cluster...
Create Quorum Disk
For cluster we need a Quorum disk. Below are the steps to make a Quorum virtual disk. In the menu of
Virtual Server, click on "Create" under "Virtual Disks" and select "Fixed Size Virtual Hard Disk".

After clicking there, you should get below screen. Fill in the details as shown. E:\Virtual Server\Q-
Drive.vhd is the path which I have entered. Lets give size as 250 MB.

And click on Create. you should see vhd file under path which we provided in above screen.
Create heartbeat Network
Click on "Create" under "Virtual Networks" and provide below details as shown below.
Give Name as HeartBeat and "Network adapter on physical computer" to be select as "None (Guests
Only)"

Click on "OK"
7

Add SCSI Adapters
Now to attach this to MyNode1 and MyNode2, we need to Turn Off those machine. Go to "Master
Status" link and select link to "Turn Off"
Once done, we need to choose "Edit Configuration" as shown below:

At MyNode1 Configuration page, click on SCSI adapters as shown below

Then you will get a screen like below

Click on the button and fill information as below. make Sure that you check "Share SCSI bus for
clustering" and ID as 7.

And Click "OK"
You should see below on final screen.

Above Steps to be done as MyNode2 also. Difference is SCSI adapter ID. For MyNode2 it should be ID
as 6.

here also, Click OK once added.
8


Add Network Adapters
Go back to "Edit configuration" Page for MyNode1 and this time we will choose "Network Adapters"

You will get below screen

Click on "Add Network Adapter >>" and Provide "HeartBeat" network.

Hit "OK"
Follow the same steps with MyNode2 configurations

Hit "OK"
Add Quorum Disk to Both Nodes
Below steps are self explanatory.
Go to Edit Configuration for MyNode1 and click on "Hard disks"

One you click, you will get below screen. Fill in the location of Q Drive which we created earlier.
(E:\Virtual Server\Q-Drive.vhd)

Now, Start MyNode1 and log on to the node. we need to format the drive which we attached in above
step and call it drive Q.
9


Clicking on Disk Management would result in below screen.

Select all default setting and finish the Wizard (don't make any modifications)

Then Right click on the Disk and assign drive letter Q: to it (as below)

On Finishing this you would be able to see Q drive in My Computer.
This finishes shared disk on MyNode1. Shutdown this Node because in order to attach and configure the
shared disks to the cluster nodes, you must ensure that the other node is turned off (In our case
MyNode1 should be off).
a. Logon to MyNode2 and Right-click My Computer, click Manage, and then expand Storage.
b. Double-click Disk Management.
10

c. The shared drives are listed, but have not been assigned a drive letter. Right-click the drive and select
Change Drive Letter and Paths.
d. Click Add.
e. Use the drop-down box to change the drive letter to Q, and press OK.

Now you should be able to See Q drive in My Computer on MyNode2. This finishes setting up shared
disk for Both the Nodes.
Ahh.. this page has lots of screen and it would be slow to load. I am continuing in Part 3.
How to create SQL Server 2005 Clustering with Virtual Server 2005 (Part 3)
In Part 1 and Part 2, we configured till setting up Quorum drive on MyNode1.
First we need to change the IP address of heartbeat network which we added to MyNode1 and
MyNode2.
Below is the screen shot of heartbeat IP on MyNode1. We need to give IP as 10.10.10.1 (once you hit
tab, subnet would come automatically, 255.0.0.0)
This would be displayed as "Local Area Network 2", you can rename it to private or heartbeat for easy
identification.

Follow the same thing on MyNode2. Provide heartbeat IP address as 10.10.10.2
Once IP Setup is done, "Turn Off" MyNode2 and Login to MyNode1. First we are going to install One
node cluster and later add MyNode2 in this cluster (we will call this as SQLCluster)
1, Go to Start>Run>Cluadmin

2. Select "Create New Cluster" from the options.
11


3. Hit OK
4. on "Cluster Name and Domain" screen, provide the domain name as MyCluster.com and Cluster
Name as "SQLCluster" and Hit "Next"
5. In Next screen, Provide Name as MyNode1 and Also click on Advanced button to select "Advanced
(minimum) configuration"

6. Next screen will analyze the settings, this may take a while to finish, You may get one warning since
we selected "minimum configuration", just ignore that and hit next.

7. In Next screen, you will be prompted for IP Address. Give it as 192.1.1.4

8. Next screen is for Cluster Service Account. For easiness of this lab, I am using Administrator
account. In real world, you should create a separate account in domain.
12


9. Hitting Next will show proposed cluster configuration.

Make sure that you hit on Quorum and select Q: as shown in above screen shot.
10. Once above step is complete, we have successfully installed, one node cluster. Screen Below...

11. Now, remember that MyNode2 was Turned off by this time.At this point, Turn On MyNode2 and let
it boot up completely. Don't Login to the node.
12. Come back to MyNode1 and Select File > New > Node

13. In below screen, provide MyNode2

14. Keep Moving forward and you will get below screen.
13


15. Keep going....

16. Finally.... you are done with Windows clustering

Click for Part 4
How to create SQL Server 2005 Clustering with Virtual Server 2005 (Part 4)
In previous parts(Part 1, Part 2 and Part 3), we have completed windows clustering. Now, before
installing SQL Cluster we have to configure MSDTC. We also need to make some shared drive which
we would use to keep SQL Server databases and MSDTC. We are going to use Disk M for MSDTC and
Disk X for SQL Server. We have already done the steps for Disk Q in part 2 (Create Quorum Disk
section). I will reproduce the steps for Disk M and X here.
Configure Shared Disks
1. Turn off MyNode1 and MyNode2
2. Choose Virtual Disks > Create > Fixed Size Virtual Hard Disks

3. Provide Details for M Drive (250 MB) and hit "Create" button

4. Same way we would create X drive (2 GB) and Hit "Create" button.
14



5. Below is what you would see in Windows Explorer

6. Lets attach the disks to MyNode1 and MyNode2 (They are off at this moment) I am showing for
MyNode1. Please follow same for MyNode2 also.


Click on Hard Disks

Hit OK and it would attach the disks to MyNode1. Follow the same for MyNode2
7. Turn on ONLY MyNode1.
8. Login to MyNode1 and Start > Run > DiskMgmt.msc. Cancel on the screen if you get any.
15

9. You should see two new Disks which are Not Initialized. Right Click and choose Initialize Disk.
Then you create partition by Right Click New Partition. Below is final screen shot which you should
see.

10. Now Turn Off MyNode1 and Turn On MyNode2
11. Go to DiskMgmt.msc on MyNode2 and assign drive letters (M for 250 MB drive and X for 2 GB
Drive)
12. Open Cluster Administrator (Start > Run > CluAdmin)
13. Create New Group called MSDTC (File > New > Group) and provide details

14. Choose Both Nodes as preferred owner. You might get an error at last screen but that's OK because
MyNode1 is offline.
15. Create a new "Disk" resource under MSDTC Group (File > New > Resource) Choose details as
below screen shot.

17. Choose M Drive in "Disk Parameters" screen. and finish.

18. Now you should see a Disk resource under MSDTC Group. Right click and choose "Bring Online"
19. Follow 13 to 18 again to Create new groups called "SQL Group" and add "Disk X"
16


20. Up to here we have completed shared disk configuration for MyNode1 and MyNode2. Let's start
MyNode1 and test fail over for new groups.
21. Before we install SQL Server, we have to configure MSDTC
Configure MSDTC as Resource
On MyNode1 and MyNode2 follow below steps
Open Control Panel on the cluster node
Double-click Add/Remove Programs
On the left side of the screen, double click Add/Remove Windows Components
Under Components, highlight Application Server and click Details
Select Enable network DTC access, and then click OK
Click Next
Click Finish
Add "MSDTC IP Address resource" in MSDTC Group
Right click MSDTC Group and select New > Resource
Type a some name such as MSDTC IP Address
In Resource Type, choose IP Address
Click Next
Click Next on Possible Owners screen
Click Next on Dependencies Screen
Give IP Address as 192.1.1.5
Click Finish
Right click the MSDTC IP Address resource and select Bring Online.
Add "MSDTC Network Name" resource in MSDTC Group
Right click MSDTC Group and select New > Resource
Type a some name such as MSDTC NN
In Resource Type, choose Network Name
Click Next
Click Next on Possible Owners screen
On Dependencies Screen, move MSDTC IP Address and click on Add to bring on Right window. Now
hit Next.
Give Name as MSDTC
Click Finish
Right click the MSDTC NN resource and select Bring Online.
Add "MSDTC" resource in MSDTC Group
Right click MSDTC Group and select New > Resource
Type a some name such as MSDTC
In Resource Type, choose Distributed Transaction Coordinator
Click Next
Click Next on Possible Owners screen
On Dependencies Screen, choose "MSDTC NN" and "M Drive" and click on Add to bring on Right
window.
17


Click Finish
Right click the MSDTC resource and select Bring Online.

Above is the screen shot of "MSDTC group". Make sure you have matching "Resource Type" as shown
in the screen.
Test fail over for MSDTC group. This finishes all Prerequisites to install SQL Server on Cluster. Get
ready to install SQL Server in last part of the series.
You can follow http://support.microsoft.com/kb/899191 to make changes to MSDTC Services.
Lets move on to last part of the series

How to create SQL Server 2005 Clustering with Virtual Server 2005 (Part 5)
This is the last part of the series. Once you have configured windows cluster and MSDTC, installing
SQL is piece of cake. I already mentioned in part 1 that you have to download ISO (SQLEVAL.ISO)
which we would need to attached as CD drive which would have setup files. I have copied the image on
E:\Virtual Server\SQLEVAL.ISO
We also need to create domain account and domain groups in domain controller. So, logon to domain
controller. Go to Start > Run > DSA.msc and follow below screen-shots.

Give the details of account (i.e. SQLSVC)
18


Set the password after clicking next button. Make sure that "Password never expires" is checked and
"User cannot change password" is checked.

One account is created, lets add a Group and add SQLSVC into the group.

Give Group Name "SQL Admin Groups"

Right click on "SQL Admin Groups" properties and add "members"
19


Now you are done with Domain controller.
Now, let's mount ISO image to MyNode1 and MyNode2. To do this, go to Virtual server console.

Click on CD/DVD and fill details as below

Above has to be done on both the nodes. Once you do that, you can see SQL Installation CD mounted
on MyNode1 and MyNode2.
Lets Start SQL setup now.
Log off from MyNode2. This is required to avoid running into known bug.
Log on to MyNode1.
Move all the resource groups to MyNode1 using Cluster Admin

Go to DVD drive and double click on setup.exe from Servers folder
Accept EULA. Next.
Click 'Install' and wait for SQL Server to configure components and setup the installation. Once the
required components (.NET Framework 2.0, MS SQL Native Client and the SQL Server 2005 setup
support files) have been installed click 'Next'
Click 'next' when prompted with the screen 'Welcome to the Microsoft SQL Server Installation Wizard.
The installation will then proceed through the 'System Configuration Check'- click 'next' to proceed.
Enter Registration Information, click 'next'
20

Components to Install- Select all components (SQL Server Database Services, Workstation components)
, then click 'next'
Since this is the first installation of a new database instance for SQL server, select 'Default Instance'.
Provide Virtual Server Name (VirtualSQL)

Provide Virtual SQL Server IP Address (192.1.1.6) in Next screen and click on Add. Then Next

Provide SQL Group in Next screen as shown below

Click Next on Below Screen
21


Provide Administrator Password in next screen and click Next
Provide SQL Service Account created earlier on domain
controller(sqlsvc)

Provide Domain Group which we created earlier (SQL Admin Groups)

Authentication Mode. Choose Mixed Mode (Windows Authentication and SQL Server Authentication),
provide sa password and click 'next'
Keep the default settings (SQL Collations- Dictionary Order, case-insensitive, 1252 character set) and
click next
Error and Usage Report Settings. Leave defaults (none checked). Click 'next'
Check installation Settings, click 'install'.
During the install process you can always see what is happening on other node.
Once the installation process is completed, click 'next'
And finally... Finish.
Now we are done with the setup and we should see the resources in cluster admin under SQL Group.
Any feedback is greatly appreciated.

You might also like