PowerShell script exchange
Post Reply
DaKernel
Enthusiast
Posts: 28
Liked: 3 times
Joined: Dec 10, 2019 5:37 pm
Full Name: Larry Heintz
Contact:

Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by DaKernel »

So I am trying to script Backup Copy jobs and I am starting out with the basic code

Code: Select all

$VeeamServer = "vserver"
Connect-VBRServer -Server $VeeamServer -Port "9392"

$BCJobName = "TEST_BC"
$BCRepository = "Repo1"
$BCBackupJob = "Job1"
$BCSourceRepository = Get-VBRBackupRepository -Name "Source_repo"
$BCDescription = $BCJobName

#Create Job
Add-VBRViBackupCopyJob -Name $BCJobName -Description $BCDescription -DirectOperation -BackupJob $BCBackupJob `
-Repository (Get-VBRBackupRepository -Name $BCRepository) -SourceRepository $BCSourceRepository
Receiving the following error "Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter. Parameter is not supported by backup copy job configured in periodic copy mode." I am using the reference from this URL, https://helpcenter.veeam.com/docs/backu ... ml?ver=110 . Is this not the correct source I should be looking at.

I have looked at some sample code from other posts and I do not see any of them using the -SourceRepository call. We have our backup jobs contained in specific repositories, so we would like to set the SourceRepository.

Also is there a simple place I can see all the corresponding powershell options that are set in UI for Backup Copy jobs?

TIA!
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by david.domask »

Hi @DaKernel,

Let me check internally as I think this might be a mistake -- if it was for ImmediateMode, it would make sense as you can't pick a Source Repository there, but for Periodic I imagine this should work. Might take some time for a response, but I'll update as soon as I have one.
David Domask | Product Management: Principal Analyst
DaKernel
Enthusiast
Posts: 28
Liked: 3 times
Joined: Dec 10, 2019 5:37 pm
Full Name: Larry Heintz
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by DaKernel »

@david.domask, thank you for checking :)
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by david.domask »

@DaKernel, checked this out with QA, seems the documentation just needs to be made more clear. This cmdlet is only about sourcing from a specific repository, not restricting repositories, which is a feature just for Immediate Copy.

I agree it's not so clear, so I'm going to ask we please clarify the documentation a bit better.
David Domask | Product Management: Principal Analyst
DaKernel
Enthusiast
Posts: 28
Liked: 3 times
Joined: Dec 10, 2019 5:37 pm
Full Name: Larry Heintz
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by DaKernel »

@david.domask

Maybe I am not understanding what you just said.

We setup our Backup Copy jobs to use specific source repositories with periodic copy mode. For us to automate backup copy job creation we need this work.

When we manually setup a periodic backup copy job we can choose the source repository.

Also is there a simple place I can see all the corresponding powershell options that are set in UI for Backup Copy jobs?
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by david.domask »

Hi @DaKernel,

Don't worry, I had the same confusion.

When you add via -Job, the Backup Copy will automatically know which repository to use.

-SourceRepository isn't about selecting the valid repositories like you see here: https://helpcenter.veeam.com/docs/backu ... ml?ver=110

-SourceRepository is about adding a repository as the object for the Backup Copy, as shown here: https://helpcenter.veeam.com/docs/backu ... ml?ver=110
[For the immediate copy mode] Select a type of a source from which you want to copy restore points:

From jobs. You will see existing backup jobs. Veeam Backup & Replication will copy restore points created by the selected backup jobs.
From repositories. You will see all backup repositories in the backup infrastructure. Veeam Backup & Replication will copy restore points stored on the selected backup repositories. Veeam Backup & Replication will copy only restore points of workloads of the same platform as you have selected when launching the wizard.

If you select repositories as sources, and target new jobs to the repositories in future, Veeam Backup & Replication will update backup copy job settings automatically to include these jobs to be copied.
I had the exact same confusion, as the cmdlet instructions just mention an array of Repositories, which now I understand to mean as an object source for the Backup Copy, but I initially read it the same as you, that it's about specific repositories being valid sources for Backup Copy Objects added from infrastructure. (e.g., assume you have a VM named "important_vm", and it's part of a few jobs for various reasons. You only want to use Repository A as a source for the Backup Copy. If you add From Infrastructure, Veeam by default will look for the most recent restore point for that VM regardless of the repository, and limiting the Source Repositories helps to avoid poorly routed Backup Copies)
David Domask | Product Management: Principal Analyst
DaKernel
Enthusiast
Posts: 28
Liked: 3 times
Joined: Dec 10, 2019 5:37 pm
Full Name: Larry Heintz
Contact:

Re: Add-VBRViBackupCopyJob : Failed to set SourceRepository parameter.

Post by DaKernel »

@david.domask,

Thank you for the explanation and the script works like it should now :)

Thank you!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests