AIX NIM Server Setup Guide
AIX NIM Server Setup Guide
html
NIM Concept
Network Installation Management (NIM) for AIX allow centralized software management for distributed AIX environment. It
allows to take backups (mksysb) to central repository over network, do fresh install or reinstall from mksysb image, do online AIX
updates or installing additional software packages.
NIM environment includes NIM server, resources and clients. It is possible to set number of NIM servers, while one of them master
and others are alternates. This may be reasonable for distributed multisites networks. NIM server keeps knowledge about resources
and manage all processes in NIM. Resources are directories or files resides somewhere on NIM network that are avaliable for NIM
operations through NFS. Client is an object for NIM operations.
The most important resources are: lpp_source, spot, bosinst_data, resolv_conf. An lpp_source resorce contain plain
lpp AIX packages with .toc created. It is avaliable for client for installing and updating software. A spot resource (SPOT - Shared
Product Object Tree) is a directory with preinstalled AIX software. A spot resource mounted as /usr at client when it booted from
network. A bosinst_data is a file for unattendent AIX installation. It required for client (re)installions. A resolv_conf is a file, just
copy of /etc/[Link]. This resource may be differ for different subnets.
All operations in NIM environment are started from NIM server. Server allocates resources for client and locks them available for
this operation only until finished. Allocated resources are exported as NFS automatically. That is why resources should resides on
local disks, not on NFS shares.
Two additional services started to allow network boot: TFTP and BOOTP. When NIM operation request client to boot from
network, NIM creates appropriate records in /etc/bootptab and required files in /tftpboot. These files and records are
removed automatically after successfull finish of NIM procedure or by maintenance command.
NIM Server
Setting Environment
DNS resolution is very important for NIM environment. NIM server and clients should be resolvable by DNS or DNS should be
totally disabled. Server should have reasoanble amount of available disk space on local disks. SPOT resource takes up to 800M,
lpp_source can be about 2,5G (all packages), mksysb(s) may be hudge even compressed.
As a beginning you should create somewhere directory with all available lpp. I've prepared an NFS volume netapp:/vol
/source_install and mount it under /mnt. After that a shortcut smitty bffcreate brings to you the following screen:
[Entry Fields]
* INPUT device / directory for software /dev/cd0
* SOFTWARE package to copy [all] +
* DIRECTORY for storing software package [/mnt/AIX5.3/5300-04]
DIRECTORY for temporary storage during copying [/tmp]
EXTEND file systems if space needed? no +
Process multiple volumes? yes +
The next step is about to create NIM environment. There is niminit command, but the easiest way to create NIM environment is
to use smitty setup_eznim_master shortcut:
[Entry Fields]
Select or specify software source [/mnt/AIX5.3/5300-04] +
to initialize environment
Options
CREATE system backup image? [yes] +
CREATE new Filesystem? [yes] +
DISPLAY verbose output? [no] +
A "software source" may be your CDROM (you will swap AIX CDs during process), an lpp_source from other NIM environment,
or directory with AIX lpp packages. I gave a directory, created by smitty bffcreate method described above, named
filesystem as /NIM/eznim and pressed Enter.
Basic commands for NIM maintenance are nim and lsnim. Verify NIM environment with lsnim command:
root@mufasa:~ # lsnim
master machines master
boot resources boot
You can add more resources if you need. Use this command to add an lpp_source:
This command will create resource type lpp_source named lpp_433 on server master at /NIM/eznim/lpp_source
/lpp_433 directory.
A spot resource may be created from lpp_source only. Create a new spot resource by command:
This command will create spot named spot_433 on server master at /NIM/eznim/spot/spot_433 directory.
A bosinst_data resource is a file for unattendent installation. If you need to change default settings (I've changed the file to be
prompted during installation to have an opportunity select target disk(s)), copy existing file to a new name, make the changes and
register it with command:
Packages, missing in lpp_source, can be added manually directly to filesystem, for example to /NIM/eznim/lpp_source
/lpp_latest/installp/ppc. Then update .toc file and inform NIM about changes, like:
root@mufasa:~ # cd /NIM/eznim/lpp_source/lpp_latest/installp/ppc
root@mufasa:/NIM/eznim/lpp_source/lpp_latest/installp/ppc # inutoc .
root@mufasa:/NIM/eznim/lpp_source/lpp_latest/installp/ppc # nim -o check lpp_latest
Sometime you need update your lpp_source with patches. Put patches somewhere else and issue command:
Then update your spot from updated lpp_source should be performed by command:
Copying one resource to other (to freeze specific oslevel resource) is same as create:
Once lpp_source copied and updated, you will want to clean it from obsolete and duplicate packages. Here is an example:
An RSH connection from master to client have to be enabled for NIM operations. It is about rshd and rexecd (rlogind does not
required at all). Root shell on client computer should be either sh, ksh or bash (worked).
It is much better when client well defined at DNS. /etc/hosts workarounds may works in some cases.
Add client at NIM server as first step. Use smitty nim_mkmac shortcut and supply FQDN (fully qualified domain name) as
hostname. An nslookup will be performed. If client IP resides in already known to NIM subnet, you will get the following window:
Define a Machine
[Entry Fields]
* NIM Machine Name [simba]
* Machine Type [standalone] +
* Hardware Platform Type [chrp] +
Kernel to use for Network Boot [mp] +
Communication Protocol used by client [] +
Primary Network Install Interface
* Cable Type bnc +
Network Speed Setting [] +
Network Duplex Setting [] +
* NIM Network ent-Network1
* Host Name [Link]
Network Adapter Hardware Address [0]
Network Adapter Logical Device Name []
IPL ROM Emulation Device [] +/
CPU Id []
Machine Group [] +
Comments []
However, if client IP comes from undefined yet subnet, you will be asked to select type of network interface (TokenRing, Ethernet,
FDDI, ATM) and more detailed window will be opened:
Define a Machine
[Entry Fields]
* NIM Machine Name [simba]
* Machine Type [standalone] +
* Hardware Platform Type [chrp] +
Kernel to use for Network Boot [mp] +
Communication Protocol used by client [] +
Primary Network Install Interface
Machine Type should be standalone, we have no diskless stations. Kernel (mp or up) will be set automatically if client register
itself. However, fresh install of new machines requires select correct kernel. Cable Type is unimportant. NIM Network is name of
that segment, you can use default generated name or enter your own. Subnet Mask and both gateways are required, otherwise server
and client cannot connect each other.
This way you can define any client, even new machines you want to install from scratch. However already installed machines can
register themselfs. Use shortcut smitty setup_eznim_client at client:
[Entry Fields]
* Machine Name [simba]
* Primary Network Install Interface [en1] +
* Host Name of Network Install Master [mufasa]
Machine Name is a handy name for client. Select correct network interface as primary. Select correct kernel type (usually mp).
Press Enter. The client will connect master, updates its info and creates /etc/niminfo file. You can remove the file and repeat
the procedure.
Basic Operations
Taking Backup (mksysb)
The quick and durty way is to use smitty backup_client_eznim shortcut on the NIM master. Select by PF4 a desired
client. You cannot set image name or location using this interface.
This command will perform mksysb with flags "-em" on simba and locate it as /NIM/eznim/mksysb/simba
/weekly_mksysb on master. If there is sysb_simba_7 NIM object already exist, the previous command will be failed.
Remove the previous resource by command:
This command remove the NIM object only, but the file remain. Remove it manually, if desired.
Here is more complicated script that takes mksysb of all NIM clients. Script run on NIM master as cron job.
#!/usr/bin/bash
#
# Take a mksysb image using NIM interface
# and put in in "current" directory. The previous
# image moved to "prevous" directory.
MKSYSB_ROOT=/NIM/eznim/mksysb
export PROG=$0
export STAMP=$(date "+%Y%m%d")
die() {
echo -e "$(hostname):$PROG :\n $@" | mail -s "NIM warnings and errors" root
exit 1
}
take_sysb() {
CLIENT=$1
SYSB=$MKSYSB_ROOT/current/$CLIENT
SYSBNAME=sysb_$CLIENT
# Take a mksysb:
OPT="-a server=master -a source=$CLIENT -a location=$SYSB"
# mksysb options:
# m option creates maps, what make difficults to restore on other machine
# e option exclude files from /etc/[Link]
#OPT="$OPT -a mk_image=yes -a mksysb_flags=em"
OPT="$OPT -a mk_image=yes -a mksysb_flags=ei"
#OPT="$OPT -a comments='done on "$(date)"'"
return 0
}
# cat /etc/[Link]
^./tmp/
/core$
Reinstall Client
Reinstall client involves booting the client from NIM server (network boot), mounting relevant resources as NFS, restore BOS
image either from mksysb or boot image and apply updates form lpp_source.
The whole process slightly differ for alive NIM client and dead clients. While alive NIM clients accept commands from NIM
master, a dead client requires manual intervention in boot process.
Use smitty nim_bosinst shortcut to initiate a reinstall procedure. Select a target client. Client should be defined as described
previously. Select type of installation. It may be rte - new fresh installation, or mksysb - restore from previuosly taken image.
You will be asked for other questions depending on type of installation. An lpp_source should be at os level you want to install
AIX. A spot resource should be at level of mksysb image (mksysb type of installation) or lpp_source level for fresh install. A final
screen appear:
installp Flags
COMMIT software updates? [yes] +
SAVE replaced files? [no] +
AUTOMATICALLY install requisite software? [yes] +
EXTEND filesystems if space needed? [yes] +
OVERWRITE same or newer versions? [no] +
VERIFY install and check file sizes? [no] +
ACCEPT new license agreements? [yes] +
(AIX V5 and higher machines and resources)
Preview new LICENSE agreements? [no] +
This is an example of mksysb type installation. While an lpp_source resource does not required in this screen, NIM will assign it
automatically by its own dessision, so it is important to select desired lpp_source. Pay attention for "ACCEPT new license
agreements" parameter appear twice in this screen. One is for BOS installation and second for update from lpp_source. It is
important to say "no" here for AIX < v5, because installp procedure does not accept a "-Y" argument and will fail. However it is
important to say "yes" here for AIX > v5, because installation will fail on license agreement.
If you have number of bosinst_data resources, select the desired. A "FORCE PUSH the installation" recommended to be "no".
Other important parameters are different for alive and dead NIM clients. If "Set bootlist for installation" option is sat to "yes", a
NIM server will try to contact with NIM client and rewrite its bootlist for network installation. While it is good for alive NIM client,
this operation will failed for dead NIM client. Another option which also required communication between NIM server and client is
"Initiate reboot and installation now". The decision is up to you for alive NIM client. Would you like to reinstall it now or at the end
of business day. This option should be "no" for dead client.
After verifying all fields, press Enter to submit a procedure. Exit from smitty and verify status with lsnim command:
An lsnim command show resources "allocated" to this client. You can verify this by exportfs command. As you can see,
resources are NFS exported for exlusive use by client:
root@mufasa:~ # exportfs
/NIM/eznim/spot/spot_latest/usr -ro,root=[Link]:,access=[Link]:
/NIM/eznim/lpp_source/lpp_latest -ro,root=[Link]:,access=[Link]:
/NIM/eznim/mksysb/pumba_sysb -ro,root=[Link]:,access=[Link]:
/export/nim/scripts/[Link] -ro,root=[Link]:,access=[Link]:
root@mufasa:~ #
A line with definitions added to /etc/bootptab. The most important attribute here is "bf" - boot file, that resides at /tftpboot
directory.
This is a kernel image that know to read /tftpboot/[Link] and continue with a procedure according its
content.
export NIM_CONFIGURATION=standalone
export NIM_MASTER_HOSTNAME=mufasa
export NIM_MASTER_PORT=1058
export NIM_REGISTRATION_PORT=1059
export NIM_SHELL="shell"
export NIM_LICENSE_ACCEPT=yes
export RC_CONFIG=rc.bos_inst
export NIM_BOSINST_ENV="/../SPOT/usr/lpp/[Link]/nim/methods/c_bosinst_env"
export NIM_BOSINST_RECOVER="/../SPOT/usr/lpp/[Link]/nim/methods/c_bosinst_env -a hostname=simb
export SPOT=mufasa:/NIM/eznim/spot/spot_latest/usr
export NIM_CUSTOM="/../SPOT/usr/lpp/[Link]/nim/methods/c_script -a location=mufasa:/export/nim
export NIM_BOS_IMAGE=/NIM_BOS_IMAGE
export NIM_BOS_FORMAT=mksysb
export NIM_HOSTS=" [Link]:[Link] [Link]:mufasa "
export NIM_MOUNTS=" mufasa:/NIM/eznim/lpp_source/lpp_latest:/SPOT/usr/sys/[Link]:dir mufasa:
export ROUTES=" default:0:[Link] "
root@mufasa:~ #
If a NIM client was alive client and you selected "yes" to set bootlist options to boot from network, a client will use BOOTP
protocol to get additional information, download by TFTP its kernel and continue with procedure.
If something goes wrong, or it is dead/new NIM client, you should manually configure client to boot from NIM server. It is about to
stop boot procedure by pressing 1 or F1 or whatever defined by your hardware and enter in boot menus. There are two places for
setup.
Locate in menus something called like IPL definitions or Remote Initial Program Load setup. At this menu, configure
client IP addres, NIM server IP aggress and default getaway to use for this connection. If both server and client resides on same
subnet use NIM server IP address for default gateway also.
Return to the main menu and select your Ethernet card as Install source. A boot procedure will start.
Depending on bosinst_data resource, a client can ask for console answers, like select target disks, whatever.
It is easy to install add-ons packages using NIM environment. Use smitty nim_inst_latest shortcut on NIM master. Select
a target client to install software. Select corresponding lpp_source.
Traditional "install software" window appear. The difference, that it is comes from client which use NFS mounted lpp_source.
Press PF4 to select desired software, "agree to licences" and Enter.
Alternate disk install allows you to copy your rootvg to alternate disk, apply any updates you want and set bootlist to boot from
new disk doing this online ! It shorts down time to reboot only (at least 15 min as it usual for iBM harware)
NIM alternate disk install added value that allows you restore foreign mksysb on alternate disk. However, it is impossible supply
also lpp_source to make update or get device drivers. So this is suitable to restore its own "old" mksysb, or other mksysb from
exactly same hardware.
Prepare client for alternate disk installation. It is required to have avaliable free disk(s) exactly as at rootvg. If there are only two
disks, that are mirrored in rootvg, you should break the mirror, do alternate installation, boot from second disk, verify installation,
remove old rootvg and rebuild mirror.
CLIENT disks preparing: break the mirror, sanitize boot sector, fix bootlist, free the disk:
# #$# Quorum is ON, should be off for mirrored volumes, fix it:
# chpv -c hdisk1
# bootlist -m normal hdisk0
# reducevg rootvg hdisk1
Configure NIM communication protocol to be RSH (nimsh fail in this phase). Enter smitty nim_config_services on
client and select SHELL as protocol.
At NIM server use smitty nimadm shortcut. "Perform NIM Alternate Disk Migration"
Select an lpp_source as desired update level. You have to fill corect target disk name. If your rootvg resides on more than one disks,
it is nessecary to write here exact number of free disks, separated by space.
Use smitty nim_alt_mksysb to restore mksysb image on alternate disks. The similar windows should apear. Fill the data
and press Enter.
Assiming, that a process worked, but you are not satisfied with results, you boot the client from the previous disk and HAVE TO
clean installation submitting at NIM master command smitty nimadm_clean.
If you are happy with the results, you should remove "old_rootvg" with command at client "alt_disk_install -X
[old_rootvg]" and rebuild mirror with commands:
OOOPS !! Does not work. NIM server can not connect with client and thought, that resources may be in use. But we know, that
installation should be cancelled at any price. The "state" mentioned at error message is about Cstate in lsnim command.
Lets "reset" the client state, as recommended. Once NIM server cannot connect with client, it refused to reset state. A "-F" flag
override this
A "Cstate" changed to "ready", while resources still allocated. Lets repeat a previous "deallocate" command:
Feel free to contact me if needed | Gmail: voleg4u @ gmail . com | WhatsApp: +972 507 601 914 | Skype: voleg4u
Search
Design by D
D44nniieell