Monday, November 2, 2015

First Glance on Exchange 2016 (Part 4). Storage and DAG

Hi folks,

I continue my series on my first experience with Exchange 2016. I have finally found time to write this article. Now as I have configured transport and client access protocol in my lab, the time came to configure mailbox databases and DAGs.

Autoreseed is a great feature since Exchange 2013 which allows to automatically replace failed volume and This is a great article from TechNet Blog that gives a good guidance on how to configure AutoReseed. Autoreseed is managed by 3 important attributes that can be configured on DAG:

 - AutoDagVolumesRootFolderPath is the root folder for the volumes and the default value is E:\ExchVols (in my scenario)

- AutoDagDatabasesRootFolderPath is the root path for the databases and default value is E:\ExchDB (in my scenario)

- AutoDagDatabaseCopiesPerVolume is the amount of databases per volume. I used 2 which allows me to host 2 DBs on volume which is yet another great Exchange 2013/16 feature.

As you know we need to have file share witness and file share directory to be created File Share Witness can't be member of DAG and since we have only one Exchange 2016 role now we will need to use a member server for this purpose.

When a member server is used as a file share witness the Exchange Trusted Subsystem group should be added as a member of the local admins group


I have also created directory C:\FSW\DAG001 which I will use as a witness directory.

As file share witness has been prepared, I moved to configuring of the storage on my Exchange servers.

Create  root folders for mount points collection


Within each root folders I have created folders as follows:

For volumes' mount points:
- E:\ExchVols\Vol001
- E:\ExchVols\Vol002

For Databases mount points:
-E:\ExchDB\DB001
-E:\ExchDB\DB002


After folders have been formatted both volumes with REFS and 64K as unit size (this is now supported according to Exchange 2016 PA but still not a best practice for Exchange 2013) and have mounted both DB and spare volumes to  E:\ExchVols\Vol001 and E:\ExchVols\Vol002:






After this I mounted volume which will store my mailbox databases to E:\ExchDB\DB001 and  E:\ExchDB\DB002 while I left the second volume alone:


Volume that hosts DBs has 3 mount points (one for volume mount point and another 2 for mailbox databases mount points)

Volume that corresponds to spare volume has only one:

After configuring mount points I have created folders for mailbox databases and transaction logs as follows:

-E:\ExchDB\DB001\DB001.db
-E:\ExchDB\DB001\DB001.log
-E:\ExchDB\DB002\DB002.db
-E:\ExchDB\DB001\DB002.log

These 4 folders correspond to the mailbox DBs and transaction logs that will be hosted on my 2016 box. Please note that file structure under E:\ExchDB\DB001, E:\ExchDB\DB002 and E:\ExchVols\Vol001 will be the same as both folders are used to map the same physical volume.

Each mailbox databases will be having its own point point, yet being located on the same physical drive.







As soon as the storage was ready I moved to creating and configuring DAG. I created DAG without CNO and IP address, which is yet another new Exchange 2013 SP1 and 2016 feature which is now recommended by MS. About benefits about having DAG without IP address and CNO you can read here.

Below is the command for creating DAG w/o IP address and CNO:

New-DatabaseAvailabilityGroup -Name DAG001 -DatabaseAvailabilityGroupIPAddresses ([System.Net.IPAddress]::None) -WitnessServer EX2016-FSW01 -WitnessDirectory C:\FSW\DAG001



After DAG was ready I ran the following commands to configure parameters for AutoReseed:

Set-DatabaseAvailabilityGroup DAG001 -AutoDagVolumesRootFolderPath E:\ExchVols

Set-DatabaseAvailabilityGroup DAG001 -AutoDagDatabasesRootFolderPath E:\ExchDB

Set-DatabaseAvailabilityGroup DAG001 -AutoDagDatabaseCopiesPerVolume 2


Configure Datacenter Activation Coordination mode (aka DAC anout which you can read here) for DAG :

Set-DatabaseAvailabilityGroup DAG001 -DatacenterActivationMode DagOnly


As DAG had been created I have added both of my servers into DAG by running the following command for each  of them:

Add-DatabaseAvailabilityGroupServer DAG001 -MailboxServer EX2016-EX01
Add-DatabaseAvailabilityGroupServer DAG001 -MailboxServer EX2016-EX02


After Exchange has installed all the necessary features (Failover Clustering) and added both servers to DAG we check its status by:

Get-DatabaseAvailabilityGroup DAG001 -Status

We need to ensure that both servers are listed under Member Servers and Operational Servers:

After DAG has been successfully created and configured we can create mailbox databases and add copies.

The following code helped me with easy and quick mailbox database creation:

$Server = $(Get-WmiObject Win32_Computersystem).name

New-MailboxDatabase -Name DB001 -Server $Server -EdbFilePath E:\ExchDB\DB001\DB001.db\DB001.edb -LogfolderPath E:\ExchDB\DB001\DB001.log

New-MailboxDatabase -Name DB002 -Server $Server -EdbFilePath E:\ExchDB\DB002\DB002.db\DB002.edb -LogfolderPath E:\ExchDB\DB002\DB002.log

Restart-Service MsExchangeIs

Get-MailboxDatabase Db00* |mount-Database


After we have got our mailbox databases created we can create their copies on other mailbox servers:

Add-MailboxDatabaseCopy DB001 -MailboxServer EX2016-EX001
Add-MailboxDatabaseCopy DB002 -MailboxServer EX2016-EX001


After seeding is completed we need to make sure that all mailbox databases are in good shape and have healthy and working copies though all the environment. It can be achieved by this command:

Get-MailboxDatabase |Get-MailboxDatabaseCopyStatus

Finally we need to get rid of the default mailbox databases. First we need to move arbitration and monitoring mailboxes to the highly available mailbox databases (otherwise we will be presented with the error when we attempt to delete default mailbox database. The following code helps to move them: 

Get-Mailbox -Arbitration |foreach {new-moverequest -Identity $_.Name -TargetDatabase DB001}
Get-Mailbox -Monitoring |foreach {new-moverequest -Identity $_.Name -TargetDatabase DB002}

We can monitor process of the above mailboxes move by executing the following cmdlet:

Get-MoveRequest

As soon as it's completed for all mailboxes we can remove move requests and then remove all mailbox databases by using the Remove-MailboxDatabase cmdlet.

To be continued...