Set the preferred site for a CSV in a site-aware stretched failover cluster

Introduction

I have presented many time over the past tears on the new and enhanced capabilities of Microsoft Failover Clustering in Windows Server 2016 (Experts Live, Cloud & Datacenter Conference Germany, MicroWarehouse’s Windows Server 2016 Launch Event etc.) Feedback has shown me that there is still a lot of need for good failover cluster design and implementation guidance.

One area of enhancement is that you now have site-aware failover clusters in Windows Server 2016. That helps optimize the, availability, behavior and performance of the workload. It leveraged cluster fault domains and in this case those fault domains are the sites where the cluster nodes reside.

clip_image002

Set the preferred site for a CSV in a site-aware stretched failover cluster

You can leverage the site awareness to do all kind of configuration optimizations. You can set a preferred site creating a primary and a DRC site. The cluster behavior will optimize for that scenario. It will also help with situation like quorum split more easily and elegantly. You can create an “Active-Active” site configuration because a cluster groups, such as virtual machines can have their own preferred site.

As you can see in the picture above there is a thing called Storage Affinity. That means that VMs follow storage and are placed in same site where their associated storage resides. As such VMs will begin live migrating to the same site as their associated CSV after 1 minute. The CSV load balancer will distribute within the preferred site. That’s cool. But when setting a preferred site at the cluster group level like for virtual machines, how does one do this for a CSV?

It’s actually quite simple. A CSV is a cluster group, just like a VM is. So, for every CSV you can set that preferred site. You just grab the cluster group a bit differently. Let’s look at an example.

For a VM you’d do this: (Get-ClusterGroup -Name DidierTest01).PreferredSite = ‘Dublin’

Now for a CSV we go about it as follows:

Get-ClusterSharedVolume “Cluster Disk 1” | Get-ClusterGroup | Fl *

clip_image004

The preferred site has not been set yet. To set the preferred site for a CSV you can do the following:

$NTFS01 = Get-ClusterSharedVolume “Cluster Disk 1” | Get-ClusterGroup $NTFS01.PreferredSite = “Dublin”
$NTFS01.PreferredSite

clip_image005

You can remove a preferred site by setting it to $Null:

$NTFS01.PreferredSite = $Null

That was not to hard was it? There is one other thing to keep in mind. Do not forget to set up your site fault domains first and set the site for your cluster nodes before you start configuring preferred sites at the cluster group level or it will throw an error. That’s the minimal setup of a site-aware cluster you need to have in place before you can do more fine-grained configurations.

New-ClusterFaultDomain –Name Dublin –Type Site –Description “Primary” –Location “Dublin DC1”
New-ClusterFaultDomain –Name Cork –Type Site –Description “Secondary” –Location “Cork DC2″
Set-ClusterFaultDomain –Name Node-A –Parent Dublin
Set-ClusterFaultDomain –Name Node-B –Parent Dublin
Set-ClusterFaultDomain –Name Node-C –Parent Cork
Set-ClusterFaultDomain –Name Node-D –Parent Cork

 

If you don’t do this and try to set preferred sites at the cluster group level you’ll get an error like:

Exception setting “PreferredSite”: “Unable to save property changes for ‘e95ad724-97d3-4848-91db-198ab8312737’.
The parameter is incorrect”
At line:1 char:1
+ $NTFS01.PreferredSite = “Dublin”
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], SetValueInvocationException
+ FullyQualifiedErrorId : ExceptionWhenSetting

 

There is a lot more to say about site-aware stretched clusters but how to deal with setting a preferred site for a CSV must be the most common question I get on this subject. Well, now it’s published to help you all out. I hope it helps.

15 thoughts on “Set the preferred site for a CSV in a site-aware stretched failover cluster

  1. $NTFS01 = Get-ClusterSharedVolume “Cluster Disk 1” | Get-ClusterGroup $NTFS01.PreferredSite = “Dublin” no working!!

    Any ideas?

    • Bar typo’s: did you define your sites and is one of them Dublin, have the cluster nodes been assigned a site and are one or more in “Dublin”?

    • Yup, afaik it has worked since W2K16 RTM (where site wareness was introduced) and any SAC release afterwards.

  2. Hi, the fail is:
    PS C:\Windows\system32> $NTFS01 = Get-ClusterSharedVolume “esb01_hyper_v_vm01.lun” | Get-ClusterGroup $NTFS01.PreferredS
    ite = “ESB” $NTFS01.PreferredSite Get-ClusterGroup : Cannot validate argument on parameter ‘Name’. The argument is null, empty, or an element of the
    argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.
    At line:1 char:79
    + … 01_hyper_v_vm01.lun” | Get-ClusterGroup $NTFS01.PreferredSite = “ESB” …
    + ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Get-ClusterGroup], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.FailoverClusters.PowerShell.GetClusterGroupCommand

    Any ideas?

    • Are you sure that’s not just line break issues/typos? That not just a on line command and as mention do make sure the fault domains have been set up and the cluster nodes are assigned to their sites.

      • does not have typographical errors

        PS C:\Windows\system32> $NTFS01

        Name OwnerNode State
        —- ——— —–
        8e218712-0d9c-48b1-9d28-4482d952a2cd STEF Online

        S C:\Windows\system32> Get-ClusterSharedVolume “esb01_hyper_v_vm01.lun” | Get-ClusterGroup | Fl *

        ntiAffinityClassNames : {}
        utoFailbackType : 0
        oldStartSetting : 0
        luster : ASTORIA
        efaultOwner : 4294967295
        escription :
        roupType : ClusterSharedVolume
        ailoverPeriod : 600000
        ailoverThreshold : 4294967295
        ailbackWindowEnd : 4294967295
        ailbackWindowStart : 4294967295
        aultDomain : 0
        sCoreGroup : False
        ame : 8e218712-0d9c-48b1-9d28-4482d952a2cd
        wnerNode : STEF
        ersistentState : 0
        referredSite : {}
        riority : 11000
        esiliencyPeriod : 0
        tate : Online
        tatusInformation : 0
        pdateDomain : 0
        d : 080a1872-71b2-48e8-8db8-43d75ddfb94c

        I have tried everything and I do not get it. Any ideas?

        thanks for helping

        • Post the PoSh you use to configure the fault domains & assign preferred sites for the nodes and the CSV(s) here, line per line.

          • Will be the windows version 2016
            He looked at other websites and there are people with the same problem.

            I’m going crazy:(

    • Hey,
      yes, you need to use the Cluster group name of the corresponding CSV.

      For your specific CSV it is:

      Name : 8e218712-0d9c-48b1-9d28-4482d952a2cd

      You can get this using the following command:
      Get-ClusterSharedVolume | Get-ClusterGroup

      It will give you the Cluster group names of your CSV-s.

      Once you have it, follow the standard way assigning preferred Sites to Groups, eg ->

      (Get-ClusterGroup -Name 8e218712-0d9c-48b1-9d28-4482d952a2cd).PreferredSite = ‘ESB’

      Verify it

      Get-ClusterSharedVolume “esb01_hyper_v_vm01.lun” | Get-ClusterGroup | Fl *

      Over and out.

  3. Has anyone tested this together with SCVMM 2016? Does dynamic optimization take site awareness into consideration?

Leave a Reply, get the discussion going, share and learn with your peers.

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