Hyper-V

Setup a Hyper-V Cluster Lab in VMware Workstation

Setup a Hyper-V Cluster Lab in VMware Workstation

Setting up a Hyper-V cluster lab in VMware Workstation is not too difficult and can easily be accomplished in a couple of hours worth of work to get things configured and ready to go.  Basically the same requirements hold true of setting up a lab environment as it would if you were setting up a physical cluster and all that would involve.

This is by no means a comprehensive list, but in general:

  • Shared Storage
  • Network Connectivity in place (Heartbeat, Storage, Live Migration, and Production traffic)
  • Failover cluster prerequisites

In my lab, I am using VMware Workstation 11 for setting up the virtual machines and shared storage so let’s take a look at getting things setup in VMware Workstation.

Network Configuration

In my lab configuration, I am using “host only” networks for the VM nics.  There are four networks that I want to setup and have available in the Hyper-V lab:

  • Production – Used for management as well as VM traffice
  • Storage – Used for shared iSCSI storage between hosts
  • Heartbeat – Used for failover cluster hearbeats
  • Live Migration – This is Hyper-V’s equivalent to VMware’s vMotion

vmnetworkconfig01

The above screen clip has more networks than the ones used for Hyper-V as I also am using VMware Workstation for an ESXi lab I have in place.  However, I will highlight how I have this configured in my lab.

vmnetworkconfig02

  • 192.168.3.0 – This is the Live Migration subnet and address range
  • 192.168.5.0 – This is the subnet and address range used for Production management and VM traffic
  • 192.168.33.0 – This is the storage subnet and address range
  • 192.168.40.0 – This is the heartbeat subnet and address range

Configuring Network on the Hyper-V hosts

The network setup on each of my Hyper-V hosts looks like the following:

hyperv_hostsnet01

Each network connection on the hosts were setup as follows:

Heartbeat, Storage, Live Migration

  • Under the DNS tab, uncheck, Register this connection’s addresses in DNS
  • Under the WINS tab, select Disable NetBIOS over TCP/IP

Production

  • Make sure Register this connection’s address in DNS is checked
  • Make sure Enable NetBIOS over TCP/IP is selected

This should get us to the point of having the servers ready connectivity wise to be able to talk between themselves for heartbeat purposes, storage, live migration, and then also the production management and VM network.

Installing the Hyper-V role

Before clustering the servers together, we want to install the Hyper-V role on each respective host.  In VMware workstation, you need to make sure that you have selected Hyper-V (unsupported) in the Version dropdown box.  You will not be able to install the Hyper-V role if you select Windows Server 2012 instead of Hyper-V.  This is the selection that enables nested virtualization for Hyper-V.

hyper-v_01_a
hyper-v_01_b

Do not select the Ethernet adapter or any that may be listed here.  This screenshot came from another run through where I had it selected.

hyper-v_02
hyper-v_03
hyper-v_04
hyper-v_05
hyper-v_06
hyper-v_07

Do the above process for each host in your cluster which gets the Hyper-V role service installed.

Setting up Storage

In my lab, I am using FreeNas as the iSCSI target and have several small VMDKs assigned to the VM for targets by ESXi as well as Hyper-V.  I kept things simple on my FreeNAS VM and simply used one network adapter which sits on the storage network that was setup in the VM network editor listed above.

For Hyper-V I created the following:

  • 40 GB LUN for VM storage
  • 5 GB LUN for VM storage just to have a secondary storage location and not take up too much space
  • 1 GB LUN for Quorum disk between the two clustered Hyper-V servers

Below are screenshots taken from the iSCSI setup on my FreeNAS VM.  You see the TargetsExtents, and Associated Targets.

freenastarget01
freenastarget02
freenastarget03

iSCSI Setup on the Hyper-V VMs

You can launch the iSCSI initiator setup on the Hyper-V boxes by running the iscsicpl.exe command.

msft_iscsi01
msft_iscsi02
msft_iscsi03
msft_iscsi04
msft_iscsi05
msft_iscsi06
msft_iscsi07

 

After you have added the disks to both nodes in the Hyper-V cluster, you need to provision the space in disk management.  You will then select to bring the disk Online, then Initialize, then create volume.  You need to do this on one node, however, the second node still needs to have the disks brought online.  The volumes should show as provisioned.

Install Failover Clustering

Install the Failover Clustering  feature on both the Hyper-V server nodes by going through the Server Manager console.  You will need to restart both boxes once this is complete.  You can go through the Validate cluster wizard either before or after the cluster is created.

hyper-vcluster01
hyper-vcluster02
hyper-vcluster03
hyper-vcluster04
hyper-vcluster05
hyper-vcluster06
hyper-vcluster07

Adding the Clustered Shared Volumes

The below screenshots are taken from the Failover Cluster Manager.  Click on your shared storage and click to Add to Cluster Shared Volumes

hyper-vcluster08
hyper-vcluster09

Final Thoughts

Once you have the above items completed, you should be able to click on the Roles underneath your cluster name and add a virtual machine.  At this point you have successfully built a Hyper-V cluster inside of VMware Workstation.

cluster02

 

 

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

One Comment

  1. Hi, I have a doubt, a vm created from Hyper-V Manager console is not visible by the Failover Cluster Manager, but the opposite instead, that a vm created from Failover Cluster Manager can be seen from Hyper-V Manager. Is there a way to import to the Cluster a vm created through Hyper-V manager?

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.