In this article, we will share with you a PowerShell script that you can use to perform a Consistency Check when the replica is inconsistent in SCDPM.
Table of Contents
Introduction
System Center Data Protection Manager (SCDPM) has a built-in mechanism to auto-heal if the protected data becomes inconsistent with its replica. This feature is known as Synchronization with Consistency Check, also referred to simply as a Consistency Check (CC). As part of the synchronization process, a consistency check performs block-by-block verification to ensure that all the data on the replica is consistent with the protected data.
You may need to perform synchronization with a consistency check to repair inconsistencies between the data on the protected computer and the replica on the DPM server. DPM automatically initiates a consistency check as a daily task if you select the option to automatically perform a consistency check if the replica is inconsistent or if you have scheduled a daily consistency check for a protection group.
You can configure your protection group to allow DPM to initiate a consistency check as a daily task as shown in Figure 1 below. If you select the option to automatically perform a consistency check if the replica is inconsistent. Microsoft recommends you use this option for workloads lesser than 1TB or workloads within the same data center.
You can also schedule a daily consistency check during off-peak hours to ensure that the replica remains consistent with the protected data. A scheduled consistency check will only run if inconsistencies are detected during synchronization. Microsoft recommends you use this option for large workloads of more than 1TB or for data that is backed up over a WAN link (i.e. MPLS, IP-VPN) for branch offices.
Figure 1. Data Protection Manager – Consistency Check Options
Scenario
Sometimes a replica becomes inconsistent because of a change journal overflow or an unexpected shutdown of the protected computer or if the storage volume has been surprised removed from the DPM server, in this case, a consistency check must be performed. You can perform a one-time manual consistency check as shown in Figure 2.
Figure 2. Data Protection Manager – Perform Manual Consistency Check
When a consistency check is performed and inconsistencies between the protected volume and the replica volume are found, DPM makes the replica consistent.
However, what if you have multiple protection groups and within each protection group you have different members that are Replica Inconsistent as shown in Figure 3 :(
Figure 3. Data Protection Manager – Perform Manual Consistency Check
You can wait until DPM performs the consistency check if you have a daily consistency check scheduled as shown in Figure 1 above or go manually to each protected member and select Perform consistency check…
Automation
A better way is to use PowerShell and automate the consistency check task for all members that are in Replica’s inconsistent state.
Open Windows PowerShell as Administrator on your DPM server and run the following script:
#========================================
# Perform auto Consistency Check
# When Replica is inconsistent
#
# Author : Charbel Nemnom
# Date : 11-09-2017
# Version: 1.1
#
# Script: .\Start-DPMCC.ps1
#========================================
$DPMServername = $env:COMPUTERNAME
$ReplicaErrors = Get-DPMAlert -DPMServerName $DPMServername | Where-Object {$_.Severity -eq "Error"}
Foreach ($ReplicaError in $ReplicaErrors) {
Start-DPMDatasourceConsistencyCheck -Datasource $ReplicaError.Datasource
}
Once you run the above script, verification in progress will kick in for all failed members as shown in Figure 4.
Figure 4. Data Protection Manager – Replica inconsistent, verification in progress
Please note that this operation may require DPM to use additional CPU and disk resources. Use with Caution!
You can build upon this simple script and check the status of all replicas every morning. You can send this report via email only when DPM cannot fix its own problem, and needs manual intervention.
Hope this helps!
To learn more about System Center Data Protection Manager and Microsoft Azure Backup, I highly encourage you to check my recently published book here.
Cheers,
-Ch@rbel-