Press "Enter" to skip to content

Selecting Zerto Checkpoints in PowerShell

Joshua Stenhouse 0

When using Zerto PowerShell cmdlets it can be required to select a checkpoint (a point in time) in the journal of changes from which to perform an operation. The Zerto PowerShell cmdlets which require a checkpoint to be defined are:

Start-failovertest
Clone-vpg

A checkpoint is also required for the POST APIs “Performing a Failover of a Specified VPG” and “Test a VPG for Failing Over”. To select a checkpoint the following cmdlet is used:

get-checkpoints -virtualprotectiongroup WebApp1 -zvmip 192.168.0.116 -zvmport 9080 -username root -password Zerto123 -confirm:$false

Below is an example output from running this cmdlet:

image

To explain this output we have Identifier which is simply an internal ID number. Timestamp being the exact timestamp consistent across all the VMs in the Virtual Protection Group (VPG) that you can select to use. The Tag is free text which can be inserted by a manual or scheduled checkpoint. Any checkpoints without a tag are automatically generated by Zerto every few seconds showing crash consistent points in time. VSS indicates if the checkpoint is application consistent using the Zerto VSS agent.

We now need to select a checkpoint as a variable for use with other Zerto cmdlets. There are 3 main ways of selecting the required checkpoint:

Latest Point in Time

$cp_list = get-checkpoints -virtualprotectiongroup WebApp1 -zvmip 192.168.0.116 -zvmport 9080 -username root -password Zerto123 -confirm:$false

$last_cp = $cp_list[$cp_list.Count-1]

$latesttimeobject = $last_cp | select-object timestamp | select -expandproperty timestamp

$latesttimeobject

Latest VSS Point in Time

$cp_list = get-checkpoints -virtualprotectiongroup WebApp1 -zvmip 192.168.0.116 -zvmport 9080 -username root -password Zerto123 -confirm:$false

$lastvss_cp = $cp_list | where-object {$_.Vss -eq "True"}

$latesttimeobject = $lastvss_cp | select-object timestamp | select -expandproperty timestamp

$latesttimeobject

Point in Time by Checkpoint Tag

$cp_list = get-checkpoints -virtualprotectiongroup WebApp1 -zvmip 192.168.0.116 -zvmport 9080 -username root -password Zerto123 -confirm:$false

$lastcp = $cp_list | where-object {$_.Tag -eq "Tag Name Here"}

$latesttimeobject = $lastcp | select-object timestamp | select -expandproperty timestamp

$latesttimeobject

Now that we have selected a Checkpoint, using the $latesttimeobject variable, we can start to look at what we can do with it. I will cover my favourite use cases for this over the next few posts. One idea I’ve had is to use this to report to alert on any VPGs that don’t have a VSS (or tagged) checkpoint in their journal then send an email. This could be a handy notification to receive on a daily basis. If anybody is interested in this let me know and it will be built! Happy scripting,

Joshua

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Virtually Sober

Subscribe now to keep reading and get access to the full archive.

Continue reading