Clustering is a technology used when you want to increase the availability of a server, service or application so it does not become a single point of failure. For example, if you have a critical server running on your network, it can be placed in a cluster with another server that is standing by to take over in the event of failure.
Windows Server 2003 Enterprise and Datacenter Editions both include a technology -- known as Cluster Service -- designed to increase the availability of your critical components. By combining this Cluster Service technology with Virtual Server 2005 R2 (VS2005 R2), you can increase the availability of your guest OSs running on a host. In this article, I will provide an overview of how to set up Virtual Server host clustering with a single guest OS.
Overview
With Virtual Server Host Clustering, a virtual machine (VM) is set up as a resource group -- specifically a physical disk resource -- on a cluster node. Several steps need to be completed to successfully implement a Virtual Server host clustering solution. The high-level steps include:
- Set up your servers in a cluster configuration.
- Install VS2005 R2 on each cluster node.
- Configure the disk resource and resource group.
- Configure a virtual network.
- Create a VM.
- Complete the configuration.
- Create a generic script resource.
- Install a guest OS.
The remainder of this article will look at each of these steps in more detail and provide links to references for additional information.
Setting up a cluster
Cluster Service provides high availability by automatically detecting when an application or service fails and automatically restarting another cluster member. Downtime from failed applications and services can be as little as a few seconds and go unnoticed by users. Windows Server 2003 Enterprise and Datacenter editions include Microsoft Cluster Service. This service needs to be installed on each node in your cluster if you want to take advantage of failover.
Pay close attention to the prerequisites for Cluster Service; there are several hardware and software requirements that must be met.
Installing VS2005 R2
In order for a guest OS to be able to run on either cluster node, both must be running VS2005 R2. Before you perform the installation, make sure you stop the Cluster Service. VS2005 R2 installs its own network driver during setup, which can cause conflicts with Cluster Service. The service can be restarted after the installation of VS2005 R2 is complete.
Assuming the computer meets all the hardware and software requirements, you can proceed with the installation steps described below. Completing these steps will install both the Virtual Server service and the Administration Web site.
- Insert the Virtual Server CD-ROM to launch the Setup Wizard. The wizard can also be started manually using setup.exe.
- Navigate through the wizard until you reach the Setup Type page.
- Select Complete (or Custom if you don't plan on installing the virtual server Web application). This installs Virtual Server using the default configuration. Press Next.
- On the Configure Components page, either accept the default Web site port of 1024 or type in a new port number. Press Next.
- Accept the default option to Configure the Administration Website To Always Run As The Authenticated User, or select Configure The Administration Website To Always Run As The Local System Account. Press Next.
- Press Enable Virtual Server Exceptions in Windows Firewall if users will access the virtual server through Windows Firewall. Press Next.
- Press Install.
- Press Finish when the Setup Complete page appears.
Before going on to the next step, create a new folder on the shared cluster disk that will host the virtual machines files (VHD and VMC).
Create the resource group and disk resource
Each guest OS runs within a virtual machine. As I mentioned earlier, a virtual machine is set up as a physical disk resource on the cluster. To create and configure a resource group and physical disk resource, follow these steps:
- Open the Cluster Administrator program by navigating to Start | Control Panel | Administrative Tools | Cluster Administrator.
- Create a new resource group. A resource group is a container that holds the cluster resources.
- Create a new resource that uses the following properties:
- Must be a physical disk resource type.
- The resource must be assigned to the resource group you created in Step 2.
- Make sure both nodes in the cluster are listed as Possible Owners.
- Choose the drive letter assigned to the cluster shared disk.
Configure a virtual network
Open the Virtual Server Administration site and select the cluster node that currently owns the resource group you created earlier. Create a new virtual network that uses the network adapter connected to the public network on this node.
The VNC file containing the configuration information of the virtual network you just created is stored in C:\Documents and Settings\All Users\Documents\Shared Virtual Networks\VirtualNetworkName.vnc. This file needs to be located on the shared drive; otherwise, it is not available to the second cluster node in the event of failover.
To address this, copy the VNC file from C:\Documents and Settings\All Users\Documents\Shared Virtual Networks\ and paste it in the shared drive.
Next, delete the virtual network from the Virtual Server Administration site. Under Virtual Networks, select Add and enter the path to the existing configuration file you copied to the shared storage device.
Create a VM
You are now ready to create the first VM. The configuration files must reside on the shared storage device, where it will be accessible to both cluster nodes. The exact steps are described below:
- Open the Virtual Server Administration site.
- In the navigation pane, under Virtual Machines, press Create.
- In the Virtual Machine Name field, type a name for the VM and specify the fully qualified path to the shared storage where you want to create it.
- In the Virtual Machine Memory field, specify the amount of RAM (in megabytes) used by the VM.
- In the Virtual Hard Disk field, select Create A New Virtual Hard Disk. Next, to set the size of the virtual hard disk, specify a value in Size, and then select either MB for megabytes or GB for gigabytes.
- Under Virtual Network Adapter | Connected To, select the virtual network you created in the previous section.
- Press Create.
Once you complete these steps, the VM is configured in a way that lets it failover to the second node.
Complete the configuration
Switch your attention to the second cluster node and configure it to support the VM you just created. First, you need to create the Virtual Network on this node; then, add a VM.
Within the Cluster Administrator tool, move the resource group you created in Step 3 to the second cluster node. Open the Virtual Server Administration site on this node and add a Virtual Network. Type in the path to the existing virtual network configuration file that is stored on the shared drive. Next, add a new VM, specifying the fully qualified path to VMC file on the shared drive.
Create the Generic Script resource
A script is available from Microsoft that ensures your guest OSs function correctly within a clustered environment. The script lets the guest OS operate as a cluster-aware application. To use the script, copy the script text (available on Microsoft's Web site) to into Notepad and save it as Havm.vbs. On each cluster node, copy the script to the systemroot\Cluster folder and execute it.
The script is implemented as a Generic Script resource type inside of the resource group you created in the previous section. When you create the resource type, make it dependent on the physical disk resource type, and enter the correct path to the script (%windir%\Cluster\Havm.vbs).
Install a guest OS
Your last step will be to proceed with the installation of the guest OS.
You can test the failover of your guest OS to the second cluster node using the steps described below:
- Open the Cluster Administrator tool. Verify that resource group is online.
- Right-click the group and select the Move Group option. You should see the Owner for the group change to the other node.



