Welcome!

Industrial IoT Authors: Elizabeth White, Stackify Blog, Yeshim Deniz, SmartBear Blog, Liz McMillan

Related Topics: Containers Expo Blog, Industrial IoT, Microservices Expo, Microsoft Cloud, Silverlight, @CloudExpo

Containers Expo Blog: Blog Post

Super-Fast Failover with VM Guest Clustering in Windows Server 2012 Hyper-V

Combine host and guest clustering together as a best practice for high availability

My good friend and colleague, Matt Hester, recently wrote a great article on Hyper-V Host Clustering as part of our latest article series, Become a Virtualization Expert in 20 Days! In this article, I’ll build on Matt’s cluster scenario to walk through the advantages and implementation steps for another type of clustering in a Hyper-V environment: Virtual Machine Guest Clustering.   Along the way, we’ll explore some new features in Windows Server 2012 Failover Clustering that enhance Virtual Machine Guest Clustering: Virtual Fibre Channel SANs, Anti-Affinity and Virtual Machine Monitoring.

  • Want to follow along as we step through Virtual Machine Guest Clustering? Follow these steps to build out a FREE Hyper-V Host Cluster upon which you can deploy one or more Virtual Machine Guest Clusters as we step through this article together.

    DO IT: Step-by-Step: Build a FREE Hyper-V Server 2012 Host Cluster

What is Virtual Machine Guest Clustering?
Virtual Machine Guest Clustering allows us to extend the high availability afforded to us by Windows Server 2012 Failover Clustering directly to applications running inside a set of virtual machines that are hosted on a Hyper-V Host Cluster.  This allows us to support cluster-aware applications running as virtualized workloads.

image

While the Hyper-V Host cluster can be running either Windows Server 2012 or our FREE Hyper-V Server 2012 enterprise-grade bare-metal hypervisor, Virtual Machine Guest Clustering requires a full copy of Windows Server 2012 to be running inside each clustered Virtual Machine.

Why would I use Virtual Machine Guest Clustering if I already have a Hyper-V Host Cluster?
Great question!
By clustering both between Hyper-V Hosts and within Virtual Machine Guests, you can improve your high availability scenarios by providing superfast failover during unplanned outages and improved health monitoring of the cluster services.

As Matt pointed out in his article, Hyper-V Host Clusters alone do provide a highly available virtualization fabric for hosting virtual machines, but if a host is unexpectedly down, the VM’s that were running on that host need to be restarted on a surviving host in the cluster.  In this scenario. because VMs are completely restarted on the surviving host, the failover time includes the time it takes for the operating system and applications inside each VM to startup and complete initialization.

When virtualizing cluster-aware applications inside VMs, failover times can be dramatically reduced in the event of an unplanned outage.  When using Virtual Machine Guest Clustering, cluster-aware applications can more quickly failover by moving just the active application workload without the requirement of restarting entire virtual machines.  In addition, many cluster-aware applications, such as Continuously Available File Share Clustering and SQL Server 2012 AlwaysOn, provide managed client-side failovers without any end-user interruption to the application workloads or the need to restart client applications.

Should I use Hyper-V Host Clustering and Virtual Machine Guest Clustering Together?
Absolutely!
You can use both types of clustering together to match your organization’s recovery time objectives ( RTO ) for business-critical application workloads. I generally recommend building the foundation for a resilient and scalable host server fabric by first deploying Hyper-V Host Clustering.  This provides a standard base-level of platform high availability for all virtual machines deployed to the host cluster, regardless of whether the application workloads inside each VM support clustering.  Then, for business-critical application workloads that are cluster-aware, you can enhance your availability strategy by also leveraging Virtual Machine Guest Clustering for those specific applications inside each VM.

Which Applications can I use with Virtual Machine Guest Clustering?
Lots of common applications can be leveraged with Virtual Machine Guest Clustering.  In fact, as a general rule-of-thumb, if an application supports Windows Server Failover Clustering, it will be supported as part of a Virtual Machine Guest Cluster.  Common application workloads with which I’ve seen particular value when configured as a Virtual Machine Guest Cluster include:

  • Continuously Available File Shares
  • Distributed File System Namespaces ( DFS-N )
  • DHCP Server ( although, the new DHCP Failover capability in Windows Server 2012 is an attractive alternative )
  • SQL Server 2012 AlwaysOn
  • Exchange Mailbox Servers
  • Custom Scheduled Tasks and Scripts

How should I configure Virtual Networks for my VM Guest Clusters?
Much like a physical host cluster, Virtual Machine Guest Clusters should have separate network paths for internal cluster communication vs client network communications.  At a minimum, each VM in a Guest Cluster scenario should have 2 virtual network adapters defined, with the option for a third virtual network adapter if using shared iSCSI storage ( see the next section for more information on shared storage ).


image
Separate Virtual Networks for VM Guest Clustering

All virtual networks to which a VM Guest Cluster node is attached should be consistently configured with the same name and set as “external” virtual networks in the Virtual Switch Manager within Hyper-V Manager on each Hyper-V host.  This will allow the VMs to communicate over these networks regardless of the host on which a VM is placed.

Tip: On the virtual network adapters to be used for internal cluster communications, do not configure an IP default gateway.  This will cause the cluster service to prefer this network adapter for internal cluster communications when both virtual adapters are available.

How can I present Shared Storage to Virtual Machine Guest Clusters?
Most clustered applications required shared storage that is accessible across all cluster nodes – whether those nodes are physical nodes, or in this case, virtual machines.  To expose shared storage to clustered applications within virtual machines, two common approaches can be used in Windows Server 2012:

  • iSCSI Shared Storage – Each virtual machine can leverage the built-in iSCSI Software Initiator included in Windows Server 2012 to access shared iSCSI LUNs for cluster storage needs.  This provides a very cost-effective way to present shared storage to virtual machines.

    Don’t have iSCSI Shared Storage? Did you know that Windows Server 2012 includes a highly available iSCSI Target Server role that can be used to present shared storage from a Windows Server 2012 Failover Cluster using commodity SAS disks and server hardware?  Check out the details at: Step-by-Step: Speaking iSCSI with Windows Server 2012 and Hyper-V.
  • Fibre Channel StorageNew in Windows Server 2012 is the ability to also leverage Fibre Channel storage within Virtual Machine Guest Clusters, supported by the new Virtual Fibre Channel HBA capabilities in Windows Server 2012 and our FREE Hyper-V Server 2012.

I’d like to learn more about Virtual Fibre Channel Support … How does that work?

Virtual Fibre Channel support in Windows Server 2012 leverages Fibre Channel HBAs and switches that are compatible with N_Port ID Virtualization ( NPIV ).  NPIV is leveraged by Windows Server 2012 Hyper-V and the FREE Hyper-V Server 2012 to define virtualized World Wide Node Names ( WWNNs ) and World Wide Port Names ( WWPNs ) that can be assigned to virtual Fibre Channel HBAs within the settings of each VM.  These virtualized World Wide Names can then be zoned into the storage and masked into the LUNs that should be presented to each clustered Virtual Machine.

To use Virtual Fibre Channel in Windows Server 2012 Hyper-V or the FREE Hyper-V Server 2012, you can follow these steps:

  1. Install NPIV-compatible Fibre Channel HBAs in your Hyper-V host servers and connect those HBAs to NPIV-compatible Fibre Channel Switches.
  2. Using Hyper-V Manager, click on the Virtual SAN Manager… host action to define a virtual Fibre Channel Switch on each Hyper-V host for each physical HBA. 

    image
    Virtual SAN Manager Host Action
  3. In the Virtual SAN Manager dialog box, click New Fibre Channel SAN. In the Name: field, define a name for the Virtual Fibre Channel SAN Switch.

    image
    Virtual SAN Manager dialog box

    Click the OK button to save your new Virtual SAN Switch definition.   Repeat this step for each additional physical HBA on each Hyper-V Host Server.

    NOTE: When defining the Virtual SAN Switch names on each Hyper-V Host, be sure to use consistent names across hosts to ensure that clustering will failover correctly.
  4. After defining the Virtual Fibre Channel Switches on each Hyper-V Host, add new virtual Fibre Channel Adapters in the Settings of each VM.

    image
    VM Settings – Add Virtual Fibre Channel Adapters
  5. Modify the properties of each newly added virtual Fibre Channel Adapter in the Settings of each VM to connect to the appropriate Virtual Fibre Channel Switch on the Hyper-V host.

    image
    Connect Virtual Fibre Channel HBA to Switch
  6. In the properties of the virtual Fibre Channel HBA ( shown in the figure above ), note that each virtual HBA is assigned two sets of World Wide Names noted below Address Set A and Address Set B in the dialog box.  To ensure proper failover clustering operation, it is important that both sets of addresses ( all 4 addresses ) be zoned properly in your Fibre Channel Switches and masked properly to your Fibre Channel Storage Arrays and LUNs.

    To make it easy to configure zoning and masking on your Fibre Channel SAN, click the Copy button to copy these WWNs to your clipboard for easy pasting into your Fibre Channel SAN management tools.

    Tip: Do not use Fibre Channel WWN Auto-Discovery on your SAN to attempt to discover these WWN addresses.  Doing so will only discover one set of addresses ( the set that is currently active ) and will not discover the second set of addresses assigned to each virtual HBA.

Completed! Once you’ve completed these steps for each Hyper-V Host and VM that will participate in the Virtual Machine Guest Cluster, you should now have storage that you can format and leverage as shared storage within your cluster!

How can I ensure the availability of the overall Virtual Machine Guest Cluster?
Another great question!
To ensure availability of the overall Virtual Machine Guest Cluster, consider these additional settings to help ensure that the VMs being used as part of the same VM Guest Cluster are placed on separate Hyper-V Hosts for best overall availability:

  1. Set Preferred Owners for each VM Guest Cluster member.  At your Hyper-V Host Cluster, use Failover Cluster Manager to set a different Preferred Owners order in the properties of each clustered VM.

    image
    Preferred Owners for each VM on the Host Cluster
  2. Set the same Anti-Affinity Group Name on each VM in the same VM Guest Cluster. Using PowerShell on one of your clustered hosts, configured the same Anti-Affinity Group name for each VM that is a member of the same Guest Cluster with the following commands:

    $AntiAffinityGroup = New-Object System.Collections.Specialized.StringCollection
    $AntiAffinityGroup.Add("MyVMCluster01")
    (Get-ClusterGroup "MyVMName").AntiAffinityClassNames = $AntiAffinityGroup


    Be sure to run the last command line for each VM that is a member of your VM Guest Cluster.  Setting a consistent Anti-Affinity Group Name on each VM causes the Hyper-V Host cluster to attempt to place each VM on a separate host during failover scenarios.
  3. Configure VM Monitoring for the Cluster Service inside each VM. At your Hyper-V Host Cluster, use Failover Cluster Manager to configure VM monitoring for the Cluster Service inside each VM that is a member of a VM Guest Cluster. 

    To configure VM Monitoring, right-click on each VM in Failover Cluster Manager and select More Actions –> Configure Monitoring from the pop-up menu. 

    image
    Select Services for VM Monitoring

    In the Select Services dialog box, select Cluster Service and click the OK button.

    After configuring VM Monitoring within Failover Cluster Manager, configure the Cluster Service in the Services properties inside each VM to Take No Action for second and subsequent failures of the service.

    image
    Cluster Service Properties inside each VM

    By configuring the Cluster Service for VM Monitoring using the steps above, the Hyper-V Host Cluster will proactively monitor the Cluster Service inside each VM that is a member of the VM Guest Cluster.  If the Cluster Service should fail to stop and not restart after the first attempt, the Hyper-V Host Cluster will restart and/or failover this entire VM in an attempt to ensure that the Cluster Service is running in a healthy state.

Want more? Become a Virtualization Expert in 20 Days!
This month, my fellow Technical Evangelists and I are writing a new blog article series, titled Become a Virtualization Expert in 20 Days! Each day we’ll be releasing a new article that focuses on a different area of virtualization as it relates to compute, storage and/or networking.  Be sure to catch the whole series at:

After you’re done reading the series, if you’d like to learn more and begin preparing for MCSA certification on Windows Server 2012, join our FREE Windows Server 2012 “Early Experts” online study group for IT Pros at:

Build Your Lab! Build Your Lab! Download Windows Server 2012
Build Your Lab in the Cloud! Don’t Have a Lab? Build Your Lab in the Cloud with Windows Azure Virtual Machines
Join our "Early Experts" study group! Want to Get Certified? Join our Windows Server 2012 "Early Experts" Study Group

More Stories By Keith Mayer

Keith Mayer is a Technical Evangelist at Microsoft focused on Windows Infrastructure, Data Center Virtualization, Systems Management and Private Cloud. Keith has over 17 years of experience as a technical leader of complex IT projects, in diverse roles, such as Network Engineer, IT Manager, Technical Instructor and Consultant. He has consulted and trained thousands of IT professionals worldwide on the design and implementation of enterprise technology solutions.

Keith is currently certified on several Microsoft technologies, including System Center, Hyper-V, Windows, Windows Server, SharePoint and Exchange. He also holds other industry certifications from IBM, Cisco, Citrix, HP, CheckPoint, CompTIA and Interwoven.

Keith is the author of the IT Pros ROCK! Blog on Microsoft TechNet, voted as one of the Top 50 "Must Read" IT Blogs.

Keith also manages the Windows Server 2012 "Early Experts" Challenge - a FREE online study group for IT Pros interested in studying and preparing for certification on Windows Server 2012. Join us and become the next "Early Expert"!

IoT & Smart Cities Stories
The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
All in Mobile is a place where we continually maximize their impact by fostering understanding, empathy, insights, creativity and joy. They believe that a truly useful and desirable mobile app doesn't need the brightest idea or the most advanced technology. A great product begins with understanding people. It's easy to think that customers will love your app, but can you justify it? They make sure your final app is something that users truly want and need. The only way to do this is by ...
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
DXWorldEXPO LLC announced today that Big Data Federation to Exhibit at the 22nd International CloudEXPO, colocated with DevOpsSUMMIT and DXWorldEXPO, November 12-13, 2018 in New York City. Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
The hierarchical architecture that distributes "compute" within the network specially at the edge can enable new services by harnessing emerging technologies. But Edge-Compute comes at increased cost that needs to be managed and potentially augmented by creative architecture solutions as there will always a catching-up with the capacity demands. Processing power in smartphones has enhanced YoY and there is increasingly spare compute capacity that can be potentially pooled. Uber has successfully ...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...