Partilhar via


Hyper-V Guest Clustering Step-by-Step Guide

 

You might have wondered about how to setup Failover Cluster inside Hyper-V Virtual Machines. As you know, the major element of a cluster is the shared storage piece. Inside Hyper-V VMs, iSCSI is the only supported method of providing shared disks over virtual NICs.

 

Here are detailed steps on how to create Highly Available resources inside Hyper-V Windows Server 2008 R2 VM;

 

1. VM Preparation: Provision the following VMs on your Hyper-V server;

  • One Windows Server 2008 R2 DC Virtual Machine
  • At least two Windows Server 2008 R2 Virtual Machines
  • Use an iSCSI target software to provide shared storage to each node

 

Update (04/05/2011): Microsoft product group just released Microsoft iSCSI Taget Software 3.3 for public download

https://www.microsoft.com/downloads/en/details.aspx?FamilyID=45105d7f-8c6c-4666-a305-c8189062a0d0

https://blogs.technet.com/b/virtualization/archive/2011/04/04/free-microsoft-iscsi-target.aspx

 

If you have access to MSDN or TechNet Plus subscription downloads, you may use Windows Server 2008 Storage Server and install Microsoft iSCSI Software Target on it (Evolution version from MSDN or TechNet Plus subscription download and production version from your Windows Server 2008 Storage Server's OEM vendor )

Note: default Administrator password for Windows Server 2008 Storage Server is in the Windows Storage Server 2008 Release Notes (WSS2008_RELNOTES.DOC), which can be found in the “Tools” ISO file. Please see more information about Microsoft Storage Server 2008 at the end of this post.

In my demo case, I'm using iSCSI target software that can be installed on Windows Server 2008 R2. So, I'm using my WS08 R2 Domain Controller as my storage server as well. This saves me one VM.

You can use any other iSCSI target solution if it’s available to you. There are few free iSCSI target software such as Starwind that can also be used for this setup.

 

2. Virtual Network: create two virtual network switches in Hyper-V management console. One will be serving cluster Heartbeat (Private Network switch) and the other one will be for cluster communication and iSCSI traffic (Internal Virtual Switch) .

Note: Optionally you can add more virtual network switches based on your needs. If you need to access resources outside your Hyper-V server then you’ll need to create an External Virtual Switch and use that for cluster communication.

3. Configure Shared Storage: Create a Virtual Hard Disk (VHD) on your Hyper-V host machine and attach it to your iSCSI Storage VM Server via the virtual SCSI controller.

Note: all the iSCSI shared disks will be created inside this VHD, so you need to size the VHD based on the number of shared disks and their size you will need in your cluster.

In my example, I’ve created a 20GB VHD inside Hyper-V Management console (New Hard Disk…) and attached it to my storage server VM's SCSI controller.

clip_image001

Now, from inside the storage VM, we'll need to access Microsoft iSCSI software target (under Administrative Tools)

Start creating your shared disks (including Witness disk) under Devices.

clip_image002

clip_image003

clip_image004

clip_image005

On the next step you can add the target node(s) or just move next and add it later. We'll come back and add it later.

clip_image006

You can see that our iSCSI disk has been provisioned but isn't being accessed by anyone yet.

Let's repeat the last step and provision more iSCSI virtual disks for your shared disks on the cluster. (I named them SharedDisk0X)

clip_image007

Configure the firewall on both ends for iSCSI communication;

On the client side configure firewall exception for iSCSI Service; (you should be just fine by checking the check box for Domain communications)

clip_image008

On the Storage Server side configure the firewall exception on iSCSI Service and Default iSCSI Target Port;

clip_image009

Configure iSCSI Initiator on each node;

Select iSCSI initiator from Administrative Tools. If this is the first time using iSCSI initiator on that machine, Windows will require to start the iSCSI service.

clip_image010

The initiator name (screen shot below) will be used inside iSCSI Target Software to establish the connection.

clip_image011

Note: If you're using the Administrator account (with the same password on domain and local) for your Demo, make sure you logon to each node using DomainName\administrator user name. On Windows Server 2008 and above, using the administrator account will fall back to the local administrator account not Domain. Use can always use Whoami command to check the logged on account on your session. This could be a gatcha if your local and Domain Administrator accounts share the same password!

clip_image012

clip_image013

On the Storage Server, start the iSCSI software target console.

Under iSCSI Targets,

clip_image014

clip_image015

Add iSCSI hard disks to each Target;

clip_image016

clip_image017

clip_image018

 

Note: you can also create only one Target (i.e. Name: W2K8_Clu), add Virtual Disks to it and then logon from the iSCSI initiators from each node using the same iQN name.

 

clip_image019

Now on each cluster node, go back and try to connect to the iSCSI software Target on the storage server, using iSCSI Initiator. Quick Connect… should work fine for you.

clip_image020

clip_image021

clip_image022

clip_image023

After this all those iSCSI disks will show up in each node's Disk Management console (diskMgmg.msc)

clip_image024

While in there, we need to right click on each disk and bring them Online. Then initialize all the disks and assign them Drive letters. This has to be done on all nodes that are going to be joined to the cluster.

Note: As you know, in production environment you need to have a dedicated network for your iSCSI traffic but for this demo I've used the same virtual network for the iSCSI traffic.

 

4. Cluster Setup: Now that all the nodes are joined to the Domain and can see all the iSCSI shared disks, we need to install Failover Clustering Feature (From Server Manager Console) on each node. (No Reboot required)

clip_image025

After installing the Role, you’ll need to use the most awesome feature of new failover clustering in Windows Server 2008 and Windows Server 2008 R2 that is Cluster Validation Wizard.

Go to Failover Cluster Manager console from Administrative Tools.

Launch Validate a Configuration… wizard;

clip_image026

clip_image027

clip_image028

When the validation completes, you’ll need to review the report and address any possible issues in there.

The following report looks like a successful one;

clip_image029

In my demo, I got 3 warnings that are related to not having a default gateway assigned to the Ethernet adaptors. (I wouldn't worry about this since my cluster won't need public network access)

clip_image030

With validation report looks good here , we can form a cluster with these nodes using the Create a Cluster... Option in Failover Clustering console’s main page;

clip_image031

Assign a Name and IP address for the cluster itself

clip_image032

clip_image033

Congratulations, the cluster has been configured inside your virtual machines.

clip_image034

Now you can proceed with creating highly available resource under Services and applications such as MSDT, SQL and all the other ones.

The following screen shot was taken after MSDTC or SQL resources were installed;

image

And you can see the available storage and used ones in the Failover cluster console;

image

So Long…!

 

More Resources;

Microsoft iSCSI Software Target

https://technet.microsoft.com/en-us/library/dd573326(WS.10).aspx

Configuring Windows Firewall for iSCSI Software Target

https://technet.microsoft.com/en-us/library/dd573342(WS.10).aspx

iSCSI Software Target 3.2 FAQ

https://blogs.technet.com/storageserver/archive/2009/08/14/iscsi-software-target-3-2-faq.aspx

Known Issues and Updates for Windows Storage Server 2008

https://technet.microsoft.com/en-us/library/dd904408(WS.10).aspx

Blog: Windows Storage Server 2008 with the Microsoft iSCSI Software Target 3.2 available to MSDN and TechNet Plus subscribers

<https://blogs.technet.com/josebda/archive/2009/05/16/windows-storage-server-2008-with-the-microsoft-iscsi-software-target-3-2-available-to-msdn-and-technet-plus-subscribers.aspx>

Failover Cluster Step-by-Step Guide: Configuring a Two-Node File Server Failover Cluster

https://technet.microsoft.com/en-us/library/cc732035(WS.10).aspx

Guide to Creating and Configuring a Server Cluster Under Windows Server 2003

https://www.microsoft.com/downloads/details.aspx?familyid=96F76ED7-9634-4300-9159-89638F4B4EF7&displaylang=en