Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
timmi2704
Expert
Posts: 100
Liked: 5 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Library slot management

Post by timmi2704 »

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 :)
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Library slot management

Post by Dima P. »

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
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Library slot management

Post by veremin »

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.
timmi2704
Expert
Posts: 100
Liked: 5 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Re: Library slot management

Post by timmi2704 »

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 :-)
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Library slot management

Post by veremin »

Ok, your request has been heard. Just out of curiosity - what tape device are you using?
timmi2704
Expert
Posts: 100
Liked: 5 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Re: Library slot management

Post by timmi2704 »

Thanks. I am using Quantum Scalar tape libraries with HP drives.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Library slot management

Post by veremin »

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.
timmi2704
Expert
Posts: 100
Liked: 5 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Re: Library slot management

Post by timmi2704 » 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
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Library slot management

Post by veremin »

Nice script, indeed. Thank you for sharing.

Glad to hear that my input was helpful.
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests