Discussions related to exporting backups to tape and backing up directly to tape.
Post Reply
lcchan
Novice
Posts: 3
Liked: never
Joined: Jun 26, 2018 3:41 am
Full Name: Chan Ling Chien
Contact:

Need help on the Tape script

Post by lcchan »

Hi,

I new in the Veeam tape as i not really familiar with it.

I understand that Veeam require to manually inventory the tape and assign to the specific media. I might need someone who can assist me on the automated script.
The autoloader have 8 slot in total but we will only insert tape 1-7 to slot 1-7 which each tape will represent 1 days such as slot 1 monday, slot 2 tuesday and so on. After that, each week of monday all the tapes will be take out and input new 7 tapes to the represent slot again. I know that after we manually remove the tape we need manual delete those tape from the media pool as it not valid anymore. I not sure how we can do it in the script.

Is there any script can auto perform inventory first then move the tape to the represent slot?
I did go through the forum and found some script and trying to combine them but i not sure it will be correct or not.
Please kindly provide me any feedback if it possible.

thanks

Code: Select all


Add-PSSnapin VeeamPSSnapIn

Start-VBRTapeInventory -Library "HP 1x8 G2 AUTOLDR 5.00"
Get-VBRTapeDrive | Eject-VBRTapeDrive
start-sleep -s 180

$monday = Get-VBRTapeMediaPool -name "Monday"
#Using the first to slots for Monday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "1"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $monday -Confirm:$false

$Tuesday = Get-VBRTapeMediaPool -name "Tuesday"
#Using the first to slots for Tuesday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "2"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $tuesday -Confirm:$false

$Wednesday = Get-VBRTapeMediaPool -name "Wednesday"
#Using the first to slots for Wednesday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "3"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $wednesday -Confirm:$false

$Thursday = Get-VBRTapeMediaPool -name "Thursday"
#Using the first to slots for Thursday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "4"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $thursday -Confirm:$false

$Friday = Get-VBRTapeMediaPool -name "Friday"
#Using the first to slots for Friday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "5"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $friday -Confirm:$false

$Saturday = Get-VBRTapeMediaPool -name "Saturday"
#Using the first to slots for Saturday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "6"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $saturday -Confirm:$false

$Sunday = Get-VBRTapeMediaPool -name "Sunday"
#Using the first to slots for Sunday
$tape = Get-VBRTapeMedium | where {$_.location.address -eq "7"}  
Move-VBRTapeMedium -Medium $tape -MediaPool $sunday -Confirm:$false

Regnor
VeeaMVP
Posts: 940
Liked: 291 times
Joined: Jan 31, 2011 11:17 am
Full Name: Max
Contact:

Re: Need help on the Tape script

Post by Regnor »

Wouldn't it be easier if you inventory all your tapes and assign them to the corresponding media pool? Then it wouldn't matter which tape is in which slot of your autoloader. And is there even a need to create a pool for every day? Wouldn't in media pool with a 7 day media set active the same goal?
Also why do you remove the tapes from the media pool?
lcchan
Novice
Posts: 3
Liked: never
Joined: Jun 26, 2018 3:41 am
Full Name: Chan Ling Chien
Contact:

Re: Need help on the Tape script

Post by lcchan »

Regnor wrote:Wouldn't it be easier if you inventory all your tapes and assign them to the corresponding media pool? Then it wouldn't matter which tape is in which slot of your autoloader. And is there even a need to create a pool for every day? Wouldn't in media pool with a 7 day media set active the same goal?
Also why do you remove the tapes from the media pool?
Hi Regnor,

I did create 7 media pool already which it will be Monday - Sunday. The reason behind it why I prefer to assign the specific slot to specific media pool is because when we take out the tape and we can know which slot are belongs to which days instead need to login to the VBR server and check it from the console. Other than this, since we did input new 7 tapes on every monday and the old tape information will still appear inside the assigned media pool by showing it offline meanwhile the new tape that had been inventory will show online. Please correct me if I'm wrong about this as I still new into this.
Regnor
VeeaMVP
Posts: 940
Liked: 291 times
Joined: Jan 31, 2011 11:17 am
Full Name: Max
Contact:

Re: Need help on the Tape script

Post by Regnor »

You're right that removed tapes will still show up in the media pool as offline, but is that a problem for you?
When a tape job starts it will choose only tapes which are online and which can be overwritten; offline media don't causes any problems. If you delete the old tape you'll lose the catalog and restores will be more complicated.
lcchan
Novice
Posts: 3
Liked: never
Joined: Jun 26, 2018 3:41 am
Full Name: Chan Ling Chien
Contact:

Re: Need help on the Tape script

Post by lcchan »

Regnor wrote:You're right that removed tapes will still show up in the media pool as offline, but is that a problem for you?
When a tape job starts it will choose only tapes which are online and which can be overwritten; offline media don't causes any problems. If you delete the old tape you'll lose the catalog and restores will be more complicated.
Yes. It will be not problem for me but i just think the practice shouldn't it will be offline tape remove out from the media pool?

Since the tape will going to be reuse if the tape are not enough.
veremin
Product Manager
Posts: 20284
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Need help on the Tape script

Post by veremin »

Offline tapes won't be reused, so, you're on the safe side here. Thanks.
Regnor
VeeaMVP
Posts: 940
Liked: 291 times
Joined: Jan 31, 2011 11:17 am
Full Name: Max
Contact:

Re: Need help on the Tape script

Post by Regnor »

lcchan wrote:Since the tape will going to be reuse if the tape are not enough.
As long as the tapes are already expired you can reused them when entered in the library.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests