Change Full/Incremental pool via PS

PowerShell script exchange

Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Sun May 08, 2016 6:45 am

Using the example at https://helpcenter.veeam.com/backup/powershell/set-vbrbackuptotapejob.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?
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby PTide » Tue May 10, 2016 12:41 pm

Hi,

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

Thank you.
PTide
Veeam Software
 
Posts: 3017
Liked: 245 times
Joined: Tue May 19, 2015 1:46 pm

Re: Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Tue May 10, 2016 12:51 pm

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?
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby PTide » Tue May 10, 2016 1:32 pm

Please provide the output of

Code: Select all
Get-VBRTapeJob -Name "ARBBackupToTape"


and

Code: Select all
Get-VBRTapeMediaPool -Name "ARBTest"


Thank you.
PTide
Veeam Software
 
Posts: 3017
Liked: 245 times
Joined: Tue May 19, 2015 1:46 pm

Re: Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Tue May 10, 2016 1:35 pm

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.
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby PTide » Tue May 10, 2016 2:50 pm

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.
PTide
Veeam Software
 
Posts: 3017
Liked: 245 times
Joined: Tue May 19, 2015 1:46 pm

Re: Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Mon May 16, 2016 12:58 am

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
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby v.Eremin » Tue May 17, 2016 2:54 pm

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

Re: Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Tue May 17, 2016 10:54 pm

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
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby v.Eremin » Fri May 20, 2016 5:40 pm

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

Re: Change Full/Incremental pool via PS

Veeam Logoby aaron@ARB » Fri May 20, 2016 7:07 pm

9.0u1
aaron@ARB
Expert
 
Posts: 112
Liked: 12 times
Joined: Fri Feb 21, 2014 3:12 am
Full Name: Aaron @ ARB

Re: Change Full/Incremental pool via PS

Veeam Logoby v.Eremin » Mon May 23, 2016 10:25 am

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests