Running the disaster recovery scripts

During a disaster recovery event, when the logical partitions (LPARs) move from the active site to the backup site, the IP addresses, subnet, and other network-related attributes change. If you want the backup environment to be the same as the source environment for the LPARs, you can use the disaster recovery scripts that collect the information from the source LPARs and reconfigures the backup LPARs to match the system name, adapter configuration, network parameters, volume group information, and clustering configuration.

The disaster recovery scripts are custom scripts that are available in the KSYS package. Run these scripts in the virtual machines to collect required information about the source LPAR and to use the collected information to re-create or import the environment in the recovered LPAR.

Consider the following prerequisites before you use the disaster recovery scripts:

  • The data_collection.ksh script must be run successfully on every LPAR in the source site.
  • The setup_dr.ksh script must be run successfully on every LPAR in the backup site.
  • All of the cluster LPARs must be running and must have network capability.

The disaster recovery scripts and sample files are described in the following table:

Table 1. Disaster recovery scripts and configuration files
Disaster recovery scripts or files Description
data_collection.ksh Collects the following information about the source environment:
  • System host name
  • Network adapter information
  • Host bus adapter (HBA) configuration
  • Domain Name System (DNS) server and domain
  • LPAR attributes
  • Volume group attributes and hard disk attributes
  • AIX® kernel (sys0) configuration
Note: This script must be installed on the source LPAR in the /usr/local/bin directory. The data_collection.ksh script must be run on the source LPARs regularly.

The data_collection.ksh script collects system information and places it in the following locations:

/usr/local/dr/data directory
Contains system-customized information.
/usr/local/dr/data_default directory
Contains information about the default parameters for each device.
setup_dr.ksh Reconfigures the environment of the backup LPAR to be the same as the source LPAR.
Note: All scripts must be installed in the /usr/local/bin/ directory of the source LPARs so that these scripts are also available in the backup LPARs during a disaster. You must run this script on the backup LPAR during a disaster recovery event.

Consider the following prerequisites before you run this script:

  • The LPAR must be started and running in the target site with the rootvg disk.
  • Root passwords must be acquired and used to start and log in to the backup LPARs.

The setup_dr.ksh script calls other scripts automatically to perform the following tasks:

  • Reconfigure the HBA adapters of the backup LPAR to be the same as the source LPAR.
  • Reconfigure the Ethernet adapter of the backup LPAR by reading the contents of the failover_config.cfg configuration file and set the host name, IP address, and the base network of the backup LPAR.
  • Reconfigure any additional Ethernet adapters on the backup LPAR by using the appropriate IP addresses.
  • Import any volume groups from the source LPAR to the backup LPAR.
failover_config.cfg Contains sample configuration file for information about the backup LPAR.
You must manually edit this file and fill appropriate information about the AIX operating system configuration in the backup LPAR that are listed as follows:
  • IP address of LPAR at the source site
  • IP address of LPAR at the backup site
  • Network netmask that must be used at the backup site
  • DNS server that must be used at the backup site
  • Network domain name that must be used at the backup site
  • Default gateway IP address that must be used at the backup site
Note: The updated failover_config.cfg file must be placed in the /usr/local/bin directory of the source LPAR.

After you complete the initial configuration on the source LPAR, complete the following steps:

  1. Copy the script and sample files from the following location in the KSYS node:
    /opt/IBM/ksys/samples/
  2. Install these script files in the following location of the source LPARs:
    /usr/local/bin/
  3. Edit the failover_config.cfg configuration file with the appropriate LPAR information and place it in the /usr/local/bin directory.
  4. Run the data_collection.ksh script regularly to collect the environment information. You can set your LPARs to run this script daily by using the AIX cron utility. For example, you can add the following line as a crontab entry to run this script daily at 1 AM:
    00 01 * * * /usr/local/dr_collection

When you move the source LPARs to the backup site during a disaster event, you can use the disaster recovery scripts to retain the environment of the source LPARs. The procedure to run the disaster recovery steps in the backup site assumes that the following prerequisites are met:

  • All the disaster recovery scripts are installed on the source LPARs.
  • The failover_config.cfg configuration file is manually edited with the appropriate backup LPAR information.
  • The data_collection.ksh script is successfully run on the source LPARs.
  • The failover_config.cfg configuration file is updated with the appropriate host name, IP address, netmask, name server that corresponds to the backup LPAR.
  • The disk replication and split operations copied all of the source data to the backup site.
  • The disk storage is available to the appropriate LPAR on the backup site.
  • A disaster occurred, and the source LPARs are moved to the backup LPARs.
  • The appropriate root passwords are acquired for the backup LPARs.
  • The appropriate DNS server is available at the backup location.
  • The backup LPARs are identified and are accessible through the HMC.

To run the disaster recovery scripts in the backup LPARs, complete the following steps:

  1. To check the /usr/local/dr/data directory for date and time stamps, run the following command:
    ls -la /usr/local/dr/data
    Verify whether the replication was complete.
  2. If the console messages are large, route the output to a file by running the following command:
    swcons /tmp/console.log
  3. Run the setup_dr.ksh script to reconfigure the backup LPAR host name, network IP addresses, and HBAs, and to import the volume groups.
    Note: The LPARs must be completely recovered by now.
  4. Verify the LPAR configuration to confirm the changes by completing the following checks:
    1. Run the hostname command to verify the LPAR host name.
    2. Run the ifconfig -a command to verify the LPAR IP address.
    3. Run the df or mount command to verify that all local file systems are mounted. Mount any unmounted file systems by using the mount command, if required.
    4. Run the lsps -a command to display all paging spaces and their status. For unavailable paging spaces, run the swapon command with the appropriate paging space to set the paging space to the active state.