#2272 Issue closed: Change network configuration during recovery

Labels: support / question, fixed / solved / done

carylewis opened issue at 2019-11-06 21:34:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.4 / Git

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"):
    OS_VENDOR=RedHatEnterpriseServer
    OS_VERSION=7

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

OUTPUT=ISO
OUTPUT_URL=null
#OUTPUT_URL=nfs://192.168.56.1/storage
BACKUP=RSYNC
#BACKUP_URL=nfs://192.168.56.1/storage
BACKUP_URL=rsync://root@......
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/media' '/var/tmp' '/var/crash')
NETFS_KEEP_OLD_BACKUP_COPY
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    BareMetal IBM Cloud SuperMicro

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    BIOS

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local disk

  • Description of the issue (ideally so that others can reproduce it):

I am trying to restore a server to a new server, in order to test the restore functionality.

Each bare metal server in the IBM Cloud gets its own static IP address.

This particular server has four nics, configured into two bonded nics, one for private and one for public.

Upon booting the rear iso, and selecting the new hardware mac addresses for the network cards, the network is not available, since the static IP address is not correct. Rear configures the bond1 interface with the original server's public static address.

For the purposes of the restore test, I don't need the private network to work.

My question is how to modify the rear setup scripts so that I can configure them to use the correct new static ip address?

I am trying to run the recover in debug mode, but there is no way to access another tty via the supermicro IPMI console access java app. So even though each function pauses before it runs, I can not edit them.

carylewis commented at 2019-11-08 15:21:

After upgrading to rear 2.5, I was able to successfully restore one bare metal machine to another.

The static IP address and default gateway still needs to be manually configured, it would be great if ReaR could have an option to prompt for what the new static ip addresses should be on the new machine. E.g. even after the restore, I had to manually edit the /etc/sysconfig/network-scripts to modify the MAC addresses and IP addresses, since the ones from the backup image were from the old machine. Which makes sense if you are recovering a backup image to the same exact machine, but doesn't work if you are testing the restore process on different hardware.

jsmeix commented at 2019-11-11 12:40:

@carylewis
thank you for your feedback how you made things working in your case.

I do not know much about the networking setup code in ReaR.
Personally I use basically always in /etc/rear/local.conf

USE_DHCLIENT="yes"

because I have a DHCP server running in my environment
that provides all I need in the ReaR recovery system
which is access to my NFS server where my backup is
(that NFS server is in the same network as the ReaR recovery system)
so my personal networking setup experience with ReaR is rather low.

To set up networking of the ReaR recovery system
you can use in particular config variables like

USE_STATIC_NETWORKING
USE_DHCLIENT
USE_RESOLV_CONF
NETWORKING_PREPARATION_COMMANDS
SSH_ROOT_PASSWORD

that are (more or less well) described in default.conf
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf
and/or you can specify kernel command line options,
see the section "RESCUE IMAGE KERNEL COMMAND LINE OPTIONS" in
https://github.com/rear/rear/blob/master/doc/rear.8.adoc

We even have a script
usr/share/rear/finalize/GNU/Linux/320_migrate_network_configuration_files.sh
https://raw.githubusercontent.com/rear/rear/master/usr/share/rear/finalize/GNU/Linux/320_migrate_network_configuration_files.sh
that is intended to migrate the basic networking configuration
but I never actually worked on it because "that code it [sic!] too obsure for me"
https://github.com/rear/rear/commit/d4ee9de5dfd2d4ebdac74b6d496f38518cf63491
so I don't know how migrating the networking configuration actually works.


[Export of Github issue for rear/rear.]