How to create a Failover Cluster in WIndows Server 2016 Hyper-V

 Thank to: https://www.vembu.com/

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.

Create-a-Windows-Server-2016-Hyper-V

Choose the host.

Create-a-Windows-Server-2016-Hyper-V

We simply Next past the Server Role screen to move onto the Add Features page.

Create-a-Windows-Server-2016-Hyper-V

Select the Failover Clustering feature.

Create-a-Windows-Server-2016-Hyper-V

We will be prompted to Add features that are required for Failover Clustering. This includes the Failover Clustering tools, management tools, and PowerShell module.

Create-a-Windows-Server-2016-Hyper-V

The Failover Clustering feature is now selected.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

The install should be successful.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

This begins the Validate a Configuration Wizard.

Create-a-Windows-Server-2016-Hyper-V

Next, we either browse, or enter the names of our Hyper-V hosts manually.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

We see the tests selected ready to run. Click the Next button to begin the tests.

Create-a-Windows-Server-2016-Hyper-V

The selected tests begin to run. As we see below, this includes storage failover tests, iSCSI persistent reservation, etc.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

This launches the Create Cluster Wizard.

Create-a-Windows-Server-2016-Hyper-V

Choose a Cluster Name and Address for the cluster name.

Create-a-Windows-Server-2016-Hyper-V

You can choose to Add all eligible storage to the cluster as part of the process.

Create-a-Windows-Server-2016-Hyper-V

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-a-Windows-Server-2016-Hyper-V


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.

Create-a-Windows-Server-2016-Hyper-V

The Cluster Disk is quickly changed to Cluster Shared Volume in the Assigned To colum.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

Next, we select the node we initially want to setup the virtual machine on.

Create-a-Windows-Server-2016-Hyper-V

The New Virtual Machine Wizard launches.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

Next, we select the Generation of the virtual machine. Generation 2 is generally preferred unless you have a specific use case.

Create-a-Windows-Server-2016-Hyper-V

Configure the memory including whether or not you want to use dynamic memory.

Create-a-Windows-Server-2016-Hyper-V

Select the virtual network configuration. Here we select which virtual switch we want to connect the VM to.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

We choose how we want to load the operating system.

Create-a-Windows-Server-2016-Hyper-V

Finally, we make it to the Summary screen before the virtual machine is created.

Create-a-Windows-Server-2016-Hyper-V

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.

Create-a-Windows-Server-2016-Hyper-V

A few of the entries in the View Report having to do with storage checks.

The virtual machine store path ‘C:\ClusterStorage\Volume1\config’ is on a Cluster Shared Volume.

The virtual machine checkpoint path ‘C:\ClusterStorage\Volume1\config’ is on a Cluster Shared Volume.

The virtual machine Smart Paging files path ‘C:\ClusterStorage\Volume1\config’ is on a Cluster Shared Volume.

The virtual hard disk ‘C:\ClusterStorage\Volume1\vhd\win10_01.vhdx’ is located on a Cluster Shared Volume.

Concluding Thoughts

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.

Comentarios

Entradas populares de este blog

Guía de herramientas básicas para estudiantes: 31 apps y webs imprescindibles para ayudarte con los estudios

Comando FOR para archivos BAT

How to Setup and Configure Your Own GitLab Server on Ubuntu 20.04