Page 1 of 5

Veeam Tape Inventory

Posted: Aug 19, 2013 11:19 am
by marksmithuk
I might be missing an option in the new v7 console but I am trying to set up a scheduled inventory of the tape drives (standard drives, no robotic library) so that when our Helpdesk put in the new daily tapes they don't have to manually inventory the drives. My logic is that all the jobs kick in at 2am so if I got the system to do an inventory at 1am the jobs would know what is in the drives and the jobs would run as expected.

Any ideas on what I can do, or am I missing the obvious menu?

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 12:07 pm
by v.Eremin
You can write a simple PS script that will get corresponding tape drives and inventory a tape medium that is put into it. After that, you can schedule (via Windows Scheduler) this script to run at a given time:

Code: Select all

asnp VeeamPssnapin
foreach ($Drive in Get-VBRTapeDrive)
{ 
$Drive.TapeMedium | Start-VBRTapeInventory
} 
Thanks.

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 2:33 pm
by marksmithuk
Thanks for that, sounds just what I was looking for. Do you know if there is a way I can rename the drives themselves in VBR as the two I have both come up with the same name and it would be good to be able to identify which is which:

Code: Select all


PS C:\Windows\system32> Get-VBRTapeDrive


IsLocked           : False
Model              : IBM ULTRIUM-HH5 SCSI Sequential Device
State              : Loaded
LoadedMedia        : Daily1A
DeviceId           : f5869f4a-acc9-4446-9d03-02cfe0ef28b8
Enabled            : True
Library            : IBM ULTRIUM-HH5 SCSI Sequential Device
Address            : 0
Location           : Veeam.Tape.Model.TapeMediumLocation
LoadedTapeMediumId : 74879492-3b1a-43f0-8a28-7db925458e64
TapeMedium         : Daily1A
InternalState      : Veeam.Tape.Model.DbTapeDrive

IsLocked           : False
Model              : IBM ULTRIUM-HH5 SCSI Sequential Device
State              : Empty
LoadedMedia        :
DeviceId           : dda137c0-c6f3-4fb4-ac4f-517d53f2bc56
Enabled            : True
Library            : IBM ULTRIUM-HH5 SCSI Sequential Device
Address            : 0
Location           : Veeam.Tape.Model.TapeMediumLocation
LoadedTapeMediumId : 00000000-0000-0000-0000-000000000000
TapeMedium         :
InternalState      : Veeam.Tape.Model.DbTapeDrive

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 2:38 pm
by v.Eremin
Hi, Mark. It seems impossible to change this setting through either GUI or PS. However, as the drives in question have different device ID, by the means of which they can be easily distinguished.

Thanks.

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 2:52 pm
by marksmithuk
I noticed that but wasnt sure how to call it via that, I am trying to run the code simular to what you were suggesting but a single job for each drive. I am running

Code: Select all

Start-VBRTapeInventory -Library "IBM ULTRIUM-HH5 SCSI Sequential Device"
Which works perfectly but only calls the first drive, do you know how I can reference it via ID ?

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 2:59 pm
by v.Eremin
From my perspective, something like this should meet your expectations.

Drive#1

Code: Select all

asnp VeeamPSSnapin
$Drive1 = Get-VBRTapeDrive | Where {$_.deviceid -eq "f5869f4a-acc9-4446-9d03-02cfe0ef28b8"}
$Drive1.TapeMedium | Start-VBRTapeInventory
Drive#2

Code: Select all

asnp VeeamPSSnapin
$Drive2 = Get-VBRTapeDrive | Where {$_.deviceid -eq "dda137c0-c6f3-4fb4-ac4f-517d53f2bc56"}
$Drive2.TapeMedium | Start-VBRTapeInventory 
Thanks.

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 3:05 pm
by marksmithuk
You are a start, that is perfect! thanks a lot.

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 3:06 pm
by marksmithuk
Star even!

Re: Veeam Tape Inventory

Posted: Aug 19, 2013 3:07 pm
by v.Eremin
Thanks, Mark, for your kind words. Should any additional help be needed, don't hesitate to let us know.

Re: Veeam Tape Inventory

Posted: Jan 31, 2014 12:12 pm
by jgl75
Hello !

I'm trying to do a similar thing with the script, however, when the tape was used by our previous backup software (Backup Exec 2010), the file to tape job stays on the waiting tape status.

Code: Select all

Add-PSSnapin VeeamPSSnapin
Get-VBRTapeDrive | Start-VBRTapeInventory
$tape = Get-VBRTapeMedium | Where-Object {$_.IsOnline -like "True"}
$tape.MarkAsFree()
Start-VBRJob -Job "NameOfJob" -FullBackup
Eject-VBRTapeDrive -Drive "Tape0"


What should I do to correct this ?

Thanks !

Jean

Re: Veeam Tape Inventory

Posted: Jan 31, 2014 12:59 pm
by v.Eremin
You mean, the script provided above doesn't seems to work, right?

If my memory serves me well, the tape that has data written to it by different backup software is automatically assigned to "Unrecognized" media pool. So, within the script you can try to examine "Unrecognized" Media Pool, see whether there is a cassette there, then, move this cassette to "Free" Media Pool or even erase it, and, finally, execute the given tape job.

Thanks.

Re: Veeam Tape Inventory

Posted: Jan 31, 2014 1:04 pm
by jgl75
The script will work except if the tape was used by another software.

I've tried to move a tape from unrecognised media pool to my default media pool but I get a confirmation message in powershell that I can't get rid of...

I think that I used this cmdlet :

Move-VBRTapeMedium

Thanks in advance !

Jean

Re: Veeam Tape Inventory

Posted: Jan 31, 2014 1:09 pm
by v.Eremin
Have you tried to add -Confirm:$false parameter to the end of line? This way, you shouldn't get confirmation message.

Thanks.

Re: Veeam Tape Inventory

Posted: Feb 03, 2014 7:01 am
by jgl75
Oups, I tried -Confirm $false...
It works perfectly with -Confirm:$false

I'm just starting with Powershell... Sorry for this and thanks for your help !

Re: Veeam Tape Inventory

Posted: Feb 03, 2014 10:08 am
by v.Eremin
No problem, you can get most of information regarding Veeam PS snapin, using our online Help Center, as well as, the corresponding subforum. Thanks.