Taking a Fresh Look at Hyper-V Clusters (Part 7)

If you would like to read the other parts in this article series please go to:

In the previous article in this series, I spent some time talking about virtual machine prioritization. Prioritizing virtual machines goes a long way toward making sure that mission critical workloads keep running at times when the available hardware resources within the cluster are limited (such as during a failover). However, decreased availability is not the only problem posed by failover clusters.

There are a whole host of issues surrounding virtual machine placement during a failover. Suppose for instance that you operate a hosting provider and your Hyper-V deployment contains virtual machines belonging to both Coke and Pepsi, and you have a legal requirement to make sure that the Coke VMs never end up on the same host as the Pepsi VMs.

Even if you are not a service provider, VM placement can still be a major issue. Suppose for instance that you have created a guest cluster that is designed to achieve high availability for a mission critical application. Having all of the guest cluster nodes reside on a common host would undermine the benefits of building the guest cluster in the first place. Thankfully, there are some ways that you can achieve control over virtual machine placement.

It is actually possible to use PowerShell to control virtual machine placement by creating affinity and anti-affinity rules. However, it is far easier to use System Center Virtual Machine Manager. The techniques that I am about to show you work with System Center 2012 SP1 and higher, but I am going to be using System Center 2012 R2 Virtual Machine Manager.

One of the easiest things that you can do is to configure possible owners for a virtual machine. If you have virtual machines that participate in guest clusters, you could set different possible owners for each VM, as a way of ensuring that VMs remain scattered across your cluster during a failover.

To configure a virtual machine’s possible owners, the virtual machine must be clustered. Otherwise, the necessary configuration options won’t be displayed. With that said, open the Virtual Machine Manager console and select the VMs and Services workspace. Next, right click on the virtual machine that you want to configure and then select the Properties command from the resulting shortcut menu. This will cause the virtual machine’s Properties dialog box to be displayed. Select the Settings tab, which you can see in Figure A.

Image
Figure A: Select the Settings tab on the virtual machine’s Properties dialog box.

As you look at the figure above, you will notice that there are three things that can be configured on the Settings tab. The first is Quota Points. Quota Points are irrelevant to this discussion. Quota points are used when placing limits on the number of virtual machines that can be created.

The second option that you can configure is Preferred Owners. As the name implies, the Preferred Owners section allows you to pick which hosts you would prefer to host the VM. This setting is a preference, not a binding requirement. There is always a chance that a VM could end up on a non-preferred host if the preferred hosts lack the necessary resources. Even so, the Preferred Owners section allows you to rank host servers in order of preference for hosting the VM.

The other section on the dialog box is the Possible Owners section. The Possible Owners section allows you to take rigid control over which hosts are allowed to host the VM. If you deselect a checkbox within the Possible Owners section, you have effectively forbidden the corresponding host from hosting the VM.

Although it is nice to be able to configure preferred owners and possible owners for a virtual machine, configuring each VM individually might not be practical if you have a lot of VMs in your cluster. Thankfully, there is a way to perform these sorts of operations in bulk. The key is to configure availability sets.

The idea behind an availability set is that as previously explained, sometimes VMs need to reside on separate hosts. When you create an availability set, Virtual Machine Manager will attempt to place the virtual machines within the availability set on separate host servers whenever possible. As such, you would typically create a separate availability set for each guest cluster or for each set of VMs that you need to scatter across multiple hosts.

One thing to keep in mind is that availability sets work similarly to the Preferred Owners setting, except that you do not have to configure VM placement manually. Virtual Machine Manager will make a best effort attempt to keep the virtual machines within the availability set separate from one another, but there are no guarantees.

It is worth noting that availability sets can be configured at the VM level, but you can also set them up in the library. For instance, if you are building a guest cluster from a VM template, you could make the availability set part of the template so that you do not have to manually connect VMs to an availability set later on.

For right now, let’s go ahead and place a VM into an availability set. In order to do so, the VM must be clustered. Begin the process by opening the Virtual Machine Manager console and selecting the VMs and Services workspace. Right click on the virtual machine that you want to place into an availability set and choose the Properties command from the shortcut menu. When the virtual machine’s Properties dialog box appears, select the Hardware Configuration tab. Now, scroll down to the Advanced section and select the Availability option, shown in Figure B.

Image
Figure B: Select the Availability option.

Now, click on the Manage Availability Sets button shown in the figure above. When the Manage Availability Sets dialog box appears, you will have to click on the Create button since we haven’t yet created any availability sets. Now, just enter a name for the new availability set and click OK, as shown in Figure C. Your new availability set will be listed as an assigned property, as shown in Figure D. You can link other VMs to the availability set by going to the Properties dialog box for the VM, selecting Availability, clicking on the Manage Availability Sets button, and then selecting the availability set from the list of available properties.

Image
Figure C: Click the Create button and then enter a name for the new availability set.

Image
Figure D: Your newly created availability set will be listed as an assigned property for the VM.

Conclusion

In this article, I have shown you how to use various Virtual Machine Manager settings to establish affinity and anti-affinity rules for virtual machines. In Part 8, I want to conclude this series by showing you a method that you can use for bringing a non-clustered virtual machine into your failover cluster.

If you would like to read the other parts in this article series please go to:

About The Author

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top