Vous êtes sur la page 1sur 71

How To Build a Windows Cluster with Virtual PC and iSCSI - Part I

I was working on a project recently which, for various reasons, required IIS to be installed in a Windows 2003 Server cluster and I was asked if I could do this. As I had never actually done this before I wanted to try it out for myself in a test environment. So I fired up Virtual PC 2007 and started to look at building a test platform using virtual machines. Unfortunately, I quickly found out that that Virtual PC doesnt emulate or provide support for SCSI disks and since SCSI disks are a requirement for a Windows Server 2003 cluster I had to look for an alternative method. I vaguely remembered an old post on a Virtual PC forum where someone had suggested that you could actually build a Windows Server cluster using iSCSI so I decided to give it a go. A few internet searches led me to a number of iSCSI target software vendors web sites and I eventually decided to use the Starwind free iSCSI target for Microsoft Windows which you can get here : http://www.starwindsoftware.com System Requirements In this walkthrough I will demonstrate how you can build a test environment using only virtual machines running under Virtual PC 2007. A Windows Server cluster requires a domain account for the cluster service to function correctly so we will need to have a domain controller running in addition to the two cluster nodes and the iSCSI server. My test environment consists of 4 virtual machines each running Windows 2003 Server Enterprise Edition. Each virtual machine has been allocated 256MB of memory and a 4GB virtual hard disk. The iSCSI server has a second 10GB virtual hard disk assigned which is used as shared storage by the cluster. All the virtual machines have been configured to use the Microsoft Loopback Adapter in Virtual PC as shown below and each machine has a static IP address assigned as follows : Domain Controller - iSCSI Server - Cluster Node A - Cluster Node B -

The virtual machine which will act as the iSCSI target server has a second virtual hard disk assigned to it.

This additional disk on the iSCSI server is configured as a Basic disk and formatted with NTFS as shown here.

The next step is to install the Starwind iSCSI Target Software. For the purposes of this test I used the free version which you can get here : StarWind Free iSCSI Target. Launch the Starwind setup program to begin the installation.

Accept the license agreement and click Next.

Accept the default installation path and click Next

Select a Full Installation type from the drop-down menu and click Next

Accept the default Start menu folder and click Next

Click Install to complete the installation

Once the installation has completed we are ready to launch the Starwind console and begin configuring the iSCSI targets which the cluster will use. Double-click the Starwind icon to launch the Starwind console. By default there is one connection created named localhost which is configured to listen on the default port of 3260. Highlight this connection and click Connect on the toolbar.

The default admin account is named test with a password of test which you can change later if you prefer. As this is only a development environment I will leave the default values in place. Type the username and password and click OK to login to the default connection.

The Starwind software is a trial version. In order to activate the software you need to enter the license key which you get when you register for the free version.

Highlight the localhost connection and then click Registration on the main Help menu. Click the Load license from file button and then browse to the location where your license file is saved. Click Load and then OK. Your free version of Starwind is now registered and will last longer than 15 days.

We are now ready to start configuring the iSCSI target devices. The device types that I am using in this walkthrough are Image File devices. This is a virtual iSCSI hard disk which is stored as a single file on a disk, a bit like a VHD file. Highlight the localhost connection and click Add device on the menu to launch the Add Device wizard. Click Image File device and then click Next

Click Create new virtual disk and then click Next

Browse to the E:\ drive and type Quorum.img as the filename and then click Next

On the Specify Image File device parameters page ensure that both Asynchronous mode and Allow multiple concurrent iSCSI connections (clustering) are both checked and then click Next

Choose a name for the target and click Next

On the Completing the Add Device Wizard summary page click Next

Click Finish to close the Wizard

We can now see that the Image File device quorum has successfully been created

Create two further Image File devices which will be used as shared storage for the Windows Server cluster

The iSCSI target server is now configured and ready to be used. In the second part of this tutorial I will demonstrate how to install and configure the Microsoft iSCSI Initiator and then complete the Windows Server cluster installation.

How To Build a Windows Cluster with Virtual PC and iSCSI - Part II

posted in iSCSI |

In the first part of this tutorial we looked at how to setup an iSCSI target in a virtual machine. If you havent read the first part you can find it here : How To Build a Windows Cluster with Virtual PC and iSCSI - Part I In this second part we will install and configure the Microsoft iSCSI Software Initiator and then in the third and final part we will build a Windows Server cluster using virtual machines running under Microsoft Virtual PC 2007. Windows Server 2008 ships with a built-in iSCSI initiator but if you are running Windows Server 2003 you need to download and install it manually. In this walkthrough I am using version 2.08 which you can get here : Microsoft iSCSI Software Initiator Version 2.08 The Initiator software needs to be installed on each of the machines that will be required to connect to the iSCSI target in order join the cluster. Double-click the file Initiator-2.08-build3825-x86fre.exe to launch the setup. Click Next to continue

Ensure that Initiator service and Software initiator are both checked and click Next

Accept the license agreement and click Next

The installation wizard copies the files onto your server

When the installation completes click Finish to close the installation wizard.

Now that the Initiator software is installed we need to configure the iSCSI targets. Double-click the Microsoft iSCSI Initiator icon to open the Properties page. On the Discovery tab click Add

In the Add Target Portal dialog box type the IP address of your iSCSI target machine and click OK. Make sure that you leave the default port of 3260 set

The default target iSCSI portal has now been added. Next we need to configure the iSCSI targets

Click the Targets tab and you should see the iSCSI disks that we configured previously. They will initially have a status of Inactive. In order to activate the target iSCSI disks we need to log on to them and configure their various properties

Click the Log On button to connect to the target disk. When the Log On to Target dialog appears ensure that Automatically restore this connection when the system boots check-box is selected and click OK

The iSCSI target quorum now has a status of Connected. Repeat this process for any other drives you have configured

Click the Persistent Targets tab to ensure that the connection to the iSCSI disks will be restored automatically when the system re-starts

If you click the Bound Volumes/Devices tab you should see that the mount points for your persistent iSCSI targets have been set. If you click Bind All you will see them represented by their respective drive letters

Now that we have the iSCSI initiator installed on the first node we need to repeat the process on the second node so that both servers will be able to communicate with the iSCSI target. Power off the first node before installing the initiator on the second node. Once the initiator has been installed on the second node power that machine off and then switch the first node back on. The next step is to Initialize and configure the disks in Windows Important - In order to avoid any possible file system corruption on the shared SCSI disks, it is recommended that you only have one node running at any one time until after the Windows Cluster service is installed and configured. Power on the first node (ensuring that the second node is powered off) and then launch the Computer Management console. Click on the Disk Management icon and this should invoke the Initialize and Convert Disk Wizard. Click Next to continue

Ensure that all of the disks are selected and click Next

Dynamic disks are not supported on Windows Clusters so it is important that we dont convert them. On the Select Disks to Convert screen ensure that none of the disks are selected and click Next

To complete the disk initialization process click Finish

The next step is to create and format the disk partitions. Right-click one of the unformatted Basic disks and click New Partition to launch the New Partition Wizard and click Next

On the Select Partition Type screen choose Primary Partition and click Next

Specify the maximum available partition size for the disk and click Next

In this example I am configuring the disk which I will eventually use as the Cluster Quorum disk so I have assigned it the drive letter Q. Assign an appropriate drive letter and click Next

Windows Server clusters require that all shared drives are formatted with NTFS. On the Format Partition screen select Format this partition with the following settings then choose NTFS and leave the default allocation unit size. Choose an appropriate volume label and click Next

Click Finish to complete the New Partition Wizard

Follow the same steps for the other two disks so that they are all formatted with NTFS and have an appropriate drive letter. When complete the disks should appear as follows in the Disk Management console. We have now completed the initial configuration of the first node in preparation for the cluster installation. At this point we need to power down Node A and then start up Node B. Remember that it is important to have only one machine running at any one time until after the cluster service is installed.

When Node A has shut down, start up Node B and check the iSCSI Initiator properties to ensure that it has reconnected to the iSCSI target disks correctly as shown here

On Node B launch the Computer Management console and in Disk Management you should see the unformatted disks listed as Basic disks. Format each of the disks with NTFS and assign the same drive letters as on Node A

Once you have formatted and assigned a drive letter to each of the iSCSI disks they should appear in the Disk Management console as regular disks

However, in reality these disks are simply a single large file which is stored on the iSCSI target server. It is the iSCSI software which presents these files to the operating system and allows it to address them as regular disks.

In the third and final article in this series we will look at the installation of the Windows Cluster service and demonstrate how it is actually possible to build a Windows Server Cluster using an iSCSI target and Microsoft Virtual PC

How To Build a Windows Cluster with Virtual PC and iSCSI - Part III
posted in iSCSI |

In the third and final article of this series we will look at installing the Windows Cluster service and creating a 2-node cluster using two virtual machines running in Virtual PC 2007. If you havent done so already I would recommend that you look at the previous two articles in this series which cover the pre-requisites for building a cluster under Virtual PC. You can find them here (http://www.iisadmin.co.uk/?p=91) and here (http://www.iisadmin.co.uk/?p=215) The Windows Cluster service requires a domain account in order to function correctly so start by creating a new domain account on your domain controller and make it a member of the Domain Users group. The account should also be made a member of the local Administrators group on each of the two nodes. As mentioned previously, ensure that only one node is powered up at any one time until after the Cluster service has been installed. To begin the cluster installation log on to the first node using a domain account which is a member of the local administrators group and then launch the Cluster Administrator snap-in. Select the option to Create a new cluster from the drop-down and click OK

This will invoke the New Server Cluster Wizard. Click next to continue

On the Cluster name and Domain screen enter the domain name and the name of your cluster for your environment and click Next

On the Select Computer screen enter the name of the machine on which your are installing the Cluster service and click Next

The Cluster Wizard will analyze your setup to determine that the necessary requirements are in place for a successful installation. If it is successful you will see a green bar. In this example we can see that the wizard has flagged up a warning. This is due to the fact that my cluster nodes only have one network interface configured. In a production environment you should have separate network interfaces for the public and private networks but we can safely ignore the warning for the purposes of this test environment. Click Next to continue

On the IP Address screen we need to configure the IP address that will be used solely for administrative access to the cluster. Any additional services such as SQL Server or IIS will need to have their own dedicated IP address assigned. Enter the cluster IP address and click Next.

On the Cluster Service Account screen enter the username, password and domain details for the cluster service account that was created previously. This is the account that will be used to run the cluster service and it needs to be a domain account and a member of the local administrators group on all of the cluster nodes. Enter the details for the cluster service account and click Next

The Proposed Cluster Configuration screen provides a summary of the cluster configuration and gives you an opportunity to make any changes before the installation proceeds. If you click the Quorum button you can check to see which shared drive the Cluster Wizard has selected to use as the cluster quorum. I have seen cases where the wizard has not selected the drive that I wanted to use as the quorum. If this happens during your cluster setup you can change the drive at this point. Click OK to continue

If the Proposed Cluster Configuration is correct click Next to begin the installation

The Cluster Wizard begins the installation which should take a few minutes. During this process the wizard also writes out a log file which you can find in %SystemRoot%\System32\LogFiles\Cluster\ClCfgSrv.Log

When the Cluster Wizard has completed the installation the progress bar should display green. Click Next to close the wizard.

To validate the cluster installation check that all of the cluster resources have been brought online successfully. You should see the Cluster IP Address, Cluster Name and various disks all showing a state of Online. You can also check the cluster installation log file for any errors or warnings.

Now that the cluster service is up and running you can go ahead and join the second node to the cluster. On Node B launch the Cluster Administrator snap-in and select the Add nodes to cluster option. Select the existing cluster name and click OK

The Add Nodes Wizard will begin. Click Next to continue

On the Select Computers screen ensure that Node B is selected and click Next

The Add Nodes Wizard analyzes the configuration of your second cluster node and reports any issues it finds. In this example, as with the first node in the cluster, the Wizard has detected that there is only one network interface and flags this as a warning. This doesnt affect the ability of the cluster to function in a test environment so click Next to continue

On the Cluster Service Account screen you need to re-enter the cluster service account password and then click Next to continue

The Proposed Cluster Configuration dialog box summarizes the cluster configuration. Click Next

The Add Nodes Wizard adds the second node to the cluster and configures the cluster resources. As soon as the progress bar displays green you can click Next to continue

On the final Add Nodes Wizard screen you can view the cluster configuration log and then click Finish to close the wizard

To validate the second node open the Cluster Administrator snap-in and check that both nodes are online and that all the cluster resources are also online.

If you have followed the steps in the three articles in this series then you should now have a fully functioning Windows Server cluster running under Microsoft Virtual PC. You can go ahead and test your cluster by either failing over to the second node or by simply switching off the Node A virtual machine which will simulate a complete node failure. If everything works as it should you will see all of the cluster resources failover and come online on Node B You are now ready to start installing cluster-aware applications on your virtual test cluster. In a follow-up article I will demonstrate how to install IIS 6.0 in a Windows 2003 cluster.