This document describes how to clone a mksysb image from one system to another using Network Installation Management (NIM). Information in this document is valid for AIX Version 4.1. For complete documentation on NIM, see InfoExplorer.
WARNING: This procedure is valid only with a mksysb image and will not work with a SYSBACK 6000 system backup.
/usr/sbin/mknfsexp -d /mksysb -t rw -r \
[hosts allowed root access ] -B
mkdir /mksysb
Enter the following if the directory does exist:
/usr/sbin/mount <NIMserver>:/mksysb /mksysb
mksysb -i /mksysb/clone.image
tctl -f /dev/rmt0 rewind
tctl -f /dev/rmt0.1 fsf 3
dd if=/dev/rmt0.1 of=/mksysb/clone.image bs=<tpebs>
The tpebs value is the blocksize of the fourth image.
The customized script is the source that will be doing all the work. To create the script, enter:
cd /mksysb
Using a favorite editor, create a file called cloner and enter the following text:
---------------------begin--------------------
#!/usr/bin/ksh
set -x
installp -C
RV=$(bootinfo -z)
if [ "$RV" -eq 1 ]
then
installp -abcgXd/../SPOT/usr/sys/inst.images bos.rte.mp
ln -fs /usr/lib/boot/unix_mp /usr/lib/boot/unix
fi
if [ "$RV" -eq 0 ]
then
installp -abcgXd/../SPOT/usr/sys/inst.images bos.rte.up
ln -fs /usr/lib/boot/unix_up /usr/lib/boot/unix
fi
devinstall -b -d /../SPOT/usr/sys/inst.images -f /../tmp/device.pkgs
cfgmgr -v -i /../SPOT/usr/sys/inst.images
BLVDISK=$(lslv -l hd5 | grep hdisk | head -1 | cut -d' ' -f1)
ln -f /dev/r$BLVDISK /dev/ipldevice
bosboot -a -d /dev/ipldevice
bootlist -m normal $BLVDISK
rm -f /etc/firstboot
sync;sync;sync
exit 0
-------------------end-------------------------
Save the file. Then change the permissions on the target file to 755 by entering:
chmod 755 cloner
Create the NIM environment by choosing and defining a master (see Network Installation Management Guide and Reference, Chapter 3, "Setting Up the Master and Managing Network Objects").
Each environment will be different, depending on the machine resources. Choosing which machine is the master, and which machine is the server, must be done based on the environment.
In the following steps, the master is the server for all resources. The CD-ROM is the lpp_source. This choice will save space, but it will also keep the CD-ROM busy until all of the client machines have been installed. This will cause an inconvience if you are using InfoExplorer from the CD-ROM.
Create a SPOT from the CD-ROM (see "Managing SPOT Resources" in InfoExplorer).
Create a separate 200MB file system called /414spot for a non-/usr SPOT. Select yes in response to the prompt Expand file systems if space needed?; the initial size of the file system does not matter. Volume group nimvg is also being used to create the file system. nimvg should be replaced with the volume group where the file system is to reside. Enter:
mklv -y spotlv nimvg 50
crfs -v jfs -d spotlv -m /414spot
mount /414spot
smitty nim_mkrew
spot = Shared Product Object Tree
* Resource Object Name [414spot]
* Resource Type spot
* Server of Resource [master]
* Source of Install Images [/dev/cd0]
* Location of Resource [/414spot]
Create an lpp_source with a CD-ROM. This saves space (see "Managing lpp_source Resources" in InfoExplorer). Enter:
crfs -v cdrfs -d /dev/cd0 -m /CD -p ro
mount /CD
smitty nim_mkres
lpp_source = source device for optional
product images
* Resource Object Name [414cd]
* Resource Type lpp_source
* Server of Resource [master]
* Location of Resource lbrk./CD/usr/sys/inst.images]
Define the standalone client (target) machine (see "Adding a Running Client to the NIM Environment" in InfoExplorer). Enter:
smitty nim_mac
Define a Machine Object
smitty nim_mkres
script = an executable file which is
executed on a client
Define a Resource Object
* Resource Object Name [cloner_script]
* Resource Type script
* Server of Resource [master]
* Location of Resource [/mksysb/cloner]
A customized bosinst.data file is usually created to enable "no-prompt" installs (see "Customizing the BOS Install Program" in InfoExplorer). Enter:
cp /usr/lpp/bosinst/bosinst.template /mksysb/bosinst.data
Using a favorite editor, open the file /mksysb/bosinst.data.
INSTALL_METHOD = overwrite
EXISTING_SYSTEM_OVERWRITE = yes
target_disk_data:
LOCATION =
SIZE_MB =
HDISKNAME =
smitty nim_mkres
bosinst_data = config file used during base
system installation
* Resource Object Name [clone_bosinst_data]
* Resource Type bosinst_data
* Server of Resource [master]
* Location of Resource [/mksysb/bosinst.data]
smitty nim_mkres
mksysb = an AIX mksysb image
* Resource Name [clone_mksysb]
* Resource Type mksysb
* Server of Resource [master]
* Location of Resource [/mksysb/mksysb.image]
Allocate the 414cd, 414spot, cloner_script, clone_bosinst_data (optional), and clone_mksysb. Enter:
nim -o allocate -a mksysb=clone_mksysb \
-a bosinst_data=clone_bosinst_data \
-a script=cloner_script \
-a spot=414spot -a lpp_source=414cd <client>
See "Initiating BOS Installation of Standalone Client" in InfoExplorer.
nim -o bos_inst -a source=mksysb <clientname>
nim -o bos_inst -a source=mksysb -a force_push=yes
nim -o bos_inst -a source=mksysb -a no_client_boot=yes
WARNING: THE USER MUST BE AT THE NIM CLIENT FOR THIS CASE.
When you are cloning to a platform with a different kernel type (for example, RS6K to RSPC), the first bosboot attempt will FAIL and a message will print asking if the user wishes to go into "maintenance mode" or "continue". Select "continue" and the cloner script will then run. Any additional output will not be seen until the copyright screen appears just before the system reboots. This problem has been corrected at AIX 4.1.5.0.
bootinfo -T rs6k, rs6ksmp, or rspc
bootinfo -z 0 = up (single processor)
1 = mp (multi processor)
If the source system is using D5 code and you suspect that cloning might be to a system other than the exact model, contact your AIX support center for assistance.
If the source system is using OpenGL or PEX_PHIGS, there may be some device filesets from these LPs that need to be installed on the target system after the cloning process. OpenGL and PEX_PHIGS have graphics-adapter-specific filesets that are on separate media, so if you are cloning onto a system with different graphics adapter, do the following on the target system:
echo OpenGL.OpenGL_X.dev > \
/usr/sys/inst.data/user_bundles/graphic_dev.bn
echo PEX_PHIGS.dev >> \
/usr/sys/inst.data/user_bundles/graphic_dev.bn
smitty custom_install_bundles (AIX 4.1)
echo OpenGL.OpenGL_X.dev >\
/usr/sys/inst.data/user_bundles/graphic_dev.bnd
echo PEX_PHIGS.dev >>\
/usr/sys/inst.data/user_bundles/graphic_dev.bnd
smitty custom_install_bundles (AIX 4.1)
If any filesets are installed, the system will need to be rebooted before using OpenGL and PEX_PHIGS; otherwise, performance problems may be experienced.
NOTE: If the OpenGL and PEX_PHIGS filesets are in the lpp_source, a separate bundle can be created and allocated with the mksysb.