In the previous post of creating a Window Server 2016 Hyper-V cluster, we took a look at installing the Hyper-V role, networks, as well as attaching both hosts to iSCSI targets.
Now, in the second post, we will look at installing Failover Clustering, creating our Failover cluster, creating clustered shared volumes (CSVs) and making the Hyper-V virtual machine workloads role highly available.
Let’s get started.
Installing Failover Clustering Role
Now that we have the Hyper-V role installed on both Hyper-V hosts, we need to install the Failover Cluster feature on both servers in our cluster. To do that, you simply run through the Add Roles and Features Wizard and we select the Role-based or feature-based installation.
Choose the host.
We simply Next past the Server Role screen to move onto the Add Features page.
Select the Failover Clustering feature.
We will be prompted to Add features that are required for Failover Clustering. This includes the Failover Clustering tools, management tools, and PowerShell module.
The Failover Clustering feature is now selected.
We choose to Install the Failover Clustering Feature. You can also select to Restart the destination server automatically if required. However, usually from my experience installing the feature, it doesn’t require a reboot unless there are pending operations at play.
The install should be successful.
Creating the Failover Cluster
To create the Failover Cluster, we launch the Failover Cluster Manager console. You can launch this quickly from a commandline/run menu with cluadmin.msc. Right-click the Failover Cluster Manager and select Create Cluster.
This begins the Validate a Configuration Wizard.
Next, we either browse, or enter the names of our Hyper-V hosts manually.
The Validate a Configuration Wizard will default to Run all tests which puts the Failover Cluster candidates through a battery of tests to examine Cluster configuration, Hyper-V configuration, Inventory, Network, Storage, and System configuration.
We see the tests selected ready to run. Click the Next button to begin the tests.
The selected tests begin to run. As we see below, this includes storage failover tests, iSCSI persistent reservation, etc.
Once we have the results of the testing which has to come back as either a warning or passed to continue forward, we can click the box Create the cluster now using the validated nodes. Also, we can View Report to see a detailed report of the test results in each area.
This launches the Create Cluster Wizard.
Choose a Cluster Name and Address for the cluster name.
You can choose to Add all eligible storage to the cluster as part of the process.
Cluster creation begins. As we can see since checking the “add all eligible storage to the cluster”, we see the physical disk resource for Cluster Disk 1 created.
The cluster creation time shouldn’t take too long. As we see below after the cluster is created, we have the option to View Report to look at details of the cluster creation process. Otherwise, we can hit Finish.
Create Clustered Shared Volumes
We can easily create our clustered shared volume in the Failover Cluster Manager. If we click on the Storage node underneath our cluster, we should see our Cluster Disks. One is our Quorum disk witness and the other is marked as Available Storage. If we right-click on the Available Storage, we have the option to Add to Cluster Shared Volumes.
Clustered Shared Volumes or CSV’s with Windows Server 2016 are special shared storage between nodes in a Windows Failover cluster specifically designed for Hyper-V. These make it possible for each host in a cluster to have simultaneous read-write access to the shared volume. With traditional shared storage in a standard Windows Server cluster, when cluster roles failover between hosts in the cluster, drive ownership is changed, prompting a volume dismount and mount.
This typical Windows Server Failover Cluster behavior is not desirable as we want more than one host to be the compute/memory for VMs that potentially reside on a single shared storage volume. With a clustered shared volume, the roles can fail over quickly from one to another without requiring this change in drive ownership, dismounting, remounting storage that is required with a tradition shared volume. When setting up our cluster for Hyper-V this is definitely the type of storage we want to configure.
The Cluster Disk is quickly changed to Cluster Shared Volume in the Assigned To colum.
Changing Hyper-V Storage Settings
With the clustered shared volume now configured, we can change our Hyper-V settings on each host to use our CSV as the default location for storing virtual machines. Edit the Hyper-V Settings for each host. Change the Virtual Hard Disks location and the Virtual Machines location to your cluster shared volume which is C:\ClusterStorage\volume(x) on your Hyper-V hosts.
Creating Highly Available VMs
Now that we have our storage setup and location configurations set to our clustered shared volume, let’s look at creating a highly available VM. Right-click on Roles and choose Virtual Machines >> New Virtual Machine.
Next, we select the node we initially want to setup the virtual machine on.
The New Virtual Machine Wizard launches.
We name the virtual machine and either leave our default storage location (CSV) or choose a different one. We want to take advantage of the CSV benefits, so we leave this as is.
Next, we select the Generation of the virtual machine. Generation 2 is generally preferred unless you have a specific use case.
Configure the memory including whether or not you want to use dynamic memory.
Select the virtual network configuration. Here we select which virtual switch we want to connect the VM to.
On the Virtual Hard Disk configuration, we can have the wizard create a disk for us as shown below, or we can attach a disk or create one later. A use case for creating one later is thick provisioning the disk.
We choose how we want to load the operating system.
Finally, we make it to the Summary screen before the virtual machine is created.
After hitting Finish, the High Availability Wizard will launch. It will display the results of making the virtual machine highly available. If you click View Report we will see some of the things checked for high availability, mainly dealing with storage.
A few of the entries in the View Report having to do with storage checks.
Creating a Windows Server 2016 Hyper-V cluster is fairly straight forward from installing the Hyper-V role, setting up storage, installing Failover Cluster feature, networks, and creating a highly available VM. Microsoft has made great strides with the Hyper-V platform especially with Windows Server 2016 and it has certainly closed many of the gaps with competitors since previous versions of Hyper-V. There is no doubt the platform keeps getting better and has proven it is enterprise ready. As the platform continues to mature the strong adoption of Hyper-V will no doubt continue.