In Exchange Server 2016 Cumulative Update 2 (CU2), Microsoft is changing the behavior of database availability groups.

Starting with CU2 (which will be releasing soon), the Primary Active Manager in the DAG performs periodic discretionary moves to activate the copy that the administrator has defined as most preferred is now built into the product. A new DAG property called PreferenceMoveFrequency has been added that defines the frequency (measured in time) when the Microsoft Exchange Replication service will rebalance the database copies by performing a lossless switchover that activates the copy with an ActivationPreference of 1 (assuming the target server and database copy are healthy).

Two things spring to mind when I read that:

This really comes down to how you view database switchovers today. For some customers, a database switchover is a normal operational event that can occur any time of day or night. For change-controlled environments it’s likely to be a pre-approved change. Those customers probably already have scheduled tasks in place that rebalance the DAG on a nightly basis, perhaps right before the backups are due to start. The good news is they can get rid of those scheduled tasks now, but perhaps will modify the DAG to attempt rebalancing less frequently.

For customers that strictly control when database switchovers can occur, this new behavior requires some action. I’m talking about the type of environment where if a database fails over to another DAG member, they wait until outside of business hours to manually switch the database back to their preferred copy. Some customers even require full change management processes for this. For those customers, after upgrading to CU2 they should disable the automatic balancing (if they don’t want it to run).

[PS] C:\> Set-DatabaseAvailabilityGroup -Identity DAG01 -PreferenceMoveFrequency ([System.Threading.Timeout]::InfiniteTimeSpan)

The above command can be run after at least one DAG member has been updated to CU2, although it will only take effect once the Primary Active Manager (PAM) is running CU2, and requires that the Microsoft Exchange Replication service be restarted. So you can fit it into your maintenance window for CU2 deployment.

[adrotate banner=”49″]

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Suzy Semanco

    Hi Paul, something I’ve noticed is that the automatic failover time changes during our patch/reboot weekend. Do you know “what” determines the automatic failback time? After every reboot weekend I have to “figure out” when the databases will automatically failback to avoid having them do it while I’m putting a server into maintenance mode. I like to fail the databases manually through EAC first, then put the server into maintenance mode once all the databases are moved off of the server. I know, it seems a bit OCD but I prefer doing it this way.

    It doesn’t seem to be the Exchange servers themselves because I’ve done other changes like CU updates and the time frame doesn’t change. It only seems to change during patch/reboot weekend. It’s got to be the witness server or the domain controllers? I have eyes on when the witness server reboots but that doesn’t seem to be it either..

    It changes every month but I can’t pin down which server reboot is reseting the time that the automatic failovers happen. Do you know?

    Thanks!

    Suzy

    1. Suzy Semanco

      I’m 99.9% sure I’ve figured this out. The automatic failover/back of the databases occurs at the time of the last start of the Microsoft Exchange DAG Management service on the PAM server. If the Microsoft Exchange DAG Management service start at 10:25:45PM, then that is when databases will automatically fail back to their home servers.

      So, this gets a little crazy as I work through 4 servers applying patches. The PAM moves to another server when I put one into maintenance mode, etc.. But, once maintenance is done the PAM goes back to the preferred server and this information is useful when I do other maintenance.

      Thanks!

      Suzy

  2. itay

    Hello Paul,
    i deployed a new Exchange 2016 DAG. it contains 10 mailbox server and 30 DB’s.
    each mailbox server has 3 active DB’s and 6 copies (two passive copies for each database).
    i noticed that, wherever the PAM is on, the MICROSOFT EXCHANGE REPLICATION service is restarting every 20 seconds repetedly. that causing the active databases on the mailbox holding the PAM to be down and unknown every 20 seconds.
    i am getting a “watson report” event in the application event log.
    can you give me any direction for this issue?
    thank you,
    itay.

  3. Brandon Stevens

    Forgive the basic question as I am new to Exchange 2016. I have a DAG established. 1 of my servers went down due to Microsoft update and we were unable to strip out the bad update. We restored the server to 3 days prior
    Question:
    When we power on this server, will the DAG automatically replicate or do I need to manually reseed using power shell? Also, the value for Activation preference number, does this have any bearing on which DB is the “master copy”. One of my concerns is that the server that failed was the primary when failover occured. Does this value indicate which is primary copy?

    Thank you and I appreciate any info
    Brandon

    1. Avatar photo
  4. Harry

    Hi Paul,

    Another great post. Quick question, what is the easiest way to temporarily disable auto redistribution DAG, say, at server maintenance windows, etc. ?

    I see my DAG -PreferenceMoveFrequency is set by default for one hour.
    I see this option:

    Set-DatabaseAvailabilityGroup “dagname” -AutoDagAutoRedistributeEnabled ($True or $False)

    Will this serve the purpose? Do we need to restart Microsoft Exchange Replication service ( if it requires On PAM only or on all of DAG member servers?) as well after the switch is turn off?

    Thanks,
    Harry

  5. Jan Dye

    Is there a particular event that is written to the application log when databases are moved around? Thanks for this great feature!

  6. Kiran Ramesh

    Hello Paul,

    Correct me if I am wrong, My question is :- If I have DAC mode enabled in the environment, in-evitable the Active Manager will have the DACP bit of (0 & 1) stored in the memory. Will the PrefernceMoveFrequency value override the DAC mode settings & issue PAM in the DAG to perform periodic discretionary moves to activate the copy on the preferred server. Kindly let me know. I asked the same as a comment to Ross Smith in the article but for god known reasons it still shows me as awaiting moderation.

    Could you kindly let me know on this one please.

    Thanks
    Kiran Ramesh

Leave a Reply