PowerShell script exchange
Post Reply
f.neumann
Novice
Posts: 3
Liked: 1 time
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Neumann
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: 17745
Liked: 1615 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
Novice
Posts: 3
Liked: 1 time
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Neumann
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: 406
Liked: 130 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
Novice
Posts: 3
Liked: 1 time
Joined: Jun 24, 2020 11:01 am
Full Name: Florian Neumann
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: 406
Liked: 130 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!

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests