Skip to main content

 

Introduction

While working with Veeam customers recently who wanted to automate Linux re-IP as part of their recovery process using Veeam Recovery Orchestrator (VRO), I started into some exploration to see if I could leverage any existing scripts that could be easily modified to accomplish this. I put my Google Fu to work and found numerous Linux re-IP scripts available online. Several such scripts have been specifically designed to work with Veeam during recovery or failover scenarios. However, when I started building out my lab and testing with some of these, I discovered that the existing scripts either rely on methods specific to certain Linux distributions or employ outdated/deprecated techniques to accomplish the re-IP.

 

Given the diversity of Linux distributions and network management tools, the exact method for re-IP can vary depending on the specific environment. My goal was to find a common method that would work for the foreseeable future and across multiple Linux distributions. I decided to start into creating and testing a new script using Network Manager as the method of choice.

 

Network Manager is installed by default in newer versions of RHEL (7+) and its branches (Rocky, Alma, CentOS, etc.) and in the latest releases of Ubuntu. Network Manager can also be installed and configured in other distributions as well. More info on Network Manager can be found here: https://networkmanager.dev/

 

To make these changes inside of a VM, we need a way to inject the Network Manager (nmcli) scripts into the VM Guest OS and either persist through or reconnect after the changes are made to verify the outcome. Since VRO currently only supports vSphere VM workloads, the script utilizes VMware PowerCLI to perform the in-guest scripting.  

 

The power of VRO in this scenario is that we can dynamically pass the VM info and credentials into the script and run multiple re-IP plan steps in parallel on a per-VM basis to make this scale up to fit our recovery plan needs and improve overall RTO.

 

The script and basic instructions can be found here: https://github.com/VeeamHub/veeam-orchestrator/tree/main/ReIPLinux/Original

 

For a detailed look into how this is configured and used, keep reading 😁.

 

Prerequisites

 

Configuration

  • Verify that the prerequisites are met
  • Download the PS1 script from Veeamhub and place it on the VRO server
  • Create a new Plan Step - https://helpcenter.veeam.com/docs/vro/userguide/uploading_scripts.html
    • Give the new Plan Step a name

       

    • Browse to the script path to import

       

    • Add the following required parameters

      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)
      VMName Name of the target VM Text %current_vm_name%
      VMOrigIP Original IP Address. Used to locate the network device to be modified. Text %current_vm_ip%
      ReIPRule Re-IP Rule to apply. Can use asterisk(*) to keep source IP values for an octet. Ex. 10.1.*.* or 10.0.1.* Text (Set a default value as needed)
      CIDR CIDR number for subnet mask. Ex. 24, 28, etc. Text (Set a default value as needed)
      NewGateway New gateway address. Text (Set a default value as needed)
      PrimaryDNS Primary DNS address. Text (Set a default value as needed)
      SecondaryDNS Secondary DNS address. Text (Set a default value as needed. You can leave this blank if no SecondaryDNS is needed)

       

    • (Optional) The following parameters are not required but can be used if necessary

      Name Description Type Default Value
      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')

       

    • For most errors that may occur, a retry will not resolve the issue. So to save time on the plan completion, I have set the “Retries” to 1. After all of the parameters are set it should look like the following:

       

    • The scope can be defined as needed on the “Impact” tab. I left this in the Default Scope for my use in testing.

    • Review the settings and then “Finish” to save this new Plan Step

  • Now that this Plan Step exists, we can add it to a Recovery Plan. There are a couple of ways to do this.
  • Set the parameter values needed per-VM or for all VMs in a plan (multi-select is available)
  • Run the plan or a DataLabs test to verify recoverability.

Conclusion

By leveraging PowerCLI and Network Manager (nmcli), we can automate the re-IPing of VMware Linux VMs during recovery and failover operations. This automation streamlines the process, reduces recovery time objectives, and enables efficient testing and verification of recovery plans. Detailed reports can be generated to provide insights into the effectiveness of our recovery strategies.

 

 

Really enjoy reading VRO posts as it helps to learn something new each time.  I still have not got this installed but plan to soon and start testing it.  Thanks for sharing.


Chris you been saying that for months, time to get VRO installed! We want to hear some of your VRO tales in the HERO DEN.


Chris you been saying that for months, time to get VRO installed! We want to hear some of your VRO tales in the HERO DEN.

🤣yeah I know.  It will get done next week for the install!  😋😜


Great article!
Thank you @tfewins  for spent time developing this method and share with us.

Very useful for one of our customers who is already running with VRO *bookmarked* 👋


@tfewins reminds me of a re-ip mechanism I looked a good few years back 

https://www.cragdoo.co.uk/2016/03/01/re-visit-linux-re-ip/

 

nice work !


@Cragdoo, that was some good work and posts on the process. I love the retro look of Veeam 6.5 😀.

The issues I ran into when first starting on this project is that the pre-existing methods mentioned in that R&D Forums post are all deprecated or being deprecated at this point. VMware’s Set-VMGuestNetworkInterface cmdlet is deprecated and modifying the Linux ifcfg-{interface} files in the network scripts folder is flagged as being deprecated (at least in RHEL v9).

Just hoping that Network Manager will stand the test of time and be more widely adopted since it unites the capabilities and process for managing network devices across Linux distributions. 🤞


I made an update for the script URL in this post because a new version with additional features has been added. The new branch of the script was added with capability to retrieve the reIP rules directly from VBR. Razvan Ionescu (ravatheodor) authored the new feature on top of the existing ReIP functionality. Its an exciting enhancement so please check it out! 

https://github.com/VeeamHub/veeam-orchestrator/tree/main/ReIPLinux

 

New blog post about walking through the configuration:

 


Comment