You dont have javascript enabled! Please enable it!

PowerShell Script for Consistency Check When Replica is Inconsistent #DPM #SCDPM #PowerShell

3 Min. Read

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.

PowerShell Script for Consistency Check When Replica is Inconsistent #DPM #SCDPM #PowerShell 1

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.

PowerShell Script for Consistency Check When Replica is Inconsistent #DPM #SCDPM #PowerShell 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 :(

PowerShell Script for Consistency Check When Replica is Inconsistent #DPM #SCDPM #PowerShell 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.

PowerShell Script for Consistency Check When Replica is Inconsistent #DPM #SCDPM #PowerShell 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-

Photo of author
About the Author
Charbel Nemnom
Charbel Nemnom is a Senior Cloud Architect, Swiss Certified ICT Security Expert, Certified Cloud Security Professional (CCSP), Certified Information Security Manager (CISM), Microsoft Most Valuable Professional (MVP), and Microsoft Certified Trainer (MCT). He has over 20 years of broad IT experience serving on and guiding technical teams to optimize the performance of mission-critical enterprise systems with extensive practical knowledge of complex systems build, network design, business continuity, and cloud security.
Previous

How to Restore Files and Folders From Azure Linux VM using #AzureBackup #Linux #Azure @AzureBackup

Using Volume Mount Points with Modern Backup Storage in DPM 2016 #DPM #MBS #SCDPM #MABS

Next

Let me know what you think, or ask a question...

error: Alert: The content of this website is copyrighted from being plagiarized! You can copy from the 'Code Blocks' in 'Black' by selecting the Code. Thank You!