Hyper-V 2012 R2 using Failover Clustering with CSV and SCVMM 2012

Service/RunAs account for VMM with local admin on hosts and AD rights for cluster object creation (details below)


1) Active Directory prep (cluster object permissions)

Failover clustering creates a Cluster Name Object (CNO) in AD.

This avoids classic “logon type” / “cannot create computer object” errors during cluster creation.

Host OS features & basic config (on every host)

Run these on each node (elevated PowerShell):

# Hyper-V, Failover Clustering, MPIO, and tools
Install-WindowsFeature Hyper-V, Failover-Clustering, Multipath-IO -IncludeManagementTools

# Optional: enable MPIO for iSCSI
mpclaim.exe -r -i -a "VEN_MSFT&PROD_iSCSI"   # adjust to your array’s Vendor/Product as needed

# (If you’ll use SMB Direct/RDMA)
Enable-NetAdapterRDMA -Name "NIC-LM","NIC-Storage"

# Create a NIC Team (LBFO) for Management/VM traffic (optional, example)
New-NetLbfoTeam -Name "Team0" -TeamMembers "NIC1","NIC2" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic

# Create a Hyper-V vSwitch on the team
New-VMSwitch -Name "vSwitch-Prod" -NetAdapterName "Team0" -AllowManagementOS $true

Network tips (2012 R2):

Connect shared storage to all hosts

iSCSI example

On each host:

# Start iSCSI service
Set-Service MSiSCSI -StartupType Automatic
Start-Service MSiSCSI

# Discover & connect targets
New-IscsiTargetPortal -TargetPortalAddress "10.10.40.10"
Get-IscsiTarget | Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $true

Format & align disks (one host only)

  1. Bring new LUNs online, initialize GPT, create volumes (NTFS for CSV on 2012 R2), no drive letters needed (Cluster will re-present as C:\ClusterStorage\...).

  2. Don’t put anything on them yet; clustering will convert to CSVFS layer.

For SMB 3.0 (Scale-Out File Server): present a continuously available SMB share from SOFS to all Hyper-V hosts; CSV step is not used in that model.

Install Hyper-V & set default paths (each host)

# Optional: set default VM paths now or let VMM control later
Set-VMHost -VirtualMachinePath "D:\VMs" -VirtualHardDiskPath "D:\VMs\VHDs"

Validate and create the Windows Failover Cluster

On one host (or any admin workstation with the tools):

# Validation (must be clean)
Test-Cluster -Node HVHOST01,HVHOST02 -Include "Inventory","Network","Storage"

# Create the cluster (without grabbing storage yet)
New-Cluster -Name "HVCLU01" -Node HVHOST01,HVHOST02 -StaticAddress 10.10.10.50 -NoStorage

# Optional: set quorum to a file share witness or disk witness
Set-ClusterQuorum -FileShareWitness "\\fileserver\witness$"

Add disks into the cluster, then convert to CSV:

# See available cluster disks
Get-ClusterAvailableDisk | Add-ClusterDisk

# Convert selected disks to CSV (repeat per disk)
Add-ClusterSharedVolume -Name "Cluster Disk 1"

You’ll see them under C:\ClusterStorage\Volume1, Volume2, etc.

Cluster networking & Live Migration settings

Mark cluster networks for their intended roles:

# List cluster networks
Get-ClusterNetwork | ft Name, Address, Role

# Example: Storage network = ClusterOnly, LM network = ClusterAndClient
(Get-ClusterNetwork "StorageNet").Role = 1           # ClusterOnly
(Get-ClusterNetwork "LiveMigrationNet").Role = 3     # ClusterAndClient

# Live Migration: prefer LM network, enable compression (2012 R2 feature)
(Get-VMHost).VirtualMachineMigrationPerformanceOption = "Compression"
Set-VMHost -VirtualMachineMigrationEnabled $true -VirtualMachineMigrationAuthenticationType CredSSP -VirtualMachineMigrationMaximum 4

# Make sure LM network metrics prefer the LM VLAN/subnet
Set-ClusterNetwork -Name "LiveMigrationNet" -Metric 100
Set-ClusterNetwork -Name "ManagementNet" -Metric 1000

Test a basic clustered VM (before VMM)

On one host:

# Quick test VM on CSV
New-VM -Name "TestVM01" -MemoryStartupBytes 2GB -Generation 2 -Path "C:\ClusterStorage\Volume1\VMs" -SwitchName "vSwitch-Prod"
New-VHD -Path "C:\ClusterStorage\Volume1\VMs\TestVM01\TestVM01.vhdx" -SizeBytes 60GB -Dynamic
Add-VMHardDiskDrive -VMName "TestVM01" -Path "C:\ClusterStorage\Volume1\VMs\TestVM01\TestVM01.vhdx"

Start-VM TestVM01
Move-ClusterVirtualMachineRole -Name "TestVM01" -Node HVHOST02   # Live migrate test

Bring in SCVMM 2012 R2 (recommended)

Install VMM 2012 R2 + latest Update Rollup, SQL instance, and VMM Library.

In VMM:

  1. Create a Run As Account (e.g., VMM-SVC) that is:

  2. Add your hosts:
    FabricServersAdd ResourcesHyper-V Hosts and Clusters ➜ Add by Windows Server Computers in a trusted AD domain ➜ choose RunAs.

  3. (Optional but strongly recommended) Model networking in VMM:

  4. Storage integration (optional):

  5. Create (or import) the cluster in VMM:

  6. Place VMs via VMM onto CSV paths under C:\ClusterStorage\….
    Use Availability Sets for anti-affinity, and set Preferred Owners/VM priority if needed.

CSV & storage best practices (2012 R2)

Patching & maintenance mode

Enable monitoring and backups

Common gotchas (and quick fixes)

Minimal “golden path” commands (copy/paste friendly)

# On each host
Install-WindowsFeature Hyper-V, Failover-Clustering, Multipath-IO -IncludeManagementTools
New-NetLbfoTeam -Name Team0 -TeamMembers NIC1,NIC2 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic
New-VMSwitch -Name vSwitch-Prod -NetAdapterName Team0 -AllowManagementOS $true

# iSCSI (each host)
Set-Service MSiSCSI -StartupType Automatic; Start-Service MSiSCSI
New-IscsiTargetPortal -TargetPortalAddress 10.10.40.10
Get-IscsiTarget | Connect-IscsiTarget -IsPersistent $true -IsMultipathEnabled $true

# Create the cluster (one time)
Test-Cluster -Node HVHOST01,HVHOST02 -Include "Inventory","Network","Storage"
New-Cluster -Name HVCLU01 -Node HVHOST01,HVHOST02 -StaticAddress 10.10.10.50 -NoStorage
Set-ClusterQuorum -FileShareWitness \\fileserver\witness$

# Add disks & convert to CSV
Get-ClusterAvailableDisk | Add-ClusterDisk
Add-ClusterSharedVolume -Name "Cluster Disk 1"

# Live Migration tuning
(Get-VMHost).VirtualMachineMigrationPerformanceOption = "Compression"
Set-VMHost -VirtualMachineMigrationEnabled $true -VirtualMachineMigrationAuthentic