PowerShell script exchange
Post Reply
ksl28
Enthusiast
Posts: 60
Liked: 11 times
Joined: Sep 21, 2016 8:31 am
Full Name: Kristian Leth
Contact:

Setup VBR Copy job - immutablerepository

Post by ksl28 »

Hi,

We are trying to automate the creating of backup copy jobs, from our Windows Repositories to our immutable linux repos.
But we are facing an issue...

If we define immutable repo in the -Repository parameter for Add-VBRViBackupCopyJob, we get an error, that we have to enable GFS in order to do this.

Code: Select all

Add-VBRViBackupCopyJob -DirectOperation -Name $CopyJobName -BackupJob $SourceJob -EnableImmediateCopy -Repository $CopyRepo
Add-VBRViBackupCopyJob : Immutable backups feature requires the GFS retention policy enabled in the Backup Copy job settings.
I then left the -Repository parameter out, and built the copy job using this code:

Code: Select all

$SourceJob = Get-VBRJob -Name $NewTagName 
    $CopyRetainDays = $sourcejob.BackupStorageOptions.RetainDaysToKeep
    $CopyJobName = "COPY_" + $NewTagName
    Add-VBRViBackupCopyJob -DirectOperation -Name $CopyJobName -BackupJob $SourceJob -EnableImmediateCopy #-Repository $CopyRepo
    $joboptions = New-VBRJobOptions -ForReplicaJob
    $joboptions.BackupStorageOptions.RetainDaysToKeep = $CopyRetainDays
    $joboptions.BackupStorageOptions.RetentionType = "Days"
    $joboptions.BackupStorageOptions.RetainDays = 14
    $JobOptions.BackupStorageOptions.EnableDeletedVmDataRetention = $True
    $joboptions.GenerationPolicy.EnableDeletedVmDataRetention = $True
    $joboptions.GenerationPolicy.DeletedVmsDataRetentionPeriodDays = 14
    $JobOptions.RpoOptions.Enabled = $true
    $joboptions.RpoOptions.Value = 24
    $joboptions.RpoOptions.TimeUnit = "Hour"
    $JobOptions.GfsPolicy.IsEnabled = $true
    $joboptions.GfsPolicy.weekly.IsEnabled = $true
    $joboptions.GfsPolicy.weekly.KeepBackupsForNumberOfWeeks = 1
    $joboptions.GfsPolicy.weekly.DesiredTime = "Saturday"
    $copyjobname | Set-VBRJobOptions -Options $joboptions
It then creates the job and defaults to an default repository.
I then want to change the repository to our immutable linux repos, but it seems there is no cmdlet for that, besides having to copy the backup job to a new one?
powershell-f26/need-to-change-job-backu ... 72195.html
powershell-f26/change-backup-job-repository-t24267.html

What cmdlet / JobOptions property should i use, in order to change this properly?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Setup VBR Copy job - immutablerepository

Post by oleg.feoktistov »

Hi Kristian,

If the main purpose of your question is being able to target backup copy job to an immutable repository, then there is no point in seeking the solution in Powershell or .NET as this setup is not supported in the core logic. See Hardened Repository Limitations. If it is something else, please, elaborate.

Thanks,
Oleg
Mildur
Product Manager
Posts: 9847
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Setup VBR Copy job - immutablerepository

Post by Mildur »

I think, the issue is, you can‘t create the backup copy job with gfs enabled and target it to the immutable backup repo.

If the Add-VBRViBackupCopyJob command would allow joboptions parameter, we could create the backup copy job with one command, gfs enabled and target to a immutable repo.

In the gui, it‘s possible to create it.
On the shell, it will never work because of missing job options in the „add job“ command. There is no way to create the job with gfs. Only to change it after the creation. Then it‘s too late.
Product Management Analyst @ Veeam Software
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Setup VBR Copy job - immutablerepository

Post by oleg.feoktistov »

Now I see, I must have missed that part. Then it is correct, currently there is way to change it other than copying it to a new job. We have plans to re-arrange backup and backup copy job cmdlets in one of the next product versions so that cases like this one never happen. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests