Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
mhaug
Influencer
Posts: 11
Liked: 2 times
Joined: Mar 02, 2010 3:23 pm
Contact:

Tape Inventory Job?

Post by mhaug »

I have a 17 Tape loader with my tape set getting swapped out weekly.
I would like to have Veeam automatically inventory my media set after I swap tapes.
How do I accomplish this?
Gostev
Chief Product Officer
Posts: 31814
Liked: 7302 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Tape Inventory Job?

Post by Gostev »

Probably the best way to do this, is schedule a PowerShell script that initiates tape inventory job weekly at a certain time. Thanks!
mhaug
Influencer
Posts: 11
Liked: 2 times
Joined: Mar 02, 2010 3:23 pm
Contact:

Re: Tape Inventory Job?

Post by mhaug »

I noticed a post covering this, I will give this a try.
Hoping that this counts towards a feature request.

Thanks

Matt
mhaug
Influencer
Posts: 11
Liked: 2 times
Joined: Mar 02, 2010 3:23 pm
Contact:

Re: Tape Inventory Job?

Post by mhaug »

Just to verify, I will only have to run this script one time for EACH new set of weekly tapes, correct?
Once they have all been inventoried, the next time that set is loaded and a job kicks off, Veeam will recognize them?
Dima P.
Product Manager
Posts: 14726
Liked: 1707 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Tape Inventory Job?

Post by Dima P. »

Matt,

You perform inventory on tapes when you load them into the drive, then backup to tape is performed and all the information about this media is collected into tape catalogue which is stored inside Veeam server database. Pass some time if this media is loaded into the drive again Veeam B&R need to recognize it i.e. read meta data placed on media during backup to tape job. In order to do that you would need to run inventory job each time you load tape into tape library.

Currently we are looking in how we could improve the importing process and possibly implement auto import feature into Veeam B&R.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape Inventory Job?

Post by veremin »

Though, be aware that previously provided script was related to standalone drive inventory. In case of tape library, you should use something different:

Code: Select all

asnp VeeamPSSnapin
$Library = Get-VBRTapeLibrary -name "Name of tape library"
$Library | Start-VBRTapeInventory

Hope this helps.
Thanks.
mhaug
Influencer
Posts: 11
Liked: 2 times
Joined: Mar 02, 2010 3:23 pm
Contact:

Re: Tape Inventory Job?

Post by mhaug » 2 people like this post

I modified the script you provided and it is working perfectly.
Thank You to all who have responded, I appreciate the help.
Additionally, I am quite pleased with the file copy to tape job, it is cleaner and is perfect for replacing BackUp Exec.

Matt
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape Inventory Job?

Post by veremin »

You’re welcome. Feel free to contact us, should any additional help be needed.
Rainer Schmitt
Lurker
Posts: 1
Liked: never
Joined: Nov 18, 2013 2:53 pm

Re: Tape Inventory Job?

Post by Rainer Schmitt »

Same Problem. Thanks for solving.
Luka
Influencer
Posts: 20
Liked: never
Joined: Feb 21, 2014 12:27 pm
Contact:

Re: Tape Inventory Job?

Post by Luka »

Hi

That script worked perfectly for me for a couple of weeks and it suddenly stopped working. I am getting the error below in ps

The script:

Code: Select all

asnp VeeamPSSnapin
$Library = Get-VBRTapeLibrary -name "FSC FibreCAT TX08 2.02"
$Library | Start-VBRTapeInventory
The error I am getting

Code: Select all

Get-VBRTapeLibrary : Exception has been thrown by the target of an invocation.
At C:\Veeam Scripts\auto-tape-inventory.ps1:2 char:30
+ $Library = Get-VBRTapeLibrary <<<<  -name "FSC FibreCAT TX08 2.02"
    + CategoryInfo          : NotSpecified: (:) [Get-VBRTapeLibrary], TargetIn
   vocationException
    + FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Veea
   m.Backup.PowerShell.Command.GetVBRTapeLibrary

Start-VBRTapeInventory : Cannot validate argument on parameter 'Library'. The a
rgument is null. Supply a non-null argument and try the command again.
At C:\Veeam Scripts\auto-tape-inventory.ps1:3 char:34
+ $Library | Start-VBRTapeInventory <<<<
    + CategoryInfo          : InvalidData: (:) [Start-VBRTapeInventory], Param
   eterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.Po
   werShell.Command.StartVBRTapeInventory
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape Inventory Job?

Post by veremin »

Can you confirm that the library with the said name still exists? Also, have you performed product update recently? There was a case where something went wrong with component upgrade, and this resulted in user's inability to use previously written scripts.

Thanks.
Luka
Influencer
Posts: 20
Liked: never
Joined: Feb 21, 2014 12:27 pm
Contact:

Re: Tape Inventory Job?

Post by Luka »

Hi

Yes that library still exists under same name

This is the result I am getting after running the script

Code: Select all

Get-VBRTapeLibrary : Exception has been thrown by the target of an invocation.
At C:\Veeam Scripts\test.ps1:2 char:34
+ $Library = Get-VBRTapeLibrary <<<<  -name "FSC FibreCAT TX08 2.02"
    + CategoryInfo          : NotSpecified: (:) [Get-VBRTapeLibrary], TargetIn
   vocationException
    + FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Veea
   m.Backup.PowerShell.Command.GetVBRTapeLibrary
A few weeks ago I has some issue with the tabe library shown in the Veeam software and one of member of your team asked me to run the SQl script, Also some other scripts were run by your technical teeam member to clear the error in our SQL DBase. The issue was sorted, but wonder if that could affect the

Code: Select all

Select *
Into #Temp
From [VeeamBackup].[dbo].[Tape.devices] where name in
(SELECT name FROM [VeeamBackup].[dbo].[Tape.devices] d1 GROUP BY name HAVING COUNT(name) = 2)

Declare @id uniqueidentifier

While (Select Count(*) From #Temp where state = '1') > 0
Begin

Select top 1 @id = id From #Temp where state = 1;
update #temp
set serial_number=(select serial_number from #Temp where state = '0' and name = (SELECT name FROM #Temp where id =@id))
where state = '1' and name = (SELECT name FROM #Temp where id =@id)

Delete from [VeeamBackup].[dbo].[Tape.devices] Where state = 0 and name = (SELECT name FROM #Temp where id =@id)
Delete from #Temp Where id = @id
End
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Tape Inventory Job?

Post by veremin »

Not sure what might have gone wrong, but you can try to reinstall PS snap-in, as indicated in the referenced thread.

Otherwise, you can raise this issue with support team and let them investigate it directly.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests