PowerShell script exchange
Post Reply
tom_nl
Enthusiast
Posts: 43
Liked: 7 times
Joined: Nov 02, 2018 9:13 am
Contact:

Creating backup copy job

Post by tom_nl »

Hi,

I'm trying to create a backup copy job for specific VM's.
This is what I have now:

$Server = Get-VBRServer -Type ESXi
$VM = Find-VBRViEntity -Server $Server -name "*fp5*"
Add-VBRViBackupCopyJob -DirectOperation -Name "bla" -Repository $(Get-VBRBackupRepository -Name "bla") -Entity $VM

This should work if I see the examples. But the script just hangs with no error.
If I use the "-Backup" parameter it works just fine.

What am I doing wrong?
tom_nl
Enthusiast
Posts: 43
Liked: 7 times
Joined: Nov 02, 2018 9:13 am
Contact:

Re: Creating backup copy job

Post by tom_nl »

Anyone?
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Creating backup copy job

Post by jhoughes »

Is your VM living on a standalone ESXi host, or under a vCenter server?

If you are targeting your vCenter for backing up your virtual environment, then the VM object needs to be located in the same fashion. This means that for the Server parameter of the Find-VBRViEntity cmdlet, you need to be targeting vCenter as the server type, not ESXi.

You can confirm if your commands are returning any valid results by confirming the contents of your 'Server' and 'VM' variables; I suspect that your 'VM' variable doesn't contain anything.

If you are using vCenter, try this instead (note the server type in line 1):

Code: Select all

$Server = Get-VBRServer -Type VC
$VM = Find-VBRViEntity -Server $Server -name "*fp5*"
Add-VBRViBackupCopyJob -DirectOperation -Name "bla" -Repository $(Get-VBRBackupRepository -Name "bla") -Entity $VM
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
tom_nl
Enthusiast
Posts: 43
Liked: 7 times
Joined: Nov 02, 2018 9:13 am
Contact:

Re: Creating backup copy job

Post by tom_nl » 1 person likes this post

Thanks. Eventually the problem was that there was an ESXi in the Veeam configuration which wasn't accessible. This caused the script to "hang".
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 11 guests