Discussions specific to tape backups
marksmithuk
Enthusiast
Posts: 26
Liked: 3 times
Joined: Apr 15, 2011 2:15 pm
Full Name: Mark Smith
Location: Devon, UK
Contact:

Veeam Tape Inventory

Post by marksmithuk » Aug 19, 2013 11:19 am

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?

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Aug 19, 2013 12:07 pm

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.

marksmithuk
Enthusiast
Posts: 26
Liked: 3 times
Joined: Apr 15, 2011 2:15 pm
Full Name: Mark Smith
Location: Devon, UK
Contact:

Re: Veeam Tape Inventory

Post by marksmithuk » Aug 19, 2013 2:33 pm

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

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Aug 19, 2013 2:38 pm

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.

marksmithuk
Enthusiast
Posts: 26
Liked: 3 times
Joined: Apr 15, 2011 2:15 pm
Full Name: Mark Smith
Location: Devon, UK
Contact:

Re: Veeam Tape Inventory

Post by marksmithuk » Aug 19, 2013 2:52 pm

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 ?

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Aug 19, 2013 2:59 pm

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.

marksmithuk
Enthusiast
Posts: 26
Liked: 3 times
Joined: Apr 15, 2011 2:15 pm
Full Name: Mark Smith
Location: Devon, UK
Contact:

Re: Veeam Tape Inventory

Post by marksmithuk » Aug 19, 2013 3:05 pm

You are a start, that is perfect! thanks a lot.

marksmithuk
Enthusiast
Posts: 26
Liked: 3 times
Joined: Apr 15, 2011 2:15 pm
Full Name: Mark Smith
Location: Devon, UK
Contact:

Re: Veeam Tape Inventory

Post by marksmithuk » Aug 19, 2013 3:06 pm

Star even!

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Aug 19, 2013 3:07 pm

Thanks, Mark, for your kind words. Should any additional help be needed, don't hesitate to let us know.

jgl75
Influencer
Posts: 22
Liked: 5 times
Joined: Oct 02, 2013 6:23 am
Contact:

Re: Veeam Tape Inventory

Post by jgl75 » Jan 31, 2014 12:12 pm

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

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Jan 31, 2014 12:59 pm

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.

jgl75
Influencer
Posts: 22
Liked: 5 times
Joined: Oct 02, 2013 6:23 am
Contact:

Re: Veeam Tape Inventory

Post by jgl75 » Jan 31, 2014 1:04 pm

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

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Jan 31, 2014 1:09 pm 1 person likes this post

Have you tried to add -Confirm:$false parameter to the end of line? This way, you shouldn't get confirmation message.

Thanks.

jgl75
Influencer
Posts: 22
Liked: 5 times
Joined: Oct 02, 2013 6:23 am
Contact:

Re: Veeam Tape Inventory

Post by jgl75 » Feb 03, 2014 7:01 am

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 !

v.eremin
Product Manager
Posts: 16154
Liked: 1320 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by v.eremin » Feb 03, 2014 10:08 am

No problem, you can get most of information regarding Veeam PS snapin, using our online Help Center, as well as, the corresponding subforum. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests