content_image/1001098.jpg content_image/1001099.jpg
For the contents on these customized files, see Table 1-8 and Table 1-9. 

<img src='content_image/1001098.jpg'>

<img src='content_image/1001099.jpg'>

## Creating the script to copy appropriate customized file to the system file 

Create the script that copies the appropriate customized files to the system files. This script is named /usr/sbin/vmr_dr_ip_conf.sh . This file uses the Bash shell, and its full content is as follows: 

#!/bin/bash # SERIAL=$(/usr/bin/cat /proc/device-tree/system-id | /usr/bin/awk -F, '{print $2}') cp -p /etc/sysconfig/network-scripts/$SERIAL.ifcfg-net0 /etc/sysconfig/network-scripts/ifcfg-net0 cp -p /etc/$SERIAL.hostname /etc/hostname 

This file copies each of the customized system files to the appropriate standard system file depending on which host (by serial number) the VM is operational. 

## Creating the systemd unit file 

For our sample environment, we create and configure the systemd  unit file that runs the vmr_dr_ip_conf.sh  as /etc/systemd/system/vmr_dr_ip_conf.service . We create this file and use the vi  editor to add the following content: 

[Unit] Description=Set IP conf based on system serial Before=network-pre.target Wants=network-pre.target DefaultDependencies=no Requires=local-fs.target After=local-fs.target 

