I had received a weird alert for a DB volume for a DAG member being below threshold. This was odd to me due to the fact that there were four DAG members and we only received an alert for one. I went into Azure Log Analytics and ran the following query to render a graph for the past 14 days showing the percent free space of the volume for all the DAG members.
Thanks Georges Moua for the query script!
1 2 3 4 5 6 7 8 9 | let PerfCutoff = ago(14d); let inst = "C:\\ExchangeDB\\DAG1DB001\\DB"; search * | where TimeGenerated > PerfCutoff | where Name_s == "PercentFreeSpace" | where InstanceName_s contains inst | sort by TimeGenerated desc | project Resource,Company_s,InstanceName_s,PercentFreeSpace=Value_d,TimeGenerated | render timechart |
Now the reason I can run the query this way is due to the fact that the Design of the DAG was correctly done and the DB folders are identical on all DAG members. The query rendered the following chart:
I next went to an Exchange Server in the DAG and got the volume data for all the members in the DAG:
1 2 3 | $Svrs = Get-MailboxDatabaseCopyStatus DAG1DB001 | Select-Object MailboxServer | Sort-Object MailboxServer foreach ($Svr in $Svrs) { $Svr.MailboxServer ; Get-WmiObject -ComputerName $Svr.MailboxServer Win32_Volume | ? {$_.Name -like "*DAG1DB001\DB*"} | select Name,FileSystem,FreeSpace,BlockSize,Capacity | % {$_.BlockSize=(($_.FreeSpace)/($_.Capacity))*100;$_.FreeSpace=($_.FreeSpace/1GB);$_.Capacity=($_.Capacity/1GB);$_} | Sort-Object Name | Format-Table Name,@{n='Free,GB';e={'{0:N2}'-f $_.FreeSpace}},@{n='Free,%';e={'{0:N2}'-f $_.BlockSize}},@{n='Capacity,GB';e={'{0:N3}' -f $_.Capacity}},@{n='FS';e={$_.FileSystem}} -AutoSize } |
I went on EX02 and found that there was a subfolder named “Restore” that was not present on the other servers. I ran the following script to get the size of that folder in GB:
1 | Write-Host ; $Folder = "{0:N2}" -f ( ( Get-ChildItem '\\EX02\DAG1DB001\DB\Restore' -Recurse -Force | Measure-Object -Property Length -Sum ).Sum / 1GB ) ; Write-Host "Folder Size Is: $Folder GB" -ForegroundColor Green |
The folder size was 185 GB. Removing that folder, along with all subfolders/files, would balance the free space to the other DAG members. I ran the following cmdlet to remove the folder and all subfolders/files:
1 | Remove-Item '\\EX02\DAG1DB001\DB\Restore' -recurse -force |
This remediated the alert and balanced the drive space across all DAG members.
POST YOUR COMMENTS OR QUESTIONS!
HAPPY TROUBLESHOOTING!