How can determine Tape Waiting jobs with Veeam 8

PowerShell script exchange

How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby hgrams » Fri Jan 09, 2015 8:54 am

Hi, at a given point in time I check the environment, if there are still running Copy-To-Tape jobs, e.g. because no tape was inserted. In Veeam 7, I do it on this way:

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


With Veeam 8, it doesn't work anymore. Neither the property "GetLastState" seems to be existing nor another property hold such information. How can I do that with Veeam 8?
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Tue Jan 13, 2015 9:18 am

Just out of curiosity - doesn't the mail notification for this situation added in first patch remove the need of using PS code? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby hgrams » Thu Jan 15, 2015 11:52 am

This is not the wanted situation. I don't need a notification. The customer should insert a tape in the evening. After that time nobody is there to react on a notification. Next day at 09a.m. should run a script to determine if any active Copy-to-tape jobs are still running. If yes, abort them.

How can I do this with Veeam 8?
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Thu Jan 15, 2015 12:03 pm

Something like this should answer your requirements:

Code: Select all
Get-VBRTapeJob | where {$_.LastState -eq "WaitingTape"}


As LastState is static parameter (not method), some sort of loop might be needed to actualize data.

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

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby hgrams » Thu Jan 15, 2015 12:25 pm

Hi Vladimir

At the moment I have 2 running jobs. The Job "Last-VBK-Files Tu - Fr" has the status "WaitingTape" in the Veeam Console.
When I check tho job via PS, then I get this:

Code: Select all
PS C:\Users\Administrator.HA-HO> $TapeJob = Get-VBRTapeJob -name "Last-VBK-Files Tu - Fr"
PS C:\Users\Administrator.HA-HO> $TapeJob


FullBackupPolicy           : Daily
IncrementalBackupPolicy    : Daily
Object                     : {D:\Copy2Tape-Links}
UseVss                     : False
EjectCurrentMedium         : False
ExportCurrentMediaSet      : False
ExportDays                 : {Sunday, Monday, Tuesday, Wednesday...}
FullBackupMediaPool        : Day
IncrementalBackupMediaPool : Day
UseHardwareCompression     : False
NextRun                    :
Target                     : Day
Type                       : FileToTape
LastResult                 : Success
LastState                  : Stopped
Id                         : 765d97c3-d7c1-4eeb-bfe1-cca34ee5edaa
Name                       : Last-VBK-Files Tu - Fr
Description                : Copy last Veeam Full-Backup-Files to tape (Tuesday to Friday)


"LastState" reports "Stopped". Where stores Veeam the status "WaitingTape", which is diplayed in Veeam console?
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Thu Jan 15, 2015 1:12 pm

Hmm, looks like a bug. I've notified dev.team about that already. For now you can use the following workaround:

Code: Select all
$Job = Get-VBRTapeJob -name "Last-VBK-Files Tu - Fr"
[Veeam.Backup.Core.CBackupJob]::GetLastState($Job.id)


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

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby hgrams » Thu Jan 15, 2015 2:42 pm

Thanks, that works :-)
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Thu Jan 15, 2015 2:53 pm

You're welcome. Feel free to reach us, if additional clarification is needed. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby bartvdw » Thu Apr 09, 2015 10:57 am

It seems this is still the case after Patch 1 , any news from Dev ?

Thanks
bartvdw
Novice
 
Posts: 3
Liked: never
Joined: Sat Feb 09, 2013 12:31 pm
Full Name: Bart Van den Wyngaert

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Thu Apr 09, 2015 12:06 pm

Patch#1 had been released before we found that bug. If everything goes as expected, it should be addressed in Update 2.

Anyway, feel free to use the provided workaround.

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

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby bartvdw » Mon Apr 13, 2015 7:18 am

Thanks for the feedback! Is there an ETA on Patch 2 ? (just asking)
bartvdw
Novice
 
Posts: 3
Liked: never
Joined: Sat Feb 09, 2013 12:31 pm
Full Name: Bart Van den Wyngaert

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Mon Apr 13, 2015 9:13 am

Yep, it's expected to be released by the end of this month.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Wed Apr 29, 2015 11:18 am

Just to let you know. Update 2 is now generally available. Both laststate and lastresult parameters should reflect correct values now. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby hgrams » Mon May 04, 2015 10:07 am

I tested it with Update 2, it works like expected :D
hgrams
Service Provider
 
Posts: 47
Liked: 5 times
Joined: Mon Jan 27, 2014 4:28 pm
Full Name: Harald Grams

Re: How can determine Tape Waiting jobs with Veeam 8

Veeam Logoby v.Eremin » Wed May 06, 2015 2:27 pm

You're right both lastresult and laststate parameters are now reflecting proper values. Thank you for confirming that; appreciated.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: Exabot [Bot] and 5 guests