LPAR Disaster Recovery example

Scenario: we have two lpars, first is a WAS DMGR, the other is intended to be its backup if needed.

In order to avoid misalignments between the lpars we can take mksysb and saveg on a scheduled basis (at 4:00 am from monday to friday)

Backup:

0 4 * * 1-5 /export/nim/scripts/wnd8-dr.new.sh >/dev/null 2>&1

Script contents:

#!/usr/bin/ksh
for env in v u p
do CLIENT="wnd8"$env"01"
echo $CLIENT

LOG=/export/savevg/savevg.$CLIENT.log
echo "Starting..." | tee -a $LOG


nim -Fo remove mksysb-$CLIENT
nim -Fo remove savevg-$CLIENT

nim -o define -t mksysb -a server=master -a location=/export/mksysb/mksysb-$CLIENT -a source=$CLIENT -a mk_image=yes -a exclude_files=wnd8-dr-exclude mksysb-$CLIENT | tee -a $LOG
nim -o define -t savevg -a server=master -a location=/export/savevg/savevg-$CLIENT -a source=$CLIENT -a mk_image=yes -a savevg_flags=Xi -a volume_group=wsvg savevg-$CLIENT | tee -a $LOG

done

Restore:

The restvg operation is actually manual, we are evaluating an automatic recovery scheduled in the early hours of the morning to protect the environment from the loss of a dmgr.

1) Spot definition starting from mksysb

root@nim01:/# nim -o define -t spot -a server=master -a source=mksysb-wnd8p01 -a location=/export/spot/spot-wnd8p01 spot-wnd8p01

Creating SPOT in “/export/spot/spot-wnd8p01” on machine “master” from “mksysb-wnd8p01” …

Restoring files from BOS image. This may take several minutes …

Checking filesets and network boot images for SPOT “spot-wnd8p01”.
This may take several minutes …

2) bosinst operation execution

nim -o bos_inst -a source=mksysb -a mksysb=mksysb-wnd8p01vir-int -a spot=spot-wnd8p01vir-int -a accept_licenses=yes -a bosinst_data=bosinst_noprompt_wnd8p01vir_data -a no_client_boot=no wnd8p02vir-int

root@wnd8p02vir-int:/#

Broadcast message from root@wnd8p02vir-int (tty) at 17:13:36 ...

*******************************************************************
*******************************************************************
*******************************************************************

NIM has initiated a bos installation operation on this machine.
Automatic reboot and reinstallation will follow shortly...

*******************************************************************
*******************************************************************
*******************************************************************


Running /etc/rc.d/rc2.d/K45vxpbx_exchanged stop
Running /etc/rc.d/rc2.d/Ksshd stop
Running /etc/rc.d/rc2.d/Kwpars stop
Stopping TCP/IP daemons: ndpd-host lpd routed gated sendmail inetd named timed rwhod iptrace dpid2 snmpd rshd rlogind telnetd syslogd
Removing TCP/IP lock files

...

TFTP BOOT ---------------------------------------------------
Server IP.....................10.15.61.27
Client IP.....................10.15.61.168
Gateway IP....................10.15.61.27
Subnet Mask...................255.255.255.0
( 1 ) Filename................./tftpboot/wnd8p02vir-int
TFTP Retries..................5
Block Size....................512
FINAL PACKET COUNT = 59393
FINAL FILE SIZE = 30408704 BYTES

Elapsed time since release of system processors: 1892282 mins 17 secs




-------------------------------------------------------------------------------
Welcome to AIX.
boot image timestamp: 15:36:24 12/30/2020
The current time and date: 16:18:49 01/05/2021
processor count: 4; memory size: 16384MB; kernel size: 45241275
boot device: /vdevice/l-lan@30000003:speed=auto,duplex=auto,bootp,10.15.61.27,,10.15.61.168,10.15.61.27


...


Installing Base Operating System





Please wait...









Approximate Elapsed time
% tasks complete (in minutes)


13 1 9% of mksysb data restored.