PowerShell script exchange
Post Reply
f.neumann
Service Provider
Posts: 25
Liked: 8 times
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Finder
Contact:

ImmediateCopyMode no session details

Post by f.neumann »

Hello,

we're using Veeam PowerShell SnapIn for monitoring single Backup- and BackupCopyJobs in multiple customer-environments.

In V10 there is the new CopyJob mode "Immediate Copy". But there's no full PowerShell Support for this job-type by now.
Is there any workaround? When will there be an full implementation of this copymode? To use this feature we really depend on being able to monitor the results.

We already opened a ticket (case #04185968) but there seems to be no real workaround or ETA?

Code: Select all

$objVeeamBackupCopySimplemodejob = [Veeam.Backup.Core.CBackupJob]::GetAll() | ? {$_.Name -match 'VMware-BackupCopyImmediate'}
$objVeeamBackupCopySimplemodesession = [Veeam.Backup.Core.CBackupSession]::GetByJob($objVeeamBackupCopySimplemodejob.id)
$objVeeamBackupCopySimplemodesession.SessionInfo.Progress

TotalObjects             : 0
ProcessedObjects         : 0
ProcessedSize            : 0
ProcessedUsedSize        : 0
ReadSize                 : 0
ReadedAverageSize        : 0
TransferedSize           : 0
ProcessedDelta           : 0
ProcessedUsedDelta       : 0
ReadDelta                : 0
ReadedAverageDelta       : 0
TransferedDelta          : 0
StartTimeLocal           : 19.05.2020 12:05:14
StopTimeLocal            : 01.01.1900 00:00:00
StartTimeUtc             : 19.05.2020 10:05:14
StopTimeUtc              : 01.01.1900 00:00:00
Percents                 : 0
AvgSpeed                 : 0
BottleneckInfo           : Veeam.Backup.Model.CBottleneckInfo
TotalSize                : 0
TotalUsedSize            : 0
UsedSpaceRation          : 1
TotalSizeDelta           : 0
TotalUsedSizeDelta       : 0
Duration                 : 35.22:29:04.8481271
Updates                  : Veeam.Backup.Model.CBackupProgressUpdates
IsNeedSubstractReadDelay : False
When to expect an update/solution?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: ImmediateCopyMode no session details

Post by veremin »

Hi, Florian,

Welcome to our community forums. Can you tell us what exact details you're trying to get for immediate backup copy job session? Chances are, there is a different way to get it.

Thanks!
f.neumann
Service Provider
Posts: 25
Liked: 8 times
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Finder
Contact:

Re: ImmediateCopyMode no session details

Post by f.neumann »

Hi @veremin,

thanks for your welcome.

We're trying to get details about:
- Basic Job Information using "Get-VBRJob": Id, Name, TypeToString, IsBackupCopySimpleMode, ScheduleOptions
-- Last Session Details using "Get-VBRBackupSession": State, Result, CreationTime, EndTime, IsRetryMode
---- specific warnings/errors within that Session using "Logger.GetLog().updatedrecords"
-- Details about processed Objects within that JobSession using "Get-VBRTaskSession": Name, Status
---- specific warnings/errors within that TaskSession using "Logger.GetLog().updatedrecords"

So we can get everything using these cmdlets for VMware Backup Jobs, Hyper V Backup Jobs, Windows Agent Backup Jobs, Periodic Backup Copy Jobs, Tape Jobs. - totally fine for every job-type, except immediate copy.
For Immediate Backup Copy Jobs you can only get overall Job Result using "[Veeam.Backup.Core.CBackupSession]::GetByJob($strVeeamBackupJobId)". There are no details about progress, processed objects, total objects in this job, ...
Even if the real copy session successfully processed multiple objects ".SessionInfo.Progress" returns "0" for every Property (TotalObjects, ProcessedObjects, ProcessedSize, StopTimeUtc,... see output in my first post).

So when you are able to query details on immediate copy job sessions using "[Veeam.Backup.Core.CBackupSession]::GetByJob($strVeeamBackupJobId)", it should provide correct/full information or no information at all. If every value is "0" that's not quite helpful.

What du you think? Is there another way? - or will this be added/fixed in near future?

Thanks in advance!
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: ImmediateCopyMode no session details

Post by oleg.feoktistov » 2 people like this post

Hi Florian,

Check out this thread for the explanation on this behaviour.
The case here is that Get-VBRBackupSession doesn't parse worker job sessions for immediate backup copy at all and the method below retrieves only parent sessions by default:

Code: Select all

[Veeam.Backup.Core.CBackupSession]::GetByJob($strVeeamBackupJobId)
But we are planning to fix it in one of our next product releases.
For now, here is the workaround:

Code: Select all

#get jobs for immediate backup copy
$job = Get-VBRJob | where {$_.JobType -eq ‘SimpleBackupCopyPolicy’}

#get child worker jobs
$workers = $job.GetWorkerJobs()

#get session details for each worker job
foreach ($worker in $workers) {
[Veeam.Backup.Core.CBackupSession]::GetByJob($worker.id)
}
Thanks,
Oleg
f.neumann
Service Provider
Posts: 25
Liked: 8 times
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Finder
Contact:

Re: ImmediateCopyMode no session details

Post by f.neumann » 1 person likes this post

Hi Oleg,

thank you very much!

Using the workaround "GetWorkerJobs()" i can collect all/most session information we need. - Great!

We'll keep trying "Get-VBRBackupSession" after every future product release to simplify our scripts.

Thanks for your support! - A much better answer/workaround as provided by support-team!
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: ImmediateCopyMode no session details

Post by oleg.feoktistov » 1 person likes this post

It's always my pleasure!
Tijz
Service Provider
Posts: 34
Liked: 4 times
Joined: Jan 20, 2012 10:03 am
Full Name: Mattijs Duivenvoorden
Contact:

Get status of new copy job type "immediate copy"

Post by Tijz »

Hi All,

We use custom script to to report on Backup Job status within Solarwinds N-Able.

Within this script we enumerate all vbrbackupsessions using get-vbrbackupsession an report on the status of each job's session.
We recently added some Copy Jobs using the new type "immediate copy (mirror)" and it turns out those jobs aren't queryable by using get-vbrbackupsession.

Any idea on how to get the 'last state' of such copy job type?

Thanks for any help!

Tijs
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: ImmediateCopyMode no session details

Post by oleg.feoktistov »

Hi,

Please, check the explanation above.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests