Veeam Tape Inventory

Everything about backing up to tape

Re: Veeam Tape Inventory

Veeam Logoby jgl75 » Tue 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
jgl75
Influencer
 
Posts: 22
Liked: 5 times
Joined: Wed Oct 02, 2013 6:23 am

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Tue 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jgl75 » Tue 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)...
jgl75
Influencer
 
Posts: 22
Liked: 5 times
Joined: Wed Oct 02, 2013 6:23 am

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Tue 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jed-hyper » Mon 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?
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

Re: Veeam Tape Inventory

Veeam Logoby jgl75 » Mon Mar 03, 2014 9:22 am

Have you tried my script ?
jgl75
Influencer
 
Posts: 22
Liked: 5 times
Joined: Wed Oct 02, 2013 6:23 am

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Mon 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jed-hyper » Mon 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
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

Re: Veeam Tape Inventory

Veeam Logoby jgl75 » Tue Mar 04, 2014 6:17 am

You have to use : -Confirm:$false

The dollar sign must be there.
jgl75
Influencer
 
Posts: 22
Liked: 5 times
Joined: Wed Oct 02, 2013 6:23 am

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Tue 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jed-hyper » Tue 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
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Wed 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jed-hyper » Wed 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
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

Re: Veeam Tape Inventory

Veeam Logoby v.Eremin » Wed 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Veeam Tape Inventory

Veeam Logoby jed-hyper » Wed 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.
jed-hyper
Enthusiast
 
Posts: 33
Liked: 4 times
Joined: Wed Feb 26, 2014 4:42 am
Full Name: Jed Parkes

PreviousNext

Return to Tape



Who is online

Users browsing this forum: No registered users and 5 guests