This article will guide you through how to build guest (virtual) cluster using Hyper-V on Microsoft Windows Server 2012 R2. Functional Failover Clustering is the first step before installation of clustered File Server or AlwaysOn Failover Cluster Instance on Microsoft SQL Server etc. You can use this guide on a single Hyper-V host or on the Hyper-V cluster.

Hyper-V role on Microsoft Windows Server 2012 R2 gave us great opportunity to simply create virtual machines and configure Failover Clustering with Cluster Disks with or without enabled Cluster Shared Volumes (CSV) that are located on a single shared VHD or VHDX file.

There are many concerns about guest clustering and few of them are true. As administrator or architect you need to consider if the highly-available VM is enough or if you need guest failover cluster that can be also assembled from the two or more highly-available VMs. If you require a very small downtimes during maintenance (for example patching on a File Server) or the failure of the guest operating system or application can cause a huge problem for your business then guest clustering on the Hyper-V is the best possibility for you.

Create VMs and add shared disks

  • Create two or more VMs.
    • I will create "contfsclu1n0" in "C:\ClusterStorage\Volume1\contfsclu1n0" and "contfsclu1n1" in "C:\ClusterStorage\Volume1\contfsclu1n1".
  • Create VHD or VHDX that will be shared between VMs.
    • PowerShell is the fastest way:
New-VHD -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-witness.vhdx" -Dynamic -SizeBytes 1GB
New-VHD -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk0.vhdx" -Dynamic -SizeBytes 500GB
New-VHD -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk1.vhdx" -Dynamic -SizeBytes 500GB
  • Add shared virtual disk into both VMs.
    • Do it using PowerShell.
Add-VMHardDiskDrive -VMName contfsclu1n0 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-witness.vhdx" -ShareVirtualDisk
Add-VMHardDiskDrive -VMName contfsclu1n1 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-witness.vhdx" -ShareVirtualDisk
Add-VMHardDiskDrive -VMName contfsclu1n0 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk0.vhdx" -ShareVirtualDisk
Add-VMHardDiskDrive -VMName contfsclu1n1 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk0.vhdx" -ShareVirtualDisk
Add-VMHardDiskDrive -VMName contfsclu1n0 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk1.vhdx" -ShareVirtualDisk
Add-VMHardDiskDrive -VMName contfsclu1n1 -Path "C:\ClusterStorage\Volume1\contfsclu1\Virtual Hard Disks\shared-disk1.vhdx" -ShareVirtualDisk
  • Or in GUI.
  • If you have a Hyper-V cluster then cluster your VMs (put them as high-available).
  • Install Microsoft Windows Server 2012 R2 on all VMs.
« Previous Next »

Part of the series

  1. Implementation of the Windows Server Failover Cluster - Basic guide with all recommended steps
  2. Building guest (virtual) Failover Cluster on Hyper-V host with Windows Server 2012 R2 - Part 2 - Install and configure cluster
  3. Building guest (virtual) File Server Failover Cluster on Hyper-V host with Windows Server 2012 R2