I have a two node Windows Server 2012 R2 failover cluster with two SQL Server 2012 Enterprise AlwaysOn Availability groups configured. Within the cluster I have configured a preference order on which node a AlwaysOn Availability Group should run.
Get-ClusterGroup -Name "AlwaysOn1" | Set-ClusterOwnerNode -Owners "node1","node2"; Get-ClusterGroup -Name "AlwaysOn2" | Set-ClusterOwnerNode -Owners "node2","node1";
After configuring the preference and retrieving the preference order it is configured as it should be. When I do a failover the preference order is adjusted to first the node it currently runs on and second the other node instead of leaving the preference order as it was. It doesn't matter if I use the PowerShell "Move-ClusterGroup" or the "ALTER AVAILABILITY GROUP [AlwaysOn1] FAILOVER" T-SQL command. From the cluster log it is shown that the preference is modified after the resource has been moved.
INFO [GUM] Node 2: executing request locally, gumId:15859, my action: /rcm/gum/SetGroupPreferredOwners, # of updates: 1
INFO [RCM] rcm::RcmGum::SetGroupPreferredOwners(AlwaysOn1,<vector len='2'>
The default groups within the cluster "Available Storage" and "Cluster Group" keep their preference setting when configured (only configured for testing to verify it has to do with the SQL Server Availability Group resource type).
The Windows Server 2012 R2 servers are updated using the latest Windows Updates and SQL 2012 has build number 11.0.5556.
For other cluster groups which I have configured in the past like file, Hyper-V (used for affinity to get VM's which have a lot of traffic between them within the same virtual switch to reduce latency and additional hops. it would be nice if vNext will have a affinity option for cluster groups besides the anti-affinity within the current version)
I would like to know if someone could explain why the SQL Server Availability Group resource always modifies the group preference. I might understand this with a three node cluster where the first two are running in Synchronous commit mode and the third one in Asynchronous commit mode.
Thanks in advance,
Dennis van den Akker