PowerShell script exchange
Post Reply
TimLawhead
Novice
Posts: 5
Liked: never
Joined: Mar 05, 2019 3:29 pm
Full Name: Tim Lawhead
Contact:

Report for Changing Tapes - Library to Vault

Post by TimLawhead » Sep 06, 2019 3:42 pm

Hello All,

I was unable to find any report or method to easily create something that would make changing tapes from the vault to the tape library an easier task.

I have a 24 tape Auto-loader library. I am looking to generate a report that would show the oldest 24 tapes in a specified pool/vault, preferably expired, and sorted by age and then barcode, and then show the current tapes in the library with their pool and capacity information.

If I could print off a quick one page that lets me quickly determine how many tapes I'm changing out of a library and then go to the vault and get the oldest expired tapes from the pool, and then be able to identify the tapes that aren't getting changed out, it'd save some time rather than having to hand write/type up a list to take with me.

Like so:
Expired Free Pool Current Library Capacity Pool
1: 0001111L6 1: CLNU101L0 ? None
2: 0001112L6 2: 0001101L6 0 Standard Media Pool
...
24: 0001124L6 24: MA2345L6 0 GFS Media Pool

TIA
Tim

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

Re: Report for Changing Tapes - Library to Vault

Post by veremin » Sep 11, 2019 5:27 pm 1 person likes this post

Not sure whether I got your question, but from what I could understand:

- You need to query a vault: Get-VBRTapeVault
- Get tapes stored in it: $Vault.Medium
- Get tapes that are expired, using IsExpired property as a filter
- Sort them based on the ExpirationDate property
- Get tapes stored in the library
- etc.

Thanks!

TimLawhead
Novice
Posts: 5
Liked: never
Joined: Mar 05, 2019 3:29 pm
Full Name: Tim Lawhead
Contact:

Re: Report for Changing Tapes - Library to Vault

Post by TimLawhead » Sep 13, 2019 12:29 pm

How do you get a list of the tapes and what slots they are in of a tape library?

Pretty sure I'm missing something.

I can see the Medium using Get-VBRTapeMedium but I'm not seeing how to get what slot they are in the library.
I can see the Tape Library using Get-VBRTapeLibrary but I'm not seeing how to list out what is in its slots.

jhoughes
Veeam Software
Posts: 107
Liked: 26 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Report for Changing Tapes - Library to Vault

Post by jhoughes » Sep 13, 2019 12:35 pm 1 person likes this post

Use it as the input for the library parameter in the Get-VBRTapeMedium cmdlet, the tape medium should have those properties listed out (as far as I can remember - I don't have a tape library in my lab currently to confirm).
Husband, Father, Solutions Architect, Geek Extraordinaire | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

TimLawhead
Novice
Posts: 5
Liked: never
Joined: Mar 05, 2019 3:29 pm
Full Name: Tim Lawhead
Contact:

Re: Report for Changing Tapes - Library to Vault

Post by TimLawhead » Sep 16, 2019 12:51 pm

Made some headway using Select -ExpandProperty Location
Get-VBRTapeMedium -Library "LibraryName" | select barcode,location -ExpandProperty location | FT -AutoSize

This returned:
Barcode Location DriveId DriveAddress LibraryId SlotAddress VaultId Type

SlotAddress is what I needed. A search for that comes up with another forum post that helps:
powershell-f26/v8-tape-media-locations-t28031.html

From that I've got an initial pull from the Library that will give me the data I need to work with to determine what tapes need to be pulled:
Get-VBRTapeMedium -Library "LIBRARY-NAME-HERE"| Where-Object {$_.Location -like "Slot"} | Sort-Object {$_.Location.SlotAddress} | Select-Object -Property @{N="SlotNo";E={$_.Location.SlotAddress +1}}, @{N="Barcode";E={$_.Barcode}},Free,IsExpired,MediaSet | FT -AutoSize

Now to work out the rest.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 11 guests