Private Cloud Foundation!
“The FREE Hyper-V Server 2012 sounds AWESOME! With the same features and scalability as the Hyper-V role in the full Windows Server 2012 OS, I could really use this to virtualize my application workloads very cost effectively. But … I need high availability too!
HOW EASY IS IT TO CONFIGURE HYPER-V SERVER 2012 IN A CLUSTER?
Let’s start with a common scenario …
- Set static IP address information on each NIC
- I’d recommend at least three (3) physical NICs for each cluster host as follows:
- One NIC for cluster management and storage
- Connect to a local storage subnet and do not set a default gateway address
- Note that NIC teaming should not be used for storage networks using iSCSI. Instead, if more bandwidth and/or resiliency is needed than a single NIC can provide, consider using multiple NICs or iSCSI HBAs with MPIO configured.
- One NIC or NIC Team for live migration traffic
- Connect to a local live migration subnet and do net set a default gateway address
- One NIC or NIC Team for client network traffic to/from the VMs.
- Connect to your client network, configure default gateway and DNS info on this NIC or NIC team.
- Note: If you are interested in leveraging NIC teaming on your Hyper-V hosts to create high bandwidth resilient network connections for live migration and client network traffic interfaces, see this study guide on configuring NIC teaming from our “Early Experts” study group.
- Set a desired computer name on each host
- Join each host to an Active Directory domain
- Note that Active Directory is required for normal operation of Failover Clustering in Hyper-V Server 2012 and Windows Server 2012. However, the product team has enhanced clustering a bit so that a cluster can now be brought online in disaster recovery situations where Active Directory may not be available on the network.
- Enable Remote Management and Remote Desktop
But wait! I need Shared Storage, Don’t I?
- Fibre Channel (FC) SAN Arrays
- iSCSI SAN Arrays
- SAS JBOD Enclosures with SAS Expanders
- SMB 3.0 Shared Folders on a Windows Server 2012 file server or, preferably, by a Windows Server 2012 clustered file services role for continuous storage availability.
SAS? SMB? I don’t recognize those as shared storage options for VMs!
- SAS enclosures are supported as shared storage in a failover cluster via our new Storage Spacessubsystem in Windows Server 2012 and Hyper-V Server 2012. Along with OEM partners, we’ve demonstrated SAS solutions based on Storage Spaces that have achieved ~1 Million IOPs using commodity storage components.
- SMB 3.0 has been enhanced in Windows Server 2012 and Hyper-V Server 2012 for large amounts of random IO in big files, such as what you’d typically find with VM’s hosted in a shared folder, andcontinuous availability of shared folders when configured in a Windows Server 2012 file services cluster. In fact, when leveraging hardware that supports SMB Direct, our testing has shown that SMB storage traffic can be within 2% of the performance of direct attached storage!
It’s SMB 3.0 for ME!
- \\CAFSC01\HVCVMWitness – this clustered shared folder will be used as a witness by the new Hyper-V host cluster. A witness is a special resource that is used when a physical cluster node fails to determine which node is the “surviving” node to which clustered resources should failover. In particular, it’s important to use a witness resource when you have an even number of physical nodes within your cluster, as we do in this 2-node cluster scenario.
- \\CAFSC01\HVCVMStorage – this is a shared folder that I will use as a storage location for highly available virtual machines that I provision in the Hyper-V host cluster.
Let’s Build Our Hyper-V Host Cluster!
- Install the Failover Clustering feature on each Hyper-V Server 2012 host using the Install-WindowsFeature cmdlet:
Install-WindowsFeature –Name Failover-Clustering –IncludeManagementTools
- Configure an external virtual network switch on each Hyper-V Server 2012 host. Be sure to use exactly the same virtual switch name on each host. You can use the Get-NetAdapterName cmdlet first to verify the name of each network adapter to make sure you select the correct NIC for binding to the new virtual switch.
Now that I know the name of my network adapter, I’m going to use the New-VMSwitch cmdlet to configure a new external switch named KEMLABNET01.
New-VMSwitch “KEMLABNET01” –NetAdapterName “Ethernet 2” –AllowManagementOS:$True
- Next, let’s validate the configuration of our Hyper-V Server 2012 hosts to make sure they are compatible with a cluster configuration by using the Test-Cluster cmdlet. For my new cluster, my individual Hyper-V host computer names are KEMLABHV06 and KEMLABHV07.
Test-Cluster –Node KEMLABHV06,KEMLABHV07
The output of the Test-Cluster cmdlet will be written to:
C:\Users\[username]\AppData\Local\Temp\1\Validation Report [Date] at [Time].xml.mht
Ultimately, we want to review this report and make sure that the cluster validation tests passed on each of our hosts.
- Now that we’ve validated our host configurations, we can create our new cluster with the New-Clustercmdlet. I’m going to name my new cluster KEMLABHVC01.
New-Cluster –Name KEMLABHVC01 –Node KEMLABHV06,KEMLABHV07 –StaticAddress 192.168.249.40
The output from the New-Cluster cmdlet will be logged to:
C:\Windows\Cluster\Reports\Create Cluster Wizard [Cluster_Name] on [Date] at [Time].mht
After creating your new cluster, it’s a good idea to review this report to ensure that no unexpected errors occurred.
- After our new cluster is created, our final step is to configure our file share witness with the Set-ClusterQuorum cmdlet:
Set-ClusterQuorum –Cluster KEMLABHVC01 –NodeAndFileShareMajority \\CAFSC01\HVCWitness
That’s it! Our new Hyper-V host cluster is now built!
What’s Next? Your Turn!
- Download our FREE Hyper-V Server 2012 installation bits
- Complete the process outlined above to build out your own Hyper-V Host Cluster
In the meantime …
Are you ready to Cluster?
It’s Time to Build Highly Available VMs!
- Create new Virtual Hard Disks (VHDs or VHDXs) in a shared storage location that is accessible to your clustered configuration.
As you may recall from my Part 1 article, we’re using the new SMB 3.0 shared application folder functionality to provide a shared storage location for our highly available VM’s. To create a new virtual hard disk in this shared location, I’ll use the New-VHD cmdlet in PowerShell 3.0:
New-VHD -Path \\CAFSC01\HVCVMStorage\HAVM01.VHDX -Dynamic -Size 127GB
- Now that we have our Virtual Hard Disk(s) sitting in a shared storage location that is accessible from our clustered hosts, next we’ll use the New-VM cmdlet to provision each new Virtual Machine in the same shared storage location:
New-VM -Name HAVM01 -Path \\CAFSC01\HVCVMStorage -Memory 1GB -SwitchName "KEMLABNET01" -BootDevice CD -VHDPath \\CAFSC01\HVCVMStorage\HAVM01.VHDX
- After each new Virtual Machine is provisioned, we can use additional cmdlets, such as Set-VM, Add-VMDvdDrive and Add-VMHardDiskDrive, to set additional VM settings and/or attach additional virtualized storage devices, as necessary.
Since my new Virtual Machine in this example is using a blank Virtual Hard Disk for its storage, I’ll attach an ISO image as a DVD boot device to this VM so that I can install Windows Server 2012 when this VM starts up for the first time:
Add-VMDvdDrive -VMName HAVM01 -Path \\CAFSC01\ISO\WS2012RTM.ISO
- Since the Failover Cluster manages the startup and failover of highly available VMs, we’ll want to disable the Hyper-V Automatic Start Options for each of our VMs in this scenario. This will prevent Hyper-V from trying to directly manage the startup of these VMs and instead rely on the cluster for startup and failover tasks:
Set-VM -Name HAVM01 -AutomaticStartAction Nothing
- Our VM’s are now setup with the necessary VM configuration settings. To add our new VMs to the cluster and make them highly available, we’ll now use the Add-ClusterVirtualMachineRole cmdlet as follows:
Add-ClusterVirtualMachineRole -VirtualMachine HAVM01
- Once you’ve setup your new highly available VM’s you can check their status and bring them online with the following cmdlets:
Start-ClusterGroup –Name “HAVM01”
- Your Virtual Machines will start up and you can now connect to their consoles via the VMConnect.execommand-line tool from a remote Windows Server 2012 management server or Windows 8 admin workstation. VMConnect is included with the Hyper-V Management GUI tools.
VMConnect.exe <Hyper-V Host> <Virtual_Machine_Name>
We can use our VMConnect remote console connection to complete the installation and configuration of the Guest OS within each new virtual machine.
We’re finished … Let’s Test!
Move-ClusterVirtualMachineRole -Name "HAVM01" -Node KEMLABHV07
Now it’s Your Turn! Are you Clustered Yet?
- Join us! Be an “Early Expert” on Windows Server 2012!