They have a single tape drive (hp ultrium LTO-6) and what they want to happen is this:
*VM backup jobs run at nighttime and backup to disk
* They put in a random tape into their drive sometime in the middle of the day
* Veeam then erases and writes full backup onto tape and then eject when done via tape job which copies backup repo
* Next day middle of day, they take out ejected tape and then put in another random tape into drive to repeat cycle
So the big problem here is the random tape part. There is a very large chance that this tape will have never been seen before on the Veeam server. So, this drive needs inventoried, the media needs set to a pool, the media needs erased, the media needs turned online.
So - I was hoping someone could help me write a powershell script that will run after the VM backup job and initiate this whole process. Below is what I have so far.
Code: Select all
Add-PSSnapin VeeamPSSnapin
Get-VBRTapeDrive | Start-VBRTapeInventory
$tape = Get-VBRTapeMedium | Where-Object {$_.IsOnline -like "True"}
$tape.MarkAsFree()
#Move-VBRTapeMedium -Medium $tape -MediaPool "Media Pool 1" -Confirm:$false
Start-VBRJob -Job "Backup to Tape Job 1" -FullBackup
#Eject-VBRTapeDrive -Drive "Tape0"
Pause