HyperV - New reIPing rule with powershell

PowerShell script exchange

HyperV - New reIPing rule with powershell

Veeam Logoby rmf » Mon Jan 26, 2015 3:40 pm

I have been unsuccessful with setting a NEW reIP rule with powershell. I get a readonly error when trying to set a new rule within the Options container. Could someone point me in the right direction for this? Thanks in advance.
rmf
Novice
 
Posts: 4
Liked: never
Joined: Thu Jan 15, 2015 7:59 pm
Full Name: Ryan

Re: HyperV - New reIPing rule with powershell

Veeam Logoby v.Eremin » Mon Jan 26, 2015 3:52 pm

Information regarding RE-IP rules can be found inside $Job.info.Options.RootNode.ReIPRules.Rule. For instance, example provide below updates the gateway settings:

Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -Name "Name of replication Job"
$Info = $Job.Info
$Info.Options.RootNode.ReIPRules.Rule.Target.Gateway = "172.18.0.2"
[Veeam.Backup.Core.CBackupJob]::Update($Info)


Though, this example will work only if RE-IP has been enabled previously in the job settings and at least one rule has been created.

While RE-IP can be enabled through the following example, the rule creation is a different story:

Code: Select all
$Job = Get-VBRJob -Name "Name of Replication Job"
$Info = $Job.info
$Info.Options.RootNode.UseReIP = "True"
[Veeam.Backup.Core.CBackupJob]::Update($Info)


$Job.info.Options.RootNode.ReIPRules that has all information regarding RE-IP rules is an XML element. So, you can try to generate XML file containing desired rules and try to assign it somehow as RE-IP rule.

Otherwise, you can create a job with some pre-defined RE-IP rules that can be utilized as a template later on. The idea here is to copy that job and change RE-IP settings in accordance with their needs, using the script mentioned in my previous post.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: HyperV - New reIPing rule with powershell

Veeam Logoby rmf » Mon Jan 26, 2015 9:48 pm

Thanks v.Eremin. This was my original conclusion but was hoping for a different approach... disappointing. :cry:
rmf
Novice
 
Posts: 4
Liked: never
Joined: Thu Jan 15, 2015 7:59 pm
Full Name: Ryan

Re: HyperV - New reIPing rule with powershell

Veeam Logoby v.Eremin » Tue Jan 27, 2015 2:38 pm

I think one "dummy" job that has one RE-IP rule created is the easiest approach here. This job can be used as a template and you can modify corresponding settings however you like. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 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 6 guests