Library slot management

Everything about backing up to tape

Library slot management

Veeam Logoby timmi2704 » Mon Apr 20, 2015 9:34 am

Hi forum,
do you know of any possibiltiy to see the amount of free tape slots available in a library only by using Veeam functions given either in Veeam Backup Shell or in PowerShell?
Before importing tapes, I always need to have a look onto the tape libraries web interface whether all tapes will fit.
Thanks :)
timmi2704
Enthusiast
 
Posts: 83
Liked: 3 times
Joined: Tue Jan 14, 2014 10:41 am
Full Name: Timo

Re: Library slot management

Veeam Logoby Dima P. » Mon Apr 20, 2015 4:19 pm

Hello Timo,
I am not an expert, but, I believe, you can run a tape inventory via PS to check the loaded media: Start-VBRTapeInventory
Dima P.
Veeam Software
 
Posts: 6263
Liked: 442 times
Joined: Mon Feb 04, 2013 2:07 pm
Location: SPb
Full Name: Dmitry Popov

Re: Library slot management

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

In the way I see it, it might be worth taking information regarding library free slots' directly from library, using vendor specific commandlets (if available). Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Library slot management

Veeam Logoby timmi2704 » Wed Apr 22, 2015 7:14 am

Hi,
thanks Dmitry and Vladimir.
As far as I can see, getting the information through Veeam is not possible.
Using vendor commandlets will be the only option. Unfortunately it seems as if there aren't any cmdlets available.
May I ask for such a feature as a feature request?
Having an overview of all tape slots either occupied or emtpy would be nice to have.

Thanks :-)
timmi2704
Enthusiast
 
Posts: 83
Liked: 3 times
Joined: Tue Jan 14, 2014 10:41 am
Full Name: Timo

Re: Library slot management

Veeam Logoby v.Eremin » Wed Apr 22, 2015 9:07 am

Ok, your request has been heard. Just out of curiosity - what tape device are you using?
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Library slot management

Veeam Logoby timmi2704 » Wed Apr 22, 2015 9:10 am

Thanks. I am using Quantum Scalar tape libraries with HP drives.
timmi2704
Enthusiast
 
Posts: 83
Liked: 3 times
Joined: Tue Jan 14, 2014 10:41 am
Full Name: Timo

Re: Library slot management

Veeam Logoby v.Eremin » Wed Apr 22, 2015 9:52 am

Can't find any information regarding automation tools for the said device. However, I believe you can get number of free slots in unobvious way, using VB&R PS snap-in. Query library to get number of slots it has, then, receive list of mediums that occupy slots inside given library, after that, subtract the second number from the first one. The resulting value should be the number you're looking for.

If you struggle with scripting, kindly, create separate topic on corresponding subforum (PowerShell), and I will try to assist you with that.

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

Re: Library slot management

Veeam Logoby timmi2704 » Tue Apr 28, 2015 10:31 am 1 person likes this post

Sometimes you miss the wood for the trees... :roll:
Thanks Vladimir.

In case anyone is interested, feel free to use my small PowerShell script:
Code: Select all
###########################################################################
#
# NAME: Get-VBRFreeTapeSlots
#
# AUTHOR:  timmi2704
#
# COMMENT: This PS-Script will give you the free tape slots of all libraries installed in Veeam console
#
# VERSION HISTORY:
# 1.0 28.04.2015 - Initial release
#
###########################################################################

cls

#Adding Veeam PowerShell Snapin
if ((Get-PSSnapin "VeeamPssnapin" -ErrorAction SilentlyContinue) -eq $null)
{
   Write-Host "Adding Veeam PS Snapin..." -Foregroundcolor White
    Add-PSSnapin "Veeampssnapin"
   Write-Host "Completed!" -Foregroundcolor White
   Write-Host ""
}
else
{
   Write-Host "Veeam PS Snapin already added." -Foregroundcolor White
   Write-Host ""
}

#Function for getting occupied tape librarie slots (including tapes in drives)
function Get-VBRAvailableTapes($TL) {
   return Get-VBRTapeMedium -Library $TL | Where-Object { $_.Location -like 'Slot' -OR $_.Location -like 'Drive' }
}

#Getting installed tape libraries
Write-Host -ForegroundColor yellow "Getting installed tape libraries..."
$TapeLibraries = Get-VBRTapeLibrary
$TapeLibraries | Foreach-Object { Write-Host $_ }
If ($TapeLibraries -eq $null) {
   Write-Host -ForegroundColor Red "No libraries found!"
   pause
   exit
}
Write-Host ""

#Listing online media
foreach ($TapeLibrary in $TapeLibraries) {
   Write-Host -ForegroundColor Yellow -NoNewline "Listing online media for" $TapeLibrary.Name
   Get-VBRAvailableTapes($TapeLibrary) | Sort-Object -property Barcode |ft -Property Barcode, Location, ExpirationDate -AutoSize
}

#Calculating free slots per librarie
foreach ($TapeLibrary in $TapeLibraries) {
   $AvailableTapes = Get-VBRAvailableTapes($TapeLibrary)
   $FreeSlots = ($TapeLibrary.Slots - $AvailableTapes.count)
   Write-Host -ForegroundColor Yellow -NoNewline "Free slots in" $TapeLibrary.Name": "
   Write-Host -ForegroundColor White $FreeSlots
}

function pause {
   Write-Host "Please press RETURN to continue..."
   $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}

pause
timmi2704
Enthusiast
 
Posts: 83
Liked: 3 times
Joined: Tue Jan 14, 2014 10:41 am
Full Name: Timo

Re: Library slot management

Veeam Logoby v.Eremin » Tue Apr 28, 2015 12:28 pm

Nice script, indeed. Thank you for sharing.

Glad to hear that my input was helpful.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to Tape



Who is online

Users browsing this forum: No registered users and 8 guests