Hyper-V

Creating High Availability Hyper-V Virtual Machines

Creating High Availability Hyper-V Virtual Machines is easily accomplished using various tools. The tools used do matter as we will see

Windows Server Hyper-V provides a solid platform for organizations looking to virtualize production workloads on a Windows hypervisor platform.ย  It has certainly matured over the past few versions of the hypervisor and is getting more powerful from the standpoint of features and functionality that are available to Hyper-V administrators.ย  The primary workload that most organizations are running in virtual environments today are virtual machines.ย  While the trend is certainly leaning towards containers and other technologies, the staple for production workloads still centers around running VMs to host services and resources at least in the enterprise datacenter environment.ย  Hyper-V has a number of tools and mechanisms to provision virtual machines in a highly available fashion in a Windows Server Failover Cluster that is hosting the Hyper-V role.ย  Let’s take a look at creating high availability Hyper-V virtual machines.

Tools Used in Creating High Availability Hyper-V Virtual Machines

One of the strengths or downfalls of Hyper-V depending on your perspective with the product is the sheer number of tools available to interact with the Hyper-V hosts themselves as well as the Windows Failover Cluster running Hyper-V.ย  Sometimes this can be a point of confusion for those that are newer to the Hyper-V platform.ย  What tool or tools do you use to create virtual machines?ย  We will look at three tools in relation to how to create high availability Hyper-V virtual machines including:

Each of the above tools can play a role in creating high availability Hyper-V virtual machines.ย  However, each behaves differently and potentially have caveats.

Hyper-V Manager

When you install the Hyper-V Role, you generally install the Hyper-V Manager along with the role.ย  This is generally the tool that most think of when managing Hyper-V environments, especially getting their feet wet with the product for the first time.ย  Below, we have Hyper-V manager open with a couple of Hyper-V nodes added to the Hyper-V manager interface.ย  What you don’t know from the Hyper-V Manager is both nodes are part of a Windows Failover Cluster.ย  However, with Hyper-V Manager, you don’t get the “cluster aware” options that you get from Failover Cluster Manager.

Hyper-V-manager-Creating-High-Availability-Hyper-V-Virtual-Machine
Hyper-V manager – Creating High Availability Hyper-V Virtual Machine

Below, using the Hyper-V Manager, we have right-clicked on a particular node and chosenย New >> Virtual Machine.ย  After going through the wizard to create the virtual machine, you can see the new VM listed in Hyper-V Manager.ย  The question is this – is the virtual machine made highly available by default in Hyper-V simple because the nodes are part of a Hyper-V cluster?ย  Importantly – No!

Creating-a-new-virtual-machine-in-Hyper-V-Manager
Creating a new virtual machine in Hyper-V Manager

We need to utilize another tool to ensure the newly created Hyper-V virtual machine is highly available and is aย cluster resource.

Failover Cluster Manager

As we mentioned earlier, you don’t get access to the cluster aware configuration from Hyper-V manager.ย  For the cluster options, we need to use another tool –ย Failover Cluster Manager.ย  With Failover Cluster Manager, you are able to configure the virtual machine created with Hyper-V manager to be highly available.ย  Let’s see how.

Below, I have opened Failover Cluster Manager,ย after creating the Hyper-V virtual machine in Hyper-V Manager.ย  We do not see the newly created virtual machine.ย  Why?ย  Failover Cluster Manager only shows those virtual machines that are part of the Hyper-V cluster role, or are highly available.ย  How do you make a Hyper-V virtual machine created with Hyper-V manager highly available?ย  You have to add it to the clustered Hyper-V role.

Failover-Cluster-Manager-showing-highly-available-Hyper-V-virtual-machines
Failover Cluster Manager showing highly available Hyper-V virtual machines

Using Failover Cluster Manager, right click theย Roles container and selectย Configure Role…

Configuring-the-Hyper-V-Role-for-Highly-Available-Virtual-Machines
Configuring the Hyper-V Role for Highly Available Virtual Machines

This launches theย High Availability Wizard.

High-Availability-Wizard-Launched-from-Failover-Cluster-Manager
High Availability Wizard Launched from Failover Cluster Manager

Since we want to enable high availability on the newly created virtual machine, select theย Virtual Machine option.

Choose-the-Virtual-Machine-Role-to-enable-High-Availability
Choose the Virtual Machine Role to enable High Availability

You will see the new virtual machine listed as a potential virtual machine available for enabling high availability.

Enabling-High-Availability-on-a-particular-Hyper-V-Virtual-Machine
Enabling High Availability on a particular Hyper-V Virtual Machine

High Availability wizard asks for confirmation to enable HA on the selected virtual machine.

Confirming-the-high-availability-wizard-VM
Confirming the high availability wizard VM

The virtual machine is now added to theย clustered role.

Hyper-V-Virtual-Machine-High-Availability-is-enabled
Hyper-V Virtual Machine High Availability is enabled

Now, you see the virtual machine listed in theย Roles in the Failover Cluster Manager.

Hyper-V-Virtual-Machine-High-Availability-is-now-enabled-for-the-new-virtual-machine
Hyper-V Virtual Machine High Availability is now enabled for the new virtual machine

This simple exercise demonstrates the importance of the tool used in creating high availability Hyper-V virtual machines.ย  If you use Hyper-V Manager, you will have to also use the Failover Cluster Manager to add the high availability role to the VM.ย  However, it is important to note, if you use the Failover Cluster Manager to create the VM, the high availability wizard is part of the process, so it is much quicker and efficient to create the VMs from Failover Cluster Manager when you have a Hyper-V cluster.

Hyper-V Virtual Machine High Availability with System Center Virtual Machine Manager

System Center Virtual Machine Manager or SCVMM is much like a vCenter Server product in that it provides a centralized tool for managing cluster resources specific to virtual machine resources.ย  It is not a free product like Hyper-V Manager or Failover Cluster Manager that are built right into the Windows Server operating system.ย  SCVMM provides a powerful tool for Hyper-V Cluster environments that enables Hyper-V administrators to do things they are not able to do with other GUI tools.

Creating a high availability Hyper-V virtual machine with SCVMM is fairly straightforward, however, does have an option that is easy to miss when creating a new Hyper-V virtual machine.ย  On theย Configure Hardware screen, theย Make this virtual machine highly availableย is not checked by default.ย  Place a check in the box to enable the virtual machine to be created as a clustered role using SCVMM.

Enabling-Hyper-V-virtual-machine-high-availability-using-SCVMM
Enabling Hyper-V virtual machine high availability using SCVMM

Hyper-V Virtual Machine High Availability with PowerShell

The nice thing with Hyper-V is that it is extremely configurable using PowerShell.ย  With PowerShell you can quickly and easily create the clustered role for the virtual machine.ย  Using theย AddClusterVirtualMachineRoleย commandlet, you can easily pass the virtual machine name and add the clustered resource.

Creating-High-Availability-Hyper-V-Virtual-Machine-using-PowerShell
Creating High Availability Hyper-V Virtual Machine using PowerShell

Takeaways

Creating High Availability Hyper-V Virtual Machines can easily be accomplished with a number of tools both GUI and command line.ย  As shown, it is important to realize that simply creating a virtual machine in a Hyper-V environment does not automatically make the virtual machine highly available.ย  This is especially evident when you use the Hyper-V Manager to create a virtual machine.ย  You must use the Failover Cluster Manager or other cluster aware tool such as System Center Virtual Machine Manager as well as PowerShell to make the virtual machine highly available.ย  By doing this you will ensure that Hyper-V production workloads are protected with Windows Failover Clustering mechanisms.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.