PowerShell script exchange
Post Reply
knight
Novice
Posts: 5
Liked: never
Joined: May 24, 2012 9:35 pm
Contact:

replication script

Post by knight »

I am trying to create a basic script that I can use to create replica jobs but have run into a problem and tech support it cant be done…I am a PowerShell n00b so please be gentle.
In my code Entity is "srv-filer123” which is a vm that I want to replicate.
This issue is that –Server flag will not accept the name of my cluster, (03.10 Cluster) and will only take the name of the datacenter (dal-vctr01).
$BackupCluster correctly return the cluster name, but I cant get -Server to accept anything but what is returned for $BackupServer

How do I specify the cluster name in -Server?

Code: Select all

$Entity = Find-VBRViEntity -name "srv-filer123"
$JobName = "srv-filer123-test"
$BackupCluster = Find-VBRViEntity -HostsAndClusters -Name "03.10 Cluster"
$BackupServer = Get-VBRServer -Name "dal-vctr01 "
$Datastore = Find-VBRViDatastore -Server $BackupServer -Name "T3-ATL-1"
$ResourcePool = Find-VBRViResourcePool -Server $BackupServer -Name "Atl Mgmt - Standby"
$Folder = Find-VBRViFolder -Server $BackupServer -Name "Discovered virtual machine"
$Suffix = "_replica"
 
Add-VBRViReplicaJob -Name $JobName -Server ($BackupServer) -Entity ($Entity)  -Datastore ($Datastore) -ResourcePool ($ResourcePool) -Folder ($Folder) -Suffix ($Suffix)
 
Alternatively does anyone have a finished replication script that will do this?

Sethbartlett
Expert
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: replication script

Post by Sethbartlett »

I actually have your current ticket, you cannot get it to accept a cluster name. You can set it currently to a host. So you could do one of the hosts on that cluster and then change it to the cluster.

Code: Select all

$Server = Get-VBRServer -name "Name of Host under Cluster"
The above would work, but there is not exactly a supported way to get Clusters to work in powershell. As I stated in your ticket, I could maybe get a workaround for you, but it is not supported.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.

knight
Novice
Posts: 5
Liked: never
Joined: May 24, 2012 9:35 pm
Contact:

Re: replication script

Post by knight »

Hello, I would like to add the ability to set the source proxy and alternative repository in my replica job creation script. I have seen several posts and I am able to set the repository and disable the automatic selection of the source proxy, but what do i do to set the source to a specific IP aaddress?
How do I make use of these options:

Code: Select all

#$Type = [Veeam.Backup.Model.CJobProxyInfo+EType]::ESource
#$CJobProxyInfo = 192.168.1.100

Sethbartlett
Expert
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: replication script

Post by Sethbartlett »

You are wanting to set which source proxies will be used for a specific job? Do you need to just set source proxies or also target proxies. Also, you can't just do it by IP Address, it will have to be by the name you added for the proxy, just like you would pick through the GUI.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests