PowerShell script exchange
Post Reply
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Change Full/Incremental pool via PS

Post by aaron@ARB »

Using the example at https://helpcenter.veeam.com/backup/pow ... pejob.html

Code: Select all

PS C:\PS> $newpool = Get-VBRTapeMediaPool -Name "Incremental Backups"
PS C:\PS> Get-VBRTapeJob -Name "Daily WebApp Backup" | Set-VBRBackupToTapeJob -IncrementalBackupMediaPool $newpool
I am trying to execute

Code: Select all

$newpool = Get-VBRTapeMediaPool -Name "ARBTest"
Get-VBRTapeJob -Name "ARBBackupToTape" | Set-VBRBackupToTapeJob -IncrementalBackupMediaPool $newpool
Given that ARBBackupToTape is a valid tape job and ARBTest is a valid media pool, can someone please explain why I get the below error?

Code: Select all

Set-VBRBackupToTapeJob : OnDay
At line:4 char:42
+ Get-VBRTapeJob -Name "ARBBackupToTape" | Set-VBRBackupToTapeJob -IncrementalBack ...
+                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-VBRBackupToTapeJob], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Veeam.Backup.PowerShell.Cmdlets.SetVBRBackupToTapeJob
Is there something wrong with either my tape job or the media pool that is causing this failure?
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Change Full/Incremental pool via PS

Post by PTide »

Hi,

That line should work. Could you please describe Media Pool and Tape Job settings?

Thank you.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: Change Full/Incremental pool via PS

Post by aaron@ARB »

what would you like to know? they are nothing special from what I see, i'm not trying to do a huge amount, I just have some VM's set to go to tape without a schedule to a standard media pool. The media pools are nothing special either and there are not too many options to be had with those either really?
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Change Full/Incremental pool via PS

Post by PTide »

Please provide the output of

Code: Select all

Get-VBRTapeJob -Name "ARBBackupToTape"
and

Code: Select all

Get-VBRTapeMediaPool -Name "ARBTest"
Thank you.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: Change Full/Incremental pool via PS

Post by aaron@ARB »

Refer below with thanks.

Code: Select all

PS C:\Users\administrator.ENSAT> Get-VBRTapeJob -Name "ARBBackupToTape"


FullBackupPolicy           : Monthly
Object                     : {Backup Job WADC1, P2-ARBBackup-ARBPS01, Backup Job NSWDC1, P2-ARBBackup-Pink...}
ProcessIncrementalBackup   : True
ScheduleOptions            : Daily
WaitForBackupJobs          : True
WaitPeriod                 : 03:00:00
GFSScheduleOptions         : 
AlwaysCopyFromLatestFull   : False
EjectCurrentMedium         : True
ExportCurrentMediaSet      : False
ExportDays                 : {Sunday, Monday, Tuesday, Wednesday...}
FullBackupMediaPool        : Week2
IncrementalBackupMediaPool : Week2
UseHardwareCompression     : False
NotificationOptions        : Veeam.Backup.PowerShell.Infos.VBRNotificationOptions
JobScriptOptions           : Veeam.Backup.PowerShell.Infos.VBRJobScriptOptions
NextRun                    : 
Target                     : Week2
Type                       : BackupToTape
LastResult                 : None
LastState                  : Working
Id                         : c665cb7b-ee1e-46ca-9201-21fbd5198c7e
Name                       : ARBBackupToTape
Description                : Created by ENSAT\administrator at 5/06/2015 1:53 PM.




PS C:\Users\administrator.ENSAT> Get-VBRTapeMediaPool -Name "ARBTest"


Capacity               : 0
FreeSpace              : 0
MediaSetCreationPolicy : Never
MediaSetName           : ARBTest
MoveOfflineToVault     : False
RetentionPolicy        : Never
MultiStreamingOptions  : Veeam.Backup.PowerShell.Infos.VBRMultiStreamingOptions
LibraryId              : 258bbf43-6238-425e-9bb0-ae5d9ee12020
MoveFromFreePool       : False
Type                   : Custom
EncryptionOptions      : False
GlobalOptions          : Veeam.Backup.PowerShell.Infos.VBRGlobalMediaPoolOptions
Medium                 : {}
Id                     : 34b2169a-a61e-4101-a858-7a9b1ff0be9e
Name                   : ARBTest
Description            : Created by ENSAT\administrator at 23/06/2015 9:22:35 AM.
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Change Full/Incremental pool via PS

Post by PTide »

Everything looks fine, so I suggest you to contact support team for a deeper investigation. Once you do please post your case ID in this thread.

Thank you.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: Change Full/Incremental pool via PS

Post by aaron@ARB »

Done :)

Code: Select all

[ID# 01799368] Powershell cmdlet to change media set not working
Product: Veeam Backup & Replication
Severity: 3
Opened: 16.05.2016 0:57
Status: New
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Change Full/Incremental pool via PS

Post by veremin »

The error looks like the script tried to update job schedule, which based on the code itself it shouldn't have.

For the testing purpose it might be worth spiting the script avoiding usage of pipeline and updating a PowerShell version (only if PS 2.0 is used).

Thanks.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: Change Full/Incremental pool via PS

Post by aaron@ARB »

Code: Select all

PS C:\Users\administrator.ENSAT> $psversiontable.psversion

Major  Minor  Build  Revision
-----  -----  -----  --------
3      0      -1     -1      
Thanks for the update, removing the pipelining did work. Can you possibly organise for the code to be fixed of the doco to be updated / added to so others dont face the same issue in the future?

Code: Select all

PS C:\Users\administrator.ENSAT> $newpool = Get-VBRTapeMediaPool -Name "Week2"
PS C:\Users\administrator.ENSAT> $tapejob = Get-VBRTapeJob -Name "ARBTestToTape"
PS C:\Users\administrator.ENSAT> Set-VBRBackupToTapeJob -Job $tapejob -IncrementalBackupMediaPool $newpool -FullBackupMediaPool $newpool

FullBackupPolicy           : WeeklyOnDays
Object                     : {}
ProcessIncrementalBackup   : True
ScheduleOptions            : Daily
WaitForBackupJobs          : True
WaitPeriod                 : 03:00:00
GFSScheduleOptions         : 
AlwaysCopyFromLatestFull   : False
EjectCurrentMedium         : False
ExportCurrentMediaSet      : False
ExportDays                 : {Sunday, Monday, Tuesday, Wednesday...}
FullBackupMediaPool        : Week2
IncrementalBackupMediaPool : Week2
UseHardwareCompression     : False
NotificationOptions        : Veeam.Backup.PowerShell.Infos.VBRNotificationOptions
JobScriptOptions           : Veeam.Backup.PowerShell.Infos.VBRJobScriptOptions
NextRun                    : 
Target                     : Week2
Type                       : BackupToTape
LastResult                 : Success
LastState                  : Stopped
Id                         : 23d40d8f-4a52-4427-ba25-6aa49e42bcd1
Name                       : ARBTestToTape
Description                : Created by ENSAT\administrator at 18/05/2016 8:47 AM
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Change Full/Incremental pool via PS

Post by veremin »

Can you tell me what product version you're currently at? I'm wondering because the described issue looks like the one that has been fixed previously.

Thanks.
aaron@ARB
Expert
Posts: 138
Liked: 14 times
Joined: Feb 21, 2014 3:12 am
Full Name: ARBCorporationPtyLtd
Contact:

Re: Change Full/Incremental pool via PS

Post by aaron@ARB »

9.0u1
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Change Full/Incremental pool via PS

Post by veremin »

Hmm, strange behaviour, indeed. I've tried to reproduce it in my lab - without much success, though.

Anyway, glad to hear that splitting the lines solved the issue for you.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests