Skip to main content

 

Introduction

 

In this blog posttfewins introduces a great Linux re-IP script to use with your Veeam Recovery Orchestrator (VRO) environments. Since iteration is a good way to improve things, I’ve taken a shot at it and updated the script with a new feature. This feature uses Veeam Backup & Replication (VBR) re-IP functionality for replication jobs and CDP policies to keep re-IP network information. It transforms VBR into the IP Address Management (IPAM) for VRO scripts.

 

How does it work?

 

We need two scripts configured as custom steps in VRO. The first script (GetReIpRules.ps1) is new. It takes as input the currently processed VM name and connects to VBR to search for the re-IP rule. It actually searches for a replication job or CDP policy to which the processed VM is associated with. Once it finds it, it looks for the re-IP rule and exports the content to a JSON file. 

Script logic

The second script (ReIpLinux.ps1), it’s actually the original script (a bit modified) and it changes the IP configuration for the recovered VM. But this time you don’t input the network information manually, because the script uses the JSON file to load all that information. It then searches for the recovered VM in vCenter Server and it connects over VIX to change the network configuration as per the loaded rules. 

The scripts are running on VBR server where the jobs (policies) are created. 

 

Prerequisites

 

All the prerequisites from the original post apply. Additionally, we need re-IP rules configured in the replication jobs or CDP policies.

By default you will be running re-IP rules during failover and the rule needs to have the “failover” keyboard in the description field. The keywords are used to select the correct set of re-IP rules during  plan execution. 

Failover re-IP rule in CDP policy

In this example, the re-IP rule will be used during failover and it will change the network configuration from 192.168.100.0/24 to 192.168.200.0/24.

How about restore plans? It’s pretty simple, you just need to add the keyword “restore” in the description for that re-IP rule. 

 

Configuration

 

  • For each plan step give it a name and import the scripts from where you have downloaded
  • Add the required parameters for GetReIpRules.ps1
Name Description Type Default Value

VbrCredentials

The credential used to authenticate to the Veeam Backup Server where the script is executed

Credential

(Set a default value as needed)

SourceVmName

Protected VM name

Text

%source_vm_name% (this will pass the VM name at runtime)

LogPath

Local path on VBR server where the scripts are executed to put log files

Text

(Set a default value as needed)

CurrentPlanState

VRO plan state

Text

 %plan_state% (this will pass the plan state at runtime)

       

 

  • Add the required parameters for ReIpLinux.ps1
Name Description Type Default Value
vCenterServer

Hostname, FQDN, or IP of the vCenter Server that manages the target VM. This is used for PowerCLI connection.

Text

(Set a default value as needed)

vCenterServerCreds

The credential used to authenticate to the "vCenterServer"

Credential

(Set a default value as needed)

GuestOsCreds

The credential used to authenticate in the VM guest OS

Credential

(Set a default value as needed)

SourceVmName

Protected VM name

Text

%source_vm_name% (this will pass the VM name at runtime)

VMName

Name of the target VM

Text

%target_vm_name% (this will pass the VM name at runtime)

 VMOrigIP

Original IP Address. Used to locate the network device to be modified.

Text

%current_vm_ip% (this will pass the VM IP at runtime)

LogPath

Local path on "VbrHostname" where to create logs

Text

 (Set a default value as needed)

CurrentPlanState

VRO plan state

Text

 %plan_state% (this will pass the plan state at runtime)

SudoRequired

Use this parameter to force the use of Sudo.

Text

true (the script defaults to false unless this parameter is set to 'true')

SudoPassRequired

Use this parameter to specify if a password is not required. The script defaults to using a password with Sudo if 'SudoRequired' is set to true.

Text

false (the script defaults to true unless this parameter is set to 'false')

 

  •  Create the recovery plan (replica, CDP or restore) and make sure to select the two plan steps in the proper order - first GetReIpRules.ps1, then ReIPLinux.ps1
Plan steps

 

  • Update the parameters in your plan as necessary and run the plan

Please make sure to thoroughly test these scripts in your environment before moving them to production. 

 

Conclusion

 

This script extends the capabilities of original Linux re-IP script presented in this post by using VBR re-IP rules in VRO plan custom steps. 

Great to see you improved the script already out there Razvan.  Maybe 2025 will let me play more with VRO to test this out.  😂


Comment