V8 Get-VBRTapeJob changed

PowerShell script exchange

V8 Get-VBRTapeJob changed

Veeam Logoby CeeAr » Wed Nov 26, 2014 8:10 am

Hi,

i was able to get the latest tape backup session with

Code: Select all
$Job = Get-VBRTapeJob -name blablabla
$Session = $Job.FindLastSession()


In V8 the cmdlet changed and doesn't provide "FindLastSession" anymore.

How can i get the last session of a tape backup job?

Code: Select all
Get-VBRSession
looks promising but i cannot get it to run.

Thanks.

Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Wed Nov 26, 2014 8:13 am

Hi, Chris,

Can you try something like this:

Code: Select all
$BTJ = Get-VBRTapeJob -Name "Name of your backup to tape job"
Get-VBRSession -Job $BTJ


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby CeeAr » Wed Nov 26, 2014 9:57 am

Thank you Vladimir that works!
I stuck on the next step.

V7 :
Code: Select all
$Info = $Session.GetTaskSessions()


Can you help out for V8 ? I've tried without luck:

Code: Select all
 Get-VBRTaskSession -Session $Session


Thanks again
Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Wed Nov 26, 2014 10:06 am

I think that you can get access to the tasks' log information of the latest job session, using the following code:

Code: Select all
$Session = Get-VBRSession -Job $BTJ | Sort-Object creationtime | Select-Object -Last 1
$Session.Log

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby CeeAr » Wed Nov 26, 2014 11:12 am

yes, but not for the single tasks. In V7 i was able to get more information like speed and bottleneck and check for each backup-to-disc-job that includes this backup-to-tape-job
My tape backup job copies all (5) backup to disk job to tape. I wanna get detailed information for each job and i was able to get that with V7 and powershell.

I think i'm looking for "Get-VBRTaskSession" for tape backup jobs :)

Thank you
Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Wed Nov 26, 2014 11:58 am

You can try to implement the following workaround:

Code: Select all
$BTJ = Get-VBRTapeJob -Name "Name of backup to tape job"
$BackupSession = [veeam.backup.core.cbackupsession]::GetByJob($BTJ.id)
$BackupSession | Get-VBRTaskSession


However, can you tell me what particular information (parameters, fields) is missing in $Session.Log? I mean the information that is present in TaskSession.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby CeeAr » Wed Nov 26, 2014 12:53 pm

Thanks that looks good.

Actually i'm trying to get the same information that are on the html report for each session
Image

...to integrate in an "overall" report. Is there a better way to get these results for tape jobs?


Chris
CeeAr
Influencer
 
Posts: 19
Liked: 2 times
Joined: Tue Sep 17, 2013 1:09 pm

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Wed Nov 26, 2014 1:42 pm

For now the provided workaround should do the trick. We'll think how existing behaviour can be changed in the next versions, though. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby bertdhont » Tue Dec 02, 2014 1:39 pm

Is there a workaround to use 'Get-VBRTapeJob' in Veeam Standard edition?
In v7 that worked fine. in v8 I get a message:

Get-VBRTapeJob : This functionality is available in the Enterprise (or higher) edition only.
At line:1 char:22
+ $BTJ = Get-VBRTapeJob <<<< -Name "Tape Offload - Weekly"
+ CategoryInfo : NotSpecified: (:) [Get-VBRTapeJob], LicenseException
+ FullyQualifiedErrorId : System.ComponentModel.LicenseException,Veeam.Backup.PowerShell.Cmdlets.GetVBRTapeJob

I used that to stop a session that was waiting for a tape:

Code: Select all
Add-PSSnapin VeeamPSSnapin
Get-VBRTapeJob | ? {$_.GetLastState() -like "WaitingTape"} | Stop-VBRJob


Even in Enterprise version v8, that script doesn't work, because GetLastState() doesn't return the right value...
bertdhont
Service Provider
 
Posts: 20
Liked: 3 times
Joined: Fri Nov 08, 2013 2:53 pm
Full Name: Bert D'hont

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Tue Dec 02, 2014 2:44 pm

Hi, Bert,

We've added necessary license restrictions to certain tape commandlets. According to the plane, this behaviour will be fixed in the first patch.

Speaking about .GetLastState method, you can try to use .LastState parameter, instead.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby bertdhont » Tue Dec 09, 2014 9:18 am

Is it normal behavior that in PowerShell, you cannot get a Tape Job that is only used for full backup offload?
In the tape job, we did not select the option 'Process incremental backup files'.

In Powerhshell, we get the following error:

Get-VBRTapeJob : Value cannot be null.
Parameter name: incrementalBackupMediaPool
At line:1 char:15
+ Get-VBRTapeJob <<<< -name "Daily Backup - Weekly Tape Offload"
+ CategoryInfo : NotSpecified: (:) [Get-VBRTapeJob], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,Veeam.Backup.PowerShell.Cmdlets.GetVBRTapeJob
bertdhont
Service Provider
 
Posts: 20
Liked: 3 times
Joined: Fri Nov 08, 2013 2:53 pm
Full Name: Bert D'hont

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Tue Dec 09, 2014 8:12 pm

So, the whole script looks like:

Code: Select all
Get-VBRTapeJob -name "Daily Backup - Weekly Tape Offload"


And it still fails, even though there is a job named "Daily Backup - Weekly Tape Offload", right?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby bertdhont » Wed Dec 10, 2014 7:52 am

Correct.

In the backup job, we only do an offload of the full backups:

Image
bertdhont
Service Provider
 
Posts: 20
Liked: 3 times
Joined: Fri Nov 08, 2013 2:53 pm
Full Name: Bert D'hont

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Wed Dec 10, 2014 5:39 pm

Hi, I will ask our QA or dev team to take a look at this behaviour and let you know, once I have more information. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: V8 Get-VBRTapeJob changed

Veeam Logoby v.Eremin » Thu Dec 11, 2014 10:52 pm

This confirmed to be a bug and will be fixed in the first patch. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Next

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests