Solved

Querying for a list of tapes in a library that are FULL

  • 24 November 2023
  • 6 comments
  • 58 views

Userlevel 4

Hello We used to use EMC Networker as a backup program, and I used to be able to run a command line script that would query for a list of tapes currently in the library, and report on any that were marked as “FULL”. I would send this an email to our tape operators, and they would eject any FULL tapes so they could be sent for offsite storage.

Is there a way I could duplicate this functionality for Veeam? Perhaps run a Powershell script that queries the library and reports on the usage status of the tapes currently in the library? (and if so, has anyone got an example they could point me at? Or a different way of getting the same info for my tape operators?)

Thanks

icon

Best answer by MikeLeone 24 November 2023, 17:59

View original

6 comments

Userlevel 7
Badge +7

Hi @MikeLeone 

I’m not even sure if that will be possible with Veeam. Currently with Veeam you have an option to eject the tape once the job has completed. 

https://helpcenter.veeam.com/docs/backup/vsphere/ejecting_tapes.html?ver=120

The other option would be to query the Veeam Database to determine the status of the tape. This might be useful:

https://forums.veeam.com/powershell-f26/get-tape-content-via-powershell-t22142-60.html

You could then eject the tape depending on the status you get back. The script is quite old, from version 9.5. I’ve not tested it so your milage may vary. 

Cheers,

Dips

Userlevel 7
Badge +7

Forgot to add, here is the PowerShell reference:

https://helpcenter.veeam.com/docs/backup/powershell/tape_devices.html?ver=120

Userlevel 7
Badge +20

Further to what Dips has posted not sure if you have ever looked at Veeam ONE but there are tape reports that you could run and schedule to show this I believe.  Then have the tapes ejected.  Another option to consider.

Userlevel 4

Hi @MikeLeone 

I’m not even sure if that will be possible with Veeam. Currently with Veeam you have an option to eject the tape once the job has completed. 

https://helpcenter.veeam.com/docs/backup/vsphere/ejecting_tapes.html?ver=120

The other option would be to query the Veeam Database to determine the status of the tape. This might be useful:

https://forums.veeam.com/powershell-f26/get-tape-content-via-powershell-t22142-60.html

You could then eject the tape depending on the status you get back. The script is quite old, from version 9.5. I’ve not tested it so your milage may vary. 

Cheers,

Dips

Thanks! From doing some quick testing, this seems to tell me the tapes currently in the library that are marked “FULL”.

$LibraryName = "QUANTUM Scalar i3-i6 305G"
Get-VBRTapeMedium -Library $LibraryName | Where {$_.IsFull -eq "TRUE"} | Select Name, LastWriteTime | Sort -Property Name

 

That should be the list that needs to be taken out, the day the script runs, if the goal is to eject tapes that are “FULL”. I wouldn’t want to automate the ejection, as someone needs to physically remove the tapes as there are only so many export slots.

Yeah, I don’t want to eject the tape when the job is done, because another job could still store data on the tape, since there is still room. Those scripts seem to be querying the SQL server directly, which - for my specific use case - is probably vastly overkill. I just want to know what to tell the operator to eject that day. :-)

 

Userlevel 7
Badge +7

Hi @MikeLeone 

I’m not even sure if that will be possible with Veeam. Currently with Veeam you have an option to eject the tape once the job has completed. 

https://helpcenter.veeam.com/docs/backup/vsphere/ejecting_tapes.html?ver=120

The other option would be to query the Veeam Database to determine the status of the tape. This might be useful:

https://forums.veeam.com/powershell-f26/get-tape-content-via-powershell-t22142-60.html

You could then eject the tape depending on the status you get back. The script is quite old, from version 9.5. I’ve not tested it so your milage may vary. 

Cheers,

Dips

Thanks! From doing some quick testing, this seems to tell me the tapes currently in the library that are marked “FULL”.

$LibraryName = "QUANTUM Scalar i3-i6 305G"
Get-VBRTapeMedium -Library $LibraryName | Where {$_.IsFull -eq "TRUE"} | Select Name, LastWriteTime | Sort -Property Name

 

That should be the list that needs to be taken out, the day the script runs, if the goal is to eject tapes that are “FULL”. I wouldn’t want to automate the ejection, as someone needs to physically remove the tapes as there are only so many export slots.

Yeah, I don’t want to eject the tape when the job is done, because another job could still store data on the tape, since there is still room. Those scripts seem to be querying the SQL server directly, which - for my specific use case - is probably vastly overkill. I just want to know what to tell the operator to eject that day. :-)

 

Got it. Initially, I thought you were going to want to automate the ejecting of the tapes :) 

Userlevel 4

UPDATE:

 

This actually *isn’t* what I need. While the above command does show tapes in a pool marked as “FULL”, it does *not* show tapes *currently in the library* that are FULL. I exported the tapes, and running the command again shows the same result. But what I *want* is to show FULL tapes that have *not* been exported yet. This command shows FULL tapes in a pool, whether they are currently physically in the library or not,

So the command needs work, probably more filtering. I will continue to work on it ...

Comment