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?

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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 ?

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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!

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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 !

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » 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.

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

Re: Veeam Tape Inventory

Post by jgl75 » Feb 04, 2014 8:26 am 1 person likes this post

Here's my script now.
It works !

It that can help someone :

Code: Select all

Add-PSSnapin VeeamPSSnapin
Get-VBRTapeDrive | Start-VBRTapeInventory
$tape = Get-VBRTapeMedium | Where-Object {$_.IsOnline -like "True"}
Move-VBRTapeMedium -Medium $tape -MediaPool "Your Media Pool" -Confirm:$false
$tape.MarkAsFree()
Start-VBRJob -Job "Your Backup Job to Tape" -FullBackup
Eject-VBRTapeDrive -Drive "Tape0"
So the script will check which tape is online, move it to the wanted media pool, mark it as free, start the backup job to tape and eject the tape when done.

Enjoy !

Jean

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Feb 04, 2014 8:48 am

From my perspective, as long as, "add tapes from free media pool" option is selected in the media pool settings, you can, probably, remove the line responsible for moving tape to the given media pool. Also, if "eject media once the job finishes" options is ticked in the setting of the tape job, you remove "ejection" line, as well.

Anyway, I glad to hear that you've finally nailed it.

Thanks.

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

Re: Veeam Tape Inventory

Post by jgl75 » Feb 04, 2014 8:53 am

The line moving the tape to the correct media pool is there to avoid problems when the tapes where used with another software (Backup Exec in my case).
Without it, the job is waiting for a tape because it's sitting in the unrecognised media pool...

The "eject media once the job finishes" button never worked for me...
I may have to retest it (don't know if I have tested it since RTM version)...

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Feb 04, 2014 9:47 am

The "eject media once the job finishes" button never worked for me. I may have to retest it (don't know if I have tested it since RTM version)...
You might want to test this functionality again. This time with the latest product version, as the said issue should have been fixed in the first patch.

Thanks.

jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Veeam Tape Inventory

Post by jed-hyper » Mar 03, 2014 4:46 am

jgl75 wrote:The line moving the tape to the correct media pool is there to avoid problems when the tapes where used with another software (Backup Exec in my case).
Without it, the job is waiting for a tape because it's sitting in the unrecognised media pool...
I'm having this same issue.
Does anyone know how to move media (that was used with Backup Exec) from unrecognised media pool to correct media pool?

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

Re: Veeam Tape Inventory

Post by jgl75 » Mar 03, 2014 9:22 am

Have you tried my script ?

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Mar 03, 2014 9:27 am

jed-hyper wrote:Does anyone know how to move media (that was used with Backup Exec) from unrecognised media pool to correct media pool?
I'm wondering whether you want to preserve the data written by BE or just overwrite the mediums used previously by BE. In latter case, you can either erase the tapes or mark them as free to move the tapes to the Free media pool.

Thanks.

jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Veeam Tape Inventory

Post by jed-hyper » Mar 03, 2014 9:29 pm

I just want to overwrite the mediums used previously by BE.
I have tried the script but i get this error Move-VBRTapeMedium command

Code: Select all

PS C:\Users\Administrator> Move-VBRTapeMedium -Medium $tape -MediaPool "Media Pool All" -confirm:false
Move-VBRTapeMedium : Cannot convert 'System.String' to the type 'System.Management.Automation.SwitchParameter'
required by parameter 'Confirm'.
At line:1 char:71
+ Move-VBRTapeMedium -Medium $tape -MediaPool "Media Pool All" -confirm:false
+                                                                       ~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Move-VBRTapeMedium], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Veeam.Backup.PowerShell.Command.MoveVBRTapeMedium

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

Re: Veeam Tape Inventory

Post by jgl75 » Mar 04, 2014 6:17 am

You have to use : -Confirm:$false

The dollar sign must be there.

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Mar 04, 2014 8:14 am

Yep, you seem to have missed dollar sign that is required for confirmation switch. Also, you need a script only if you want to move mediums in automatic fashion. Otherwise, the said process can be done manually.

Be aware, that provided script marks every online tape as free, not only tapes belonging to "Unrecognized" pool. So, if I were you, I would use something like this:

Code: Select all

$MediaPool = Get-VBRTapeMediaPool -Name "Unrecognized"
$FreeMediaPool = Get-VBRTapeMediaPool -Name "Free"
$Mediums = $MediaPool | Get-VBRTapeMedium
Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool -Confirm:$false
Thanks.

jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Veeam Tape Inventory

Post by jed-hyper » Mar 04, 2014 9:46 pm

Damn i typed previous post wrong, i was doing it with the $ and getting that error. Any ideas what i'm doing wrong?

Code: Select all

PS C:\Users\Administrator> $MediaPool = Get-VBRTapeMediaPool -Name "Unrecognized"
PS C:\Users\Administrator> $FreeMediaPool = Get-VBRTapeMediaPool -Name "Free"
PS C:\Users\Administrator> $Mediums = $MediaPool | Get-VBRTapeMedium
PS C:\Users\Administrator> Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool -Confirm:$false
Move-VBRTapeMedium : Method not found: 'Void Veeam.Tape.Core.TapeMedium.Clean()'.
At line:1 char:1
+ Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool -Confirm:$false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Move-VBRTapeMedium], MissingMethodException
    + FullyQualifiedErrorId : System.MissingMethodException,Veeam.Backup.PowerShell.Command.MoveVBRTapeMedium

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Mar 05, 2014 8:58 am

Hmmm, I tested this script in my environment and everything seems to have worked properly.

As a side option you can change the name of second media pool and see whether it makes any difference. It appears that you want to move all unrecognized tapes to the media pool named "Media Pool All", right? If so, try the following example:

Code: Select all

    asnp VeeamPSSnapin
    $MediaPool = Get-VBRTapeMediaPool -Name "Unrecognized"
    $MediaPool2 = Get-VBRTapeMediaPool -Name "Media Pool All"
    $Mediums = $MediaPool | Get-VBRTapeMedium
    Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool2 -Confirm:$false
Thanks.

jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Veeam Tape Inventory

Post by jed-hyper » Mar 05, 2014 9:51 pm

Yeah trying to move all unrecognised tapes.
Still no luck :( should i call tech support about this or is there something else i should try?

Code: Select all

PS C:\Users\Administrator> asnp VeeamPSSnapin
PS C:\Users\Administrator> $MediaPool = Get-VBRTapeMediaPool -Name "Unrecognized"
PS C:\Users\Administrator> $MediaPool2 = Get-VBRTapeMediaPool -Name "Media Pool All"
PS C:\Users\Administrator> $Mediums = $MediaPool | Get-VBRTapeMedium
PS C:\Users\Administrator> Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool2 -Confirm:$false
Move-VBRTapeMedium : Method not found: 'Void Veeam.Tape.Core.TapeMedium.Clean()'.
At line:1 char:1
+ Move-VBRTapeMedium -Medium $Mediums -MediaPool $MediaPool2 -Confirm:$false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Move-VBRTapeMedium], MissingMethodException
    + FullyQualifiedErrorId : System.MissingMethodException,Veeam.Backup.PowerShell.Command.MoveVBRTapeMedium

veremin
Product Manager
Posts: 16497
Liked: 1371 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Tape Inventory

Post by veremin » Mar 05, 2014 10:02 pm

Strange behaviour, indeed. As I have said, the script seems to be working properly in my environment.

You can contact support team and let them investigate it directly.

However, if I were, I would try to reinstall PS snap-in first, as "method not found" very specific error, indicating inconsistencies in versions, etc.

Thanks.

jed-hyper
Enthusiast
Posts: 39
Liked: 4 times
Joined: Feb 26, 2014 4:42 am
Full Name: Jed Parkes
Contact:

Re: Veeam Tape Inventory

Post by jed-hyper » Mar 05, 2014 10:33 pm 1 person likes this post

Fixed it. I had
1. Installed Version 7
2. Installed Version 7 Patch 3 update
3. Ran the Version 7 install again and added the PS snap-in
Then i got the error System.MissingMethodException,Veeam.Backup.PowerShell.Command.MoveVBRTapeMedium
I had to run the Version 7 Patch 3 update again and that fixed the issue.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 6 guests