A First Look at VM Groups and VM Start Ordering in Windows Server 2016 Hyper-V #HyperV #WS2016

Introduction

Let’s take a first look at VM Groups and VM Start Ordering in Windows Server 2016 Hyper-V.

As the name implies, VM Groups are logical groupings of multiple VMs which allows you to manage multiple virtual machines much easier.

VM Start Ordering in the other hand, provides better control around starting of VMs and dependencies between clustered virtual machines. This is very important in failover clustering environment where you have multiple virtual machines which are dependent on another VMs. As an example of a complex VM start ordering scenario, is a multi-tier application and all its interdependencies on Domain Controller, SQL Server, IIS Server, Application Server, Load Balancer, etc.

VM Groups

VM Groups is a new feature introduced in Windows Server 2016 Technical Preview 4.

There are two different types of VM Groups:

  • VM collection groups
  • Management collection groups

VM collection groups is a logical collection of virtual machines. This type of group makes it possible to carry out tasks on specific VM groups, rather than having to carry them out on each individual VM separately.
Management collection groups is a logical collection of VM collection groups. With this type of group, you can nest VM collection groups as well. In other words, you can have a management collection group inside another management collection group. The main difference between VM collection groups and management collection groups is that management groups can contain both VM groups and other management groups as well.

The two main scenarios for which Microsoft developed VM groups are for backups and VM replications. In some situations, because of distributed applications, virtual machines should be treated as a single unit instead of managing them individually. This is true in both backup and VM replica situations where you want to backup or replicate a multi-tier application.

The following new PowerShell cmdlets have been added into Hyper-V module to facilitate VM Groups scripting:

At the time of writing, VM group management tools are still being developed and they are managed through Windows PowerShell only.

Let’s now look on how to create and manage VM collection groups and Management collection groups with Windows PowerShell.

VM Collection Groups

In this example, we will create a VM Collection Group and place three virtual machines in it.

VMGrouping-VMStartOrdering-02

Please note the Group Type is “VMCollectionType”. Only VM collection group can have virtual machines directly placed within them.

VMGrouping-VMStartOrdering-03

Next, we will add three VMs to VM Group called “VMCLGR01”.

VMGrouping-VMStartOrdering-14

VMGrouping-VMStartOrdering-04

You can verify the VMs that are belong to VM Group “VMCLGR01” by utilizing either Get-VM or Get-VMGroup cmdlets, respectively:

VMGrouping-VMStartOrdering-05

VMGrouping-VMStartOrdering-06

You can add one of the existing VMs to the membership of a second group as well.
Here is a quick PowerShell script that will do just that:

VMGrouping-VMStartOrdering-07

As you can see, there are now two VM groups: one group comprising of three VMs, and the second one with single VM as shown in the following figure:

VMGrouping-VMStartOrdering-15

VMGrouping-VMStartOrdering-16

VMGrouping-VMStartOrdering-08

With the two VM groups created, we can start interacting directly with WS-VM001, WS-VM002, and WS-VM003 virtual machines by utilizing “VMCLGR01” VM Group, and we can perform actions directed only at WS-VM002 by utilizing “VMCLGR02” VM Group.

In the following example, we will enable VM replication by utilizing VMCLGR01 VM Group:

VMGrouping-VMStartOrdering-09

VM Collection Groups are fairly simple. They maintain a membership of virtual machines, those VM groups contain actual VMs.

Management Collection Groups

The Management Collection Groups, on the other hand, maintain a membership of VM Collection Groups. Please note that VMs cannot directly belong to the membership of a management collection.

The group name for VM and Management collection groups might be confusing a little bit, in order to differentiate between both groups, we can refer to the collection group using the first name “VM” (membership of individual virtual machines), and “Management” (membership of VM groups).

The creation of Management collection groups is nearly identical to creating VM collection groups. The following Windows PowerShell script creates a new management group type “Management” and adds both of the existing VM groups “VMCLGR01” and “VMCLGR02” to it as shown in the following figure:

VMGrouping-VMStartOrdering-17

VMGrouping-VMStartOrdering-10

In order to see the VM groups and their members, you can run the following script:

VMGrouping-VMStartOrdering-11

As mentioned earlier, we can also nest management collection group. In other words, nesting allows you to put management group inside a management group.

This nesting capability opens an entirely new dimension in how you can organize VMs. VMs become objects that you can group much like host groups in Virtual Machine Manager.

In the following example, we will create a new management group named ParentMGTGroup and adds our first management group that we created above “MGMTGR01” to its membership as shown in the following figure:

VMGrouping-VMStartOrdering-18

VMGrouping-VMStartOrdering-12

If you want to delete the management collection group, you need to remove first the VM groups from the management collection and then delete the management group.

The following PowerShell script will allow you to do so:

VMGrouping-VMStartOrdering-13

VM Start Ordering

Virtual machine Start Order is a new feature introduced in Windows Server 2016 Technical Preview 5 Failover Clustering. VM Start Ordering opens an entirely new dimension in how you orchestrate Virtual machines (and all groups) in a cluster. Virtual machines can now be grouped into tiers, and start order dependencies can be created between different tiers. This ensures that the most important virtual machines (such as Domain Controllers or SQL servers) are started first.

As an example, most environment today do not have a single domain controller, they have multiple DCs. In this case, you probably want to group your domain controllers VMs into a Set, so it makes sense to group these domain controllers and have all the most important VMs to have dependency on VM Set for domain controllers.

Another scenario could be a Hyper-Converged deployment (where compute and storage are sharing the same underlying hardware). In this case, you probably want to make sure the most important virtual machines are started before your management or tenant VMs are started.

In order to do so, we need to define the Sets first, place virtual machines in Sets, and then specify dependencies.

VM Start Ordering Configuration

VM Start Ordering are still being developed and they are managed through Windows PowerShell only.

The following new PowerShell cmdlets have been added into Failover Clusters module to manage the group set and group set/dependencies.

At the time of writing, the cmdlets are divided into 3 groups:

Simple Scenario

Let’s start by a simple scenario, If you just want to create dependency between two virtual machines, you need to use the first set of cmdlets  (Managing Group Dependency). You need to use the Add-ClusterGroupDependency cmdlet to create dependency between VM-A and VM-B. If you are familiar with creating  dependencies between cluster resources today, this is exactly the same model.

Advanced Scenario

Let’s now look at complex scenario and see how to create and manage advanced group Set dependency with Windows PowerShell.

In the following example, we have a multi-tiered application which consists of two domain controllers, two SQL servers, two web servers and two software load balancers.

The workflow will look something like this:

VMGrouping-VMStartOrdering-19

Step 1. We start by creating the Cluster VM Set for each tier by using New-ClusterGroupSet cmdlet.

VMGrouping-VMStartOrdering-20

As you can see in above screenshot, the StartupConfig and StartupCount are set to the default properties.

Step 2. The next step, we need to assign the right properties for each VM Set by using Set-ClusterGroupSet cmdlet.

VMGrouping-VMStartOrdering-21

The StartupConfig is set to “OS_HeartBeat” property for each Set and StartupCount is set to sequence number from 1 to 4.

Step 3. We need to add virtual machines groups to the VM Set by using Add-ClusterGroupToSet cmdlet.

VMGrouping-VMStartOrdering-22

Step 4. Once you have your VM group Set all setup, the final step is to create dependency between either a single VM or between a VM Group Set by using Add-ClusterGroupSetDependency cmdlet.

If you want to create a dependency for a single VM, then you want to create another group Set that has a single VM in it.

In our example here, we don’t have a single VM, so we will set the dependencies between different VM Sets.

VMGrouping-VMStartOrdering-23

As you can see in above screenshot, the virtual machines groups “WS-SQL01, WS-SQL02 ” are dependent on DC VM Set “VMDCSET01”, the web server VMs “WS-IIS01, WS-IIS02” are dependent on SQL Servers VM Set “VMSQLSET01”, and last but not least, the software load balancer VMs “WS-SLB01, WS-SLB02” are dependent on web servers VM Set “VMIISSET01”.

Summary

This is the first look at VM Groups and VM Start Ordering, you might noticed some confusion around the PowerShell cmdlets for VM Start Ordering, I totally agree on this. The documentation is still very limited at this point in time. This is a brand new feature and still under development, I expect additional functionalities will be added in the future.

With VM Start Ordering, you have the ability to create a dependency between your special (most important) VMs, and give us the ability to orchestrate the start ordering between all virtual machines in your cluster. It’s an orchestration of all the VMs in your entire cluster and not just a few VMs you have on a single node.

As always, comments are welcome and encouraged. Is this something you would use? Do you have another scenarios where you can see VM Groups and VM Start Ordering is useful?

Thanks for reading!

Cheers,
-Ch@rbel

About Charbel Nemnom 306 Articles
Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

Be the first to comment

Leave a Reply