vijayjain347

A topnotch WordPress.com site

How to Configure Virtual Server 2005 in Order to Setup a Test SQL Server Cluster

1 Comment

How to Configure Virtual Server 2005 in Order to Setup a Test SQL Server Cluster

   

 

Introduction

There are a lot of DBAs who want to learn how to cluster SQL Server. There are also a lot of companies who may have a production SQL Server cluster, but not a test SQL Server cluster. In both cases, the reason for this is that clustering hardware is very expensive, and setting up a non-production SQL Sever cluster is out of the question from a budgetary perspective.

Fortunately, this is no longer a problem. With the introduction of Microsoft Virtual Server 2005, anyone can create a non-production SQL Server cluster on a single, relatively inexpensive computer. Microsoft Virtual Server 2005 allows you to create a virtual cluster that acts just like a real cluster, without the expensive hardware. This allows DBAs to build their own SQL Server cluster for educational and training purposes, and for companies to build their own test/development servers. This is a great boon for DBAs, and an area that DBAs need to spend some time investigating.

The purpose of this article is not to teach you everything you need to know about clustering SQL Server. That would take a book. The focus of this article is to introduce you to how Virtual Server 2005 can be used to create a virtual SQL Server cluster.

This article is rather technical, and makes some assumptions about your knowledge. It is assumed that you know how to install and administer SQL Server 2003 Server, how to install SQL Server 2003 Clustering, how to install and administer Virtual Server 2005, and how to install SQL Server 2000/2005 clustering. If you are not familiar with all of these topics, you may need to read up on them, or seek out the help of others.

 

The Big Picture

If you want to set up a SQL Server cluster under Virtual Server 2005, here are all the steps you will need to perform:

  • Select the Hardware to Run Virtual Server 2005 (and the SQL Server Cluster)
  • Select the Host OS to Run Virtual Server 2005
  • Install and Configure Your Host OS
  • Install Virtual Server 2005
  • Configure Virtual Server 2005 for Clustering
  • Create Node1
  • Configure Node1
  • Create Node2
  • Configure Node2
  • Configure the Two-node Cluster
  • Install SQL Server 2000/2005 as a Cluster

In this article, we are not going to show you the details of all these steps. The goal is present the big picture, and to show you, step-by-step, how to configure Virtual Server 2005 as a cluster so that you can then install SQL Server clustering.

 

Select the Hardware to Run Virtual Server 2005 (and the SQL Server Cluster)

Just think, you will need a single computer that will end up running all of the following software:

  • A host OS
  • Two separate instances of Windows 2003 (guest OSs)
  • Windows 2003 Clustering on each of the Windows 2003 instances
  • A single instance of SQL Server running in an active/passive cluster

Even if you used the Microsoft-recommended minimum hardware for all of the above, this is still a lot of hardware. The exact hardware you need depends on what you will be doing with the cluster. If you are installing the SQL Server cluster for learning and educational purposes, the hardware recommendations are much less than if you intend to use the SQL Server cluster for development and testing purposes. Below are my (not Microsoft’s) minimum recommendations:

Learning/Educational Hardware Recommendation

  • Portable, Desktop, Server-Class Computer
  • 1-Way 2GHz+, Hyper threading CPU
  • 1GB RAM
  • 20GB free hard disk space

Testing/Development Hardware Recommendations

  • Server-Class Computer
  • 2-Way 2GHz+ CPUs
  • 2GB RAM
  • 50GB free hard disk space on a RAID 1, RAID 5, or RAID 10 array

Again, these are minimum recommendations, and bigger hardware, especially more RAM, can significantly boost performance of your virtual cluster. While you may get a virtual cluster running on less hardware, you won’t be happy with its performance. See the Virtual Server Getting Started Manual to see what hardware Microsoft recommends.

 

Select the Host OS to Run Virtual Server 2005

Virtual Server 2005 will run under any of these OSs:

  • Windows XP Professional
  • Windows Server 2003 Standard
  • Windows Server 2003 Enterprise
  • Windows Server 2003 Datacenter Edition

If you are building a learning/educational cluster, Windows XP Professional will work fine. But if you are building a testing/development cluster, then you will want to use Windows Server 2003 Standard or Windows Server 2003 Enterprise, which offer more scalability and performance.

 

 

Install and Configure Your Host OS

Install the host OS, and appropriate service pack, onto your hardware as you would any other install. Also install any updated hardware drivers, if appropriate. Once you are done installing the base OS, ensure that all the hardware is working correctly, and if appropriate, make the system a member of your domain and check to see that it can communicate over your LAN.

Virtual Server 2005 requires that IIS be installed and operating correctly on the host OS. So if IIS was not installed as part of the OS installation, then you must install IIS at this point. Once it is installed, check to see that it can serve up web pages.

In the Control Panel, System, Performance Options, Advanced Tab, select “Background services” for “Processor scheduling” and select “Programs” for “Memory usage.”

If your hardware is somewhat underpowered for your virtual cluster, you will want to turn off any OS services that don’t need to run in order to free up resources for your virtual cluster.

 

Install Virtual Server 2005

Install Virtual Server 2005 as directed in the Virtual Server Getting Started Manual. If you are not familiar with Virtual Server 2005, you will also want to spend some time with the Virtual Server 2005 Administration Guide before you proceed with the following steps in this article on how to configure Virtual Server 2005 as a cluster for SQL Server.

 

Configure Virtual Server 2005 for Clustering

Now that Virtual Server 2005 has been installed, you are ready to begin configuring it so that you can set up your virtual SQL Server cluster. Here’s what we will be doing in this section:

  • Creating a virtual “Private” network for all virtual node to virtual node communications.
  • Creating a virtual “Public” network for all client to virtual cluster communications.
  • Create a virtual shared disk for the virtual cluster to share.
  • Create a virtual quorum disk.
  • Create two virtual “C” drives to be used by the virtual nodes in the virtual cluster.

Once all of the above prerequisites are complete, then you will be ready to install the guest OSs and the virtual cluster.

 

How to Create a Virtual Private Network

In this step, we will create a virtual Private network, which will be used by the two nodes in our cluster to communicate.

  1. On the host computer, start the Virtual Server Administration Website. This is the tool you will be using to configure Virtual Server 2005 to work as a virtual SQL Server cluster.
     
  2. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Networks”, select “Create.” This displays the “New Virtual Network” Network Properties Screen, as shown below. Your screen may look slightly different than this one. That’s to be expected, as my computer is configured differently than yours. This will not affect what we are doing here. This is true for all of the screens you see in this article.

     

  3. In this screen, you need to replace “New Virtual Network”, next to “Virtual network name” with an appropriate name, as shown below. In our case, we will call it “Private.” This will make it easy for us to remember that this network is the private network, not the public network. In addition, leave the “Network adapter on physical computer” option set to its default value of “None (Guests Only).” And if you like, you can enter a description of this virtual network for the “Virtual network notes.” When your are done with this screen, as shown below, click on OK to create this virtual network.

     

You are now done creating the Private virtual network.

How to Create a Virtual Public Network

Creating the Public virtual network, the one used to allow clients to connect to the virtual cluster, is very similar to creating the Private network. The only major difference is that we need to allow this virtual network to talk to the real world. Here’s how we set it up.

  1. As before, from the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Networks”, select “Create.” This displays the “New Virtual Network” Network Properties Screen, as shown below. Your screen may look slightly different than this one.
     
  2. In this screen, you need to replace “New Virtual Network”, next to “Virtual network name” with an appropriate name, as shown below. In our case, we will call it “Public.” Up to this point, we have followed all the same steps we did when we created the Private virtual network. Now we will do something different. Next to “Network adapter on physical computer” we need to select a real network adapter that is installed on our host computer. This physical network adapter will be our window to the world, allowing clients to talk to our cluster. In my case, the real network adapter on the host computer is a Broadcom 440x 10/100 Integrated Controller. Your network adapter will most likely be different. Select the adapter (if you have more than one) that is most appropriate. And if you like, you can enter a description of this virtual network for the “Virtual network notes.” When your are done with this screen, as shown below, click on OK to create this virtual network.

     

 

How to Create a Virtual Shared Disk

Clusters require that a shared disk be available to store the data accessed via a cluster. In the real work, this is normally a Fiber or SCSI fault-tolerant RAID array. In our virtual world, this is just a file stored on the host computer. We must create the file and configure it appropriately. To create the virtual shared disk, follow these steps.

  1. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Disks”, select “Create.” This will produce a pop-up menu, from which you need to select “Fixed Size Virtual Hard Disk.” We must choose this option because shared disks must be Basic disks, not Dynamic disks. This screen appears.

     

  2. Here, you must specify three different things. First, you must specify the “Location” or the path where the file is to reside. When you click on the down-arrow button next to “Location”, you will see one or more options. These are the available paths where you can store your file. If you don’t like any of the available options, you can go to the “Search Paths” page of the Virtual Server Administration Webpage and change or add to the available paths. Second, you must specify the name of the file next to “Virtual hard disk file name.” And last, you must specify the size of the disk. Select a size that will somewhat exceed the total amount of space you will need to store all of the SQL Server databases you expect to reside on this array. You will not be able to change this later, so you may want to overestimate rather than underestimate the amount. When you are done, your screen should look similar to the following one.

     

  3. Once you have entered all the data, select “Create” to create the file. If you specified a large file, then it may take a few minutes to be created.

How to Create a Virtual Quorum Disk

Clustering two virtual servers requires the use of a quorum disk, which is used by the cluster to store database checkpoints and log files. Both nodes of a cluster must have access to the quorum disk. Creating a quorum disk is virtually identical to creating the shared disk. The only difference is that it does not have to be as large. Microsoft recommends that quorum disks be at least 500 MB, and that is what I recommend for your virtual quorum disk. To create the virtual quorum disk, follow these steps.

  1. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Disks”, select “Create.” This will produce a pop-up menu, from which you need to select “Fixed Size Virtual Hard Disk.”
     
  2. First, specify the “Location” or the path where the file is to reside. When you click on the down-arrow button next to “Location”, you will see one or more options. Second, you must specify the name of the file next to “Virtual hard disk file name.” And last, you must specify the size of the disk, which should be 500 MB. When you are done, your screen should look similar to the following one.

     

  3. Once you have entered all the data, select “Create” to create the file.

 

How to Create the Virtual “C” Drives for the Two Nodes of the Cluster

We still have two more virtual disk to create before we are done. In this case, we need to create the “C” drives for our two virtual nodes. Once these are created, we can then install our two guest OSs that will become our virtual nodes of our cluster. Creating these two virtual disks are very similar to what we have done already. The only difference is that we can chose a “Dynamically Expanding Virtual Hard Disk” instead of a “Fixed Size Virtual Hard Disk” if we want. The choice is yours. In my case, I am going to choose the “Dynamically Expanding Virtual Hard Disk” because it better allows me to minimize the amount of hard disk space on the host system that is devoted for our drive “Cs.” For example, since the disk can expand if necessary, I can create them at a minimum size to conserve space, and if I guess wrong, the disk files can expanded as necessary. To create the two virtual “C” disks, follow these steps.

  1. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Disks”, select “Create.” This will produce a pop-up menu, from which you can select “Dynamically Expanding Virtual Hard Disk.”
     
  2. First, specify the “Location” or the path where the file is to reside. When you click on the down-arrow button next to “Location”, you will see one or more options. Second, you must specify the name of the file next to “Virtual hard disk file name.” And last, you must specify the size of the disk, which should be 2 GB or larger. When you are done, your screen should look similar to the following one.

     

  3. Once you have entered all the data, select “Create” to create the file. This creates the “C” drive for node1. Now, repeat the above steps, except this time, assign a name of node2. Once both virtual drives have been created, you are ready to create the virtual machines, which will be used for the virtual cluster nodes.

 

Create Virtual Node1

At this point, Virtual Server 2005 has been configured, and is now ready for us to install the two nodes of our cluster. Essentially, you will be installing two instances of Windows 2003 Server, pretty much the same as you would install them on individual physical servers, with just a few differences. It is assumed here that you already know how to install Windows 2003 Server, so the focus of this section will be on the aspects of this installation that are unique to installing guest OSs in Virtual Server 2005. In this section, we will focus on Node1, and then we will do Node2 separately. We are doing these as separate steps because the configuration of each node is slightly different. To create a virtual server (also called a virtual machine) called node1, follow these steps.

  1. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Machines”, select “Create.” The following screen appears.
  2. ·  Let’s take a look at this screen, one section at a time. First, you must specify a name for the virtual machine you are now creating. In our case, let’s name it node1. If you don’t enter a path, the virtual machine configuration file (which is what we are actually creating in this step) will be saved in the default path. If you want the virtual machine configuration file stored in another patch, you can manually specify the path.

    Second, you must specify the amount of physical memory to allocate to this node. On my host computer, which only as 1 GB of RAM, I have specified 384 MB as the size for node1. Any amount smaller than this will cause the node to run very slowly. The more RAM you can allocate, the better. If you make a mistake here, this will not cause any problems, as you can change the amount of RAM allocated at any time after the virtual machine is created.

    Third, you specify the drive “C” for node1, which you created earlier. You do this by selecting “Use an existing virtual hard disk” and pointing to the filename and path of the virtual hard disk.

    Fourth, you must specify the “Public” virtual network adapter that you created earlier.  Your completed screen should look similar to the one below.

  3. ·  Once you are done, click on “Create” to create the virtual machine configuration file. Once the virtual machine configuration file has been created, you will then see the virtual machine name you just created in the “Master Status” screen of the Virtual Server 2005 Administrator’s Website.

    Next, we must configure the virtual SCSI controller, the shared disk, and the private network to be used by this virtual machine. Once we do that, we can then actually begin the installation of Windows 2003 Server as a virtual machine.
     

  4. ·  To configure the current virtual machine, go to the “Master Status” page and move the cursor over the name of the virtual server. When you do this, a sub-menu appears. Select “Edit Configuration” from the sub-menu. A screen, similar to the one below appears. Note that your screen will probably look somewhat different, as my system most likely is configured differently than yours.

     

  5. ·  The “Status” part of the screen appears first, and is not of much interest to us now. Our focus is on the “Configuration” part of the screen. It is here where we will create the virtual SCSI adapter, assign the shared disk to the adapter, and also add the private network to this virtual server.
  6. ·  To create the virtual SCSI adapter, click on “SCSI adapters”, and the following screen appears.

    Now, click on “Add SCSI Adapter,” and this screen appears.

    In the above screen, you want to select “Share SCSI bus for clustering,” which I have already done above, and select the “SCSI adapter ID” as 7 (the default value). Then click on “OK” to create the SCSI adapter. We are now done adding the virtual SCSI adapter.
     

  7. ·  Our next task is to add the shared disk to the virtual machine and assign it to the SCSI adapter we just created. To do this, from the “Configuration” screen for the virtual machine, click on “Hard Disks,” and this screen appears.

    This screen shows us the “C” drive that has already been assigned to this virtual server. Our task now is to add an additional virtual hard disk as our shared drive. To do this, click on “Add Disk,”, and this screen appears.

     

  8. ·  What we must do now is to complete the information for “Virtual hard disk 2.” Next to “Attachment” we must select “Primary channel (1). This is our virtual SCSI device. Next, we must enter the path and filename of our shared array next to “Fully qualified path to file.” Once this is done, click on “OK.” The completed the assignment of the virtual shared array to the virtual SCSI adapter for this virtual machine.
     
  9. ·  Our last configuration step, before installing the OS, is to specify the Private network for this virtual machine. As you may remember, the Public network was specified when we initially created the virtual machine. To do this, from the “Configuration” screen for the virtual machine, click on “Network adapters,” and this screen appears.

    The above screen shows you the network adapter that was created when the virtual machine was created. This does not need to be changed, as it is already assigned to the Public network. To add another virtual network adapter for the Private network, click on “Add Network Adapter,” and this screen appears.

    Now, we need to add the information for the “Virtual network adapter 2.” In this case, the only change we will make is to select “Private” for the “Connected to” option. Leave all other options at their default value. Click on OK to save this virtual network adapter.

At this point, you have now completed all the Virtual Server 2005 configuration steps. Now you need to install Windows 2003 Server into the virtual machine you just created and configured. Now, we come to one of those times when we are going to assume you know how to install a guest OS into Virtual Server 2005. If you don’t know how, then check the Virtual Server 2005 Administrators Guide for information on how to do so. We are also going to assume you know how to install Windows 2003 Server as well.

As you install Windows 2003 Server as node 1 of your virtual cluster, you will want to keep the following in mind, as they relate to how we just configured the virtual machine.

  • Install the OS onto your drive “C”.
     
  • Install the appropriate service pack.
     
  • Install the Virtual Server Virtual Machine Additions, as described in the Virtual Server 2005 Administrators Guide, after you have installed Windows 2003 Server.
     
  • Use your Public network as the network for the initial install. Use an appropriate IP naming scheme.
     
  • Once the OS is installed, configure the Private Network and the shared disk just as you would when installing a cluster on physical equipment.
     
  • Because clustering requires the use of a DNS Server and Active Directory, you must either have these available on your connected network, or you need to configure this node with its own DSN Server and Active directory. For learning/educational purposes, configuring these on this node gives you the capability to bring your virtual cluster with you anywhere. This is what I did on my portable PC.

 

Create Virtual Node 2

As I mentioned earlier, creating virtual node2 is almost identical to creating virtual node1. But there are some important differences. Because of this, and to help prevent any confusion, I am repeating all of the same steps here, and of course, including the differences as well.

To create a virtual server called node2, follow these steps.

  1. From the Master Status screen (the default screen displayed when the Virtual Server Administration Website is started), Under “Virtual Machines”, select “Create,” and the “Create Virtual Machine” screen appears.
     
  2. First, you must specify a name for the virtual machine you are now creating. In our case, let’s name it node2. If you don’t enter a path, the virtual machine configuration file (which is what we are actually creating in this step) will be saved in the default path. If you want the virtual machine configuration file stored in another patch, you can manually specify the path.

    Second, you must specify the amount of physical memory to allocate to this node. On my host computer, which only as 1 GB of RAM, I have specified 320 MB as the size for node2. Notice that this is less than the 384 MB that I allocated to node1. Why? The reason is that I made node1 a domain controller and DNS server, while node2 is only a member server. Because of this, node2 needs less RAM than node1. I would have liked to given more RAM to both of these virtual nodes, but if I did, then I would not have enough RAM to run the host OS, along with Virtual Server 2005, and any other applications I might be running on my laptop. Your case may be different. If so, then allocate as much RAM as you can to each virtual node so that you get the best overall performance.

    Third, you specify the drive “C” for node2, which you created earlier. You do this by selecting “Use an existing virtual hard disk” and pointing to the filename and path of the virtual hard disk.

    Fourth, you must specify the “Public” virtual network adapter that you created earlier.  Your completed screen should look similar to the one below.

  3. ·  Once you are done, click on “Create” to create the virtual machine configuration file. Once the virtual machine configuration file has been created, you will then see the virtual machine name you just created in the “Master Status” screen of the Virtual Server 2005 Administrator’s Website.

    Next, we must configure the virtual SCSI controller, the shared disk, and the private network to be used by this virtual machine.
     

  4. ·  To configure the current virtual machine, go to the “Master Status” page and move the cursor over the name of the virtual server. When you do this, a sub-menu appears. Select “Edit Configuration” from the sub-menu. A screen, similar to the one below appears.

     

  5. ·  The “Status” part of the screen appears first, and is not of much interest to us now. Our focus is on the “Configuration” part of the screen. It is here where we will create the virtual SCSI adapter, assign the shared disk to the adapter, and also add the private network to this virtual server.
     
  6. ·  To create the virtual SCSI adapter, click on “SCSI adapters”, and the following screen appears.

    Now, click on “Add SCSI Adapter,” and this screen appears.

    In the above screen, you want to select “Share SCSI bus for clustering,” which I have already done above, and select the “SCSI adapter ID” as 6. Note: Do not use the default value of 7, as this will conflict with node1. Then click on “OK” to create the SCSI adapter. We are now done adding the virtual SCSI adapter.
     

  7. ·  Our next task is to add the shared disk to the virtual machine and assign it to the SCSI adapter we just created. To do this, from the “Configuration” screen for the virtual machine, click on “Hard Disks,” and the “Note2 Virtual Hard Disk Properties” screen appears. Our task now is to add an additional virtual hard disk as our shared drive. To do this, click on “Add Disk,” and the screen refreshes, allowing us to add the shared virtual drive.
  • What we must do now is to complete the information for “Virtual hard disk 2.” Next to “Attachment” we must select “Primary channel (1). This is our virtual SCSI device. Next, we must enter the path and filename of our shared array next to “Fully qualified path to file.” Once this is done, click on “OK.” The completed the assignment of the virtual shared array to the virtual SCSI adapter for this virtual machine.
     
  • Our last configuration step, before installing the OS, is to specify the Private network for this virtual machine. As you may remember, the Public network was specified when we initially created the virtual machine. To do this, from the “Configuration” screen for the virtual machine, click on “Network adapters,” and a new screen appears.

    To add another virtual network adapter for the Private network, click on “Add Network Adapter,” and the screen refreshes, allowing us to add the needed information.

    Now, we need to add the information for the “Virtual network adapter 2.” In this case, the only change we will make is to select “Private” for the “Connected to” option. Leave all other options at their default value. Click on OK to save this virtual network adapter.

At this point, you have now completed all the Virtual Server 2005 configuration steps. Now you need to install Windows 2003 Server into the virtual machine you just created and configured.

As you install Windows 2003 Server as node 1 of your virtual cluster, you will want to keep the following in mind, as they relate to how we just configured the virtual machine.

  • Install the OS onto your drive “C” for node2.
     
  • Install the appropriate service pack.
     
  • Install the Virtual Server Virtual Machine Additions, as described in the Virtual Server 2005 Administrators Guide, after you have installed Windows 2003 Server.
     
  • Use your Public network as the network for the initial install. Use an appropriate IP naming scheme.
     
  • Once the OS is installed, configure the Private Network and the shared disk just as you would when installing a cluster on physical equipment.
     
  • Install this server as a member server.

Once you have completed node2 and tested it, you are now ready to cluster the two virtual nodes.

 

Configure the Two-Node Cluster

As this point, you now have two virtual nodes, node1 and node2 running under Virtual Server 2005. When you think about these, keep in mind that they act just like real physical servers. And now that you are ready to cluster them, you cluster them as if they were real physical nodes. As I have mentioned before, we assume you already know how to cluster two Windows 2003 Server nodes, and you need to do so now. Once you have the two nodes clustered, you will be ready to install a SQL Server 2000/2005 clustering.

 

Install SQL Server 2000/2005 as a Cluster

Once the two virtual nodes are clustered, you can install your SQL Server cluster, just as you would if the cluster were real, and not virtual. The installation is the same for both physical and virtual clusters.

 

Have Fun With Your Virtual Cluster

At this point, and after a lot of time invested, you will have a SQL Server cluster running under Virtual Server 2005. Now is the time to experiment and learn how to use it. Because with a production SQL Server cluster, you just don’t have this luxury

 

Advertisements

One thought on “How to Configure Virtual Server 2005 in Order to Setup a Test SQL Server Cluster

  1. These activities will also promote their ability to imagine, create and analyze at
    a basic level. These car games require a flash player plug-in to
    be installed in your internet browser, which enables these games
    to run. There are many car games that you can find on the internet, but if you are looking for one stop where
    all you racing temptations can come alive, this is the place for
    you.

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