Windows Server 2012 – Getting Started With Failover Clustering

Failover clustering is a bit intimidating at first. However, once you get started it’s not too bad (like most things).


  1. Configure VM’s
  2. Configure Shared Storage
  3. Configure Nodes
  4. Create the Cluster

Configure VM’s

You will need the following VM’s to do this in a lab:

  1. iscsi1. This server will act as the iSCSI target.
  2. clusternode1.
  3. clusternode2.

I’ll leave the names and addressing up to you. For help creating VM’s in Hyper-V, see my previous blog post Getting Started with Hyper-V.

Configure Shared Storage

You’ll need to create the following volumes and connect them to both cluster node’s.

  1. cluster1-quorum, 5GB
  2. cluster1-disk1, 10GB

For help with configuring an iSCSI target server, see my previous blog post Windows Server 2012 ā€“ Getting Started With the iSCSI Target Server.

Configure the Nodes

On each node, run the following commands. You’ll need to scan the code and replace variables as needed. For example, “Target-IQN” needs replaced with the correct setting from the iSCSI target server.

#Install Roles
Install-WindowsFeature failover-clustering,multipath-io -includeManagementTools

#Configure iSCSI Service
Start-Service msiscsi
Set-Service msiscsi -startupType "Automatic"

#Connect to the Target
New-iSCSITargetPortal -TargetPortalAddress "iscsi target fqdn"
$nodeAddress = (Get-IscsiTarget).NodeAddress
Connect-iSCSITarget -NodeAddress $nodeAddress -IsPersistent $true

#Configure Multipath Settings
Enable-MSDSMAutomaticClaim -BusType iSCSI #(computer will reboot, possibly bsod)

##one the reboot is complete, continue with the code below.

Get-MSDSMAutomaticClaimSettings #visually confirm that iscsi = $true
Set-MSDSMGlobalDefaultLoadBalancePolicy -Policy RR

#Online and Initialize the Disks
Get-Disk | ?{$_.FriendlyName -like "MSFT Virtual HD*" -and ($_.IsReadOnly -eq $true -or $_.isOffline -eq $true)} | % {Set-Disk -Number $_.Number -IsOffline $false}
Get-Disk | ?{$_.FriendlyName -like "MSFT Virtual HD*" -and ($_.IsReadOnly -eq $true -or $_.isOffline -eq $true)} | % {Set-Disk -Number $_.Number -IsReadOnly $false; Initialize-Disk -Number $_.number -partitionStyle GPT}

Now, choose one cluster node to work on. Login and run the following commands:

#Format the disks and assign a drive letter
Get-Disk | ?{$_.FriendlyName -like "MSFT Virtual HD*" -and $_.partitionstyle -eq "RAW"} | % {
  Initialize-Disk -number $_.number -partitionStyle GPT
  New-Partition -disknumber $_.number -useMaximumSize -AssignDriveLetter
  $driveLetter = $null
  $driveLetter = (Get-Partition -DiskNumber $_.number | ?{$_.type -eq "Basic"}).DriveLetter
  Format-Volume -DriveLetter $driveLetter -FileSystem NTFS

#Run a test to see if the cluster can be created.
Test-Cluster -node sql1,sql2 -ReportName C:\Install_Files\
#stop here and review report. Some warnings are ok.

#create the new cluster
New-Cluster -name cluster1 -node clusternode1,clusternode2 -staticAddress -NoStorage -AdministrativeAccessPoint ActiveDirectoryAndDns

#add the volumes to the cluster
Get-ClusterAvailableDisk -cluster cluster1 | Add-ClusterDisk

#run this to find the cluster disks. Choose one to be the quorum.

#configure quorum settings. change "cluster disk 1" to whatever disk you want to be the quorum.
Set-ClusterQuorum -Cluster Cluster1 -NodeAndDiskMajority "Cluster Disk 1"

And, that’s it. You should now have a green cluster to play with.


One thought on “Windows Server 2012 – Getting Started With Failover Clustering

  1. Pingback: Getting Started with SQL 2012 Clustering | windowsmasher

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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