PowerShell script exchange
Post Reply
carl.20150508
Influencer
Posts: 14
Liked: never
Joined: Jul 31, 2023 7:47 am
Full Name: Carl
Contact:

Get job history of catalyst replication

Post by carl.20150508 »

I tried to use Powershell Get-VBRBackupSession to get history, but It will not show the history of backup copy job (catalyst replication).

Any way to get?

Thanks.
Mildur
Product Manager
Posts: 9848
Liked: 2610 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get job history of catalyst replication

Post by Mildur » 1 person likes this post

Hi Carl

As far as I see, we don't have a PowerShell command for Catalyst sessions.
But let me ask our PowerShell Guy, if there is an unsupported way to get those sessions with PowerShell.

Best,
Fabian
Product Management Analyst @ Veeam Software
carl.20150508
Influencer
Posts: 14
Liked: never
Joined: Jul 31, 2023 7:47 am
Full Name: Carl
Contact:

Re: Get job history of catalyst replication

Post by carl.20150508 »

THANKS.

I just wonder why it dont have a command to get all the job history.
Mildur
Product Manager
Posts: 9848
Liked: 2610 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get job history of catalyst replication

Post by Mildur » 1 person likes this post

Unfortunately not every feature or object you can see in the console is currently included 100% in supported PowerShell commands. But we are working with each new release to add more and more functionality to our PowerShell integration.

Best,
Fabian
Product Management Analyst @ Veeam Software
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get job history of catalyst replication

Post by david.domask » 1 person likes this post

Hi @carl.20150508, try the following:

Code: Select all

PS C:\Users\Administrator> $sess = Get-VBRSession -Type 60
PS C:\Users\Administrator> $sess


Progress     : 0
RunManually  : False
Log          : {}
CreationTime : 7/4/2023 5:15:51 PM
EndTime      : 7/4/2023 5:19:03 PM
JobId        : 03967ae9-6f22-4161-a3b7-b538067e8ebc
Result       : Success
State        : Stopped
Id           : 46ea61e2-9c19-4ae8-ba11-7aea40fa6242



PS C:\Users\Administrator> Get-VBRBackupSession -Id $sess.id

Job Name             State      Start Time             End Time               Result
--------             -----      ----------             --------               ------
cata-copy (Active... Stopped    7/4/2023 5:15:51 PM    7/4/2023 5:19:03 PM    Success
Notice that I first get all the Catalyst Copy sessions with Get-VBRSession -Type 60; we do this first to pull the limited session data; you will want to filter based on JobID to sort the sessions by job.

I further pass the resulting Session ID from the Get-VBRSession command to Get-VBRBackupSession -Id $sess.id; this returns the normal session data you're usually looking for.

You will need to develop a function to sort/separate your sessions returned by Get-VBRSession OR you can make a function that uses Get-VBRCatalystCopyJob to get all the job IDs for your Catalyst copies; then for each JobID, do something like:

Get-VBRSession -Type 60 | Where-Object {$.JobId -eq $job.id} #assume $job contains the Job object returned by Get-VBRCatalystCopyJob.

I'm not sure what your ultimate goal/output is, but start with this and play and see what you come up with.
David Domask | Product Management: Principal Analyst
carl.20150508
Influencer
Posts: 14
Liked: never
Joined: Jul 31, 2023 7:47 am
Full Name: Carl
Contact:

Re: Get job history of catalyst replication

Post by carl.20150508 »

THanks so much.
I can get the job result now.

My goal is to get the result only to check if the catalyst replication job is success or not.
carl.20150508
Influencer
Posts: 14
Liked: never
Joined: Jul 31, 2023 7:47 am
Full Name: Carl
Contact:

Re: Get job history of catalyst replication

Post by carl.20150508 »

Sorry,

One more question, the given powershell only returns latest result. Is it possible to return all results? THanks.
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get job history of catalyst replication

Post by david.domask »

Hi @carl.20150508, you are welcome :)

For all the other subsequent sessions, change the Type for Get-VBRSession to 61; is that what you're looking for?

Catalyst Copy has a Policy:Worker relationship with the actual execution sessions; that is, there is a general policy (of sorts) running which looks for when new restore points appear on the source Catalyst Store and then starts a Worker job that is a "child" of the Policy.

StorageCopyPolicy = 60, // 0x0000003C
StorageCopyWorker = 61, // 0x0000003D

(you can also use the plaintext names as far as I'm aware for this as well)

Does that give you what you need?
David Domask | Product Management: Principal Analyst
kalaimani53
Enthusiast
Posts: 25
Liked: 1 time
Joined: Jul 14, 2020 1:43 pm
Full Name: Kalaimani
Contact:

Get-VBRBackupSession : Execution Timeout Expired.

Post by kalaimani53 »

Get-VBRBackupSession : Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Can someone help me extend the execution time or fix the issue? This problem started after the upgrade to version 12.1.
david.domask
Veeam Software
Posts: 2163
Liked: 519 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get job history of catalyst replication

Post by david.domask »

Hi @kalaimani53,

Normally this is related to SQL instance performance -- potentially you can set the registry value:

SQLStatementTimeout
DWORD
Location: HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql,
HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql,
HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication\ (before VBR 12)
Default Value: 180 (decimal)

You can try setting the value fairly high here even (1800 seems reasonable) but the main issue is just the database not returning the data before the set timeout value.

Keep in mind that Get-VBRBackupSession without any filters will return a lot of data, so you probably want to try to pass an actual session ID or filter on Name whenever possible to reduce the workload.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests