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/resolv.conf. 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.
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:
Copy Software to Hard Disk for Future Installation Type or select values in entry fields. Press Enter AFTER making all desired changes. [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 + F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
Press Enter and swap CD when asked.
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:
Easy NIM - Setup the NIM Master environment Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] Select or specify software source [/mnt/AIX5.3/5300-04] + to initialize environment Select Volume Group for resources [rootvg] + Select Filesytem for resources [/NIM/eznim] Options CREATE system backup image? [yes] + CREATE new Filesystem? [yes] + DISPLAY verbose output? [no] + F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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.
As result of running, a two packages: bos.sysmgt.nim.master and bos.sysmgt.nim.spot installed, a NIM environment initiated and basic resources created. All steps may be done manually or through menus of smitty nim. This is unnessecary unless you want something very specific and have a lot of experience with NIM already (not you, if you reading this HOWTO).
Basic commands for NIM maintenance are nim and lsnim. Verify NIM environment with lsnim command:
root@mufasa:~ # lsnim master machines master boot resources boot nim_script resources nim_script mufasa networks ent lpp_latest resources lpp_source bosinst_prompt resources bosinst_data resolv_default resources resolv_conf spot_latest resources spot ent-Network1 networks ent
You can add more resources if you need. Use this command to add an lpp_source:
root@mufasa:~ # nim -o define -t lpp_source -a server=master \ -a location=/NIM/eznim/lpp_source/lpp_433 -a source=/mnt/AIX433 lpp_433
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:
root@mufasa:~ # nim -o define -t spot -a server=master \ -a location=/NIM/eznim/spot -a source=lpp_433 spot_433
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:
root@mufasa:~ # nim -o define -t bosinst_data -a server=master \ -a location=/NIM/eznim/5300-04bid_ow bosinst_prompt
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:
root@mufasa:~ # nim -o update -a packages=all -a source=/mnt/AIX5.3/530403 lpp_latest root@mufasa:~ # nim -o check lpp_latest
Then update your spot from updated lpp_source should be performed by command:
root@mufasa:~ # nim -o cust -a fixes=update_all -a lpp_source=lpp_latest spot_latest root@mufasa:~ # nim -o check spot_latest
Copying one resource to other (to freeze specific oslevel resource) is same as create:
root@mufasa:~ # nim -o define -t lpp_source -a server=master -a source=lpp_latest \ -a location=/NIM/eznim/lpp_source/lpp_5300-04-03 lpp_5300-04-03
Once lpp_source copied and updated, you will want to clean it from obsolete and duplicate packages. Here is an example:
root@mufasa:~ # nim -o lppmgr -a lppmgr_flags="-rbux" lpp_5300-04-03 root@mufasa:~ # nim -o check lpp_5300-04-03
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).
A package bos.sysmgt.nim.client should be installed on client (usually installed by default) while bos.sysmgt.nim.master and bos.sysmgt.nim.spot packages should be uninstalled. Presenting of these two packages causing client add to fail with message is_alternate required. This is a way you can setup alternate NIM server but not client.
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 Type or select values in entry fields. Press Enter AFTER making all desired changes. [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 simba.domain.com Network Adapter Hardware Address [0] Network Adapter Logical Device Name [] IPL ROM Emulation Device [] +/ CPU Id [] Machine Group [] + Comments [] F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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 Type or select values in entry fields. Press Enter AFTER making all desired changes. [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 N/A + Network Speed Setting [] + Network Duplex Setting [] + * NIM Network [ent-Network2] * Network Type ent * Ethernet Type Standard + * Subnetmask [255.255.252.0] * Default Gateway Used by Machine [10.128.28.1] * Default Gateway Used by Master [10.128.8.1] * Host Name simba.domain.com Network Adapter Hardware Address [0] Network Adapter Logical Device Name [] IPL ROM Emulation Device [] +/ CPU Id [] Machine Group [] + Comments [] F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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.
Press Enter to continue.
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:
Easy NIM - Client Configuration Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Machine Name [simba] * Primary Network Install Interface [en1] + * Host Name of Network Install Master [mufasa] Hardware Platform Type chrp Kernel to use for Network Boot [mp] + F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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.
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.
You can use command nim to take a backup:
root@mufasa:~ # nim -o define -t mksysb -a server=master \ -a location=/NIM/eznim/mksysb/simba/weekly_mksysb \ -a mk_image=yes -a mksysb_flags=em sysb_simba_7
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:
root@mufasa:~ # nim -o remove sysb_simba_7
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 } [ -x /usr/sbin/nim ] || die "No NIM executable found" [ -d $MKSYSB_ROOT ] || die "No $MKSYSB_ROOT directory found" [ -d $MKSYSB_ROOT/current ] || mkdir $MKSYSB_ROOT/current [ -d $MKSYSB_ROOT/previous ] || mkdir $MKSYSB_ROOT/previous take_sysb() { CLIENT=$1 SYSB=$MKSYSB_ROOT/current/$CLIENT SYSBNAME=sysb_$CLIENT # can I perform operations on CLIENT ? if ! nim -o showlog $CLIENT >/dev/null 2>&1 ; then WARN=$WARN" Skipping $CLIENT mksysb creation, cannot talk with $CLIENT. Either NIM configuration is wrong, or there is network problem. Backup of next client will be performed." return 1 fi # Find defined NIM object and remove it: if lsnim $SYSBNAME ; then nim -o remove $SYSBNAME [ -f $SYSB ] && mv -f $SYSB $MKSYSB_ROOT/previous/ fi # 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/exclude.rootvg #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)"'" MSG=$(nim -o define -t mksysb $OPT $SYSBNAME 2>&1) [ $? -ne 0 ] && die "mksysb of $CLIENT may be bad. Here is a failure message:\n$MSG" return 0 } # Find client to backup and select next with warning. for client in $(lsnim -c machines|awk '{print $1}') ; do N=$(find $MKSYSB_ROOT/current -type f -mtime -14|grep -c $client) if [ $N -eq 0 ] ; then take_sysb $client && break fi done [ 'x'"$WARN" != 'x' ] && die "$WARN"
Maintain /etc/exclude.rootvg file on clients to exclude junk files, for example:
# cat /etc/exclude.rootvg ^./tmp/ /core$
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:
Install the Base Operating System on Standalone Clients Type or select values in entry fields. Press Enter AFTER making all desired changes. * Installation Target simba * Installation TYPE mksysb * SPOT spot_latest LPP_SOURCE [lpp_latest] + MKSYSB pumba_sysb BOSINST_DATA to use during installation [] + IMAGE_DATA to use during installation [] + RESOLV_CONF to use for network configuration [] + Customization SCRIPT to run after installation [] + Customization FB Script to run at first reboot [] + ACCEPT new license agreements? [yes] + Remain NIM client after install? [yes] + PRESERVE NIM definitions for resources on [yes] + this target? FORCE PUSH the installation? [no] + Initiate reboot and installation now? [no] + -OR- Set bootlist for installation at the [no] + next reboot? Additional BUNDLES to install [] + -OR- Additional FILESETS to install [] + (bundles will be ignored) 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] + Group controls (only valid for group targets): Number of concurrent operations [] # Time limit (hours) [] # Schedule a Job [no] + YEAR [] # MONTH [] +# DAY (1-31) [] +# HOUR (0-23) [] +# MINUTES (0-59) [] +# F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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:
root@mufasa:~ # lsnim -l simba simba: class = machines type = standalone connect = shell platform = chrp netboot_kernel = mp if1 = mufasa simba.domain.com 0004AC9EBE9A ent1 cable_type1 = N/A Cstate = BOS installation has been enabled prev_state = ready for a NIM operation Mstate = currently running boot = boot lpp_source = lpp_latest mksysb = pumba_sysb nim_script = nim_script spot = spot_latest cpuid = 0041CF0A4C00 control = master root@mufasa:~ #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=simba.domain.com:,access=simba.domain.com: /NIM/eznim/lpp_source/lpp_latest -ro,root=simba.domain.com:,access=simba.domain.com: /NIM/eznim/mksysb/pumba_sysb -ro,root=simba.domain.com:,access=simba.domain.com: /export/nim/scripts/simba.script -ro,root=simba.domain.com:,access=simba.domain.com: root@mufasa:~ #A line with definitions added to /etc/bootptab. The most important attribute here is "bf" - boot file, that resides at /tftpboot directory.
root@mufasa:~ # tail -1 /etc/bootptab simba.domain.com:bf=/tftpboot/simba.domain.com:ip=10.128.8.106:ht=ethernet:ha=0004AC9EBE9A:sa=10.128.8.102:sm=255.255.252.0: root@mufasa:~ # ls -l /tftpboot/ total 23864 drwxr-xr-x 2 root system 256 Jul 11 15:16 lost+found lrwxrwxrwx 1 root system 33 Aug 03 11:22 simba.domain.com -> /tftpboot/spot_latest.chrp.mp.ent -rw-r--r-- 1 root system 1100 Aug 03 11:22 simba.domain.com.info -rw-r--r-- 1 root system 12212224 Aug 01 13:35 spot_latest.chrp.mp.ent root@mufasa:~ #This is a kernel image that know to read /tftpboot/simba.domain.com.info and continue with a procedure according its content.
root@mufasa:~ # cat /tftpboot/simba.domain.com.info #------------------ Network Install Manager --------------- # warning - this file contains NIM configuration information # and should only be updated by NIM export NIM_NAME=simba export NIM_HOSTNAME=simba.domain.com 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/bos.sysmgt/nim/methods/c_bosinst_env" export NIM_BOSINST_RECOVER="/../SPOT/usr/lpp/bos.sysmgt/nim/methods/c_bosinst_env -a hostname=simba.domain.com" export SPOT=mufasa:/NIM/eznim/spot/spot_latest/usr export NIM_CUSTOM="/../SPOT/usr/lpp/bos.sysmgt/nim/methods/c_script -a location=mufasa:/export/nim/scripts/simba.script" export NIM_BOS_IMAGE=/NIM_BOS_IMAGE export NIM_BOS_FORMAT=mksysb export NIM_HOSTS=" 10.128.8.106:simba.domain.com 10.128.8.102:mufasa " export NIM_MOUNTS=" mufasa:/NIM/eznim/lpp_source/lpp_latest:/SPOT/usr/sys/inst.images:dir mufasa:/NIM/eznim/mksysb/pumba_sysb:/NIM_BOS_IMAGE:file " export ROUTES=" default:0:10.128.8.1 " 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:
# unmirrorvg rootvg hdisk1 # #$# Quorum is ON, should be off for mirrored volumes, fix it: # chvg -ay -Qn rootvg # chpv -c hdisk1 # bootlist -m normal hdisk0 # reducevg rootvg hdisk1 # #$# Some LV had no mirror by mistake, move them like: # /usr/sbin/mklvcopy -k fslv00 2 hdisk0 # /usr/sbin/rmlvcopy fslv00 1 hdisk1 # 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.
If bos.alt_disk_install.rte missing in spot_latest on NIM master, it should be installed using command:
root@mufasa:~ # nim -o cust -a filesets=bos.alt_disk_install.rte -a lpp_source=lpp_latest spot_latest root@mufasa:~ # nim -o check spot_latest
At NIM server use smitty nimadm shortcut. "Perform NIM Alternate Disk Migration"
Perform NIM Alternate Disk Migration Type or select values in entry fields. Press Enter AFTER making all desired changes. * Target NIM Client [simba] + * NIM LPP_SOURCE resource [lpp_latest] + * NIM SPOT resource [spot_latest] + * Target Disk(s) to install [hdisk1] DISK CACHE volume group name [] + NIM IMAGE_DATA resource [] + NIM BOSINST_DATA resource [] + NIM EXCLUDE_FILES resource [] + NIM INSTALLP_BUNDLE resource [] + NIM PRE-MIGRATION SCRIPT resource [] + NIM POST-MIGRATION SCRIPT resource [] + Phase to execute [all] + NFS mounting options [] Set Client bootlist to alternate disk? yes + Reboot NIM Client when complete? no + Verbose output? no + Debug output? no + ACCEPT new license agreements? yes + F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
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.
Do not forget "Accept license"
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:
# extendvg -f rootvg hdisk0 # mirrorvg -S rootvg hdisk0 0516-1126 mirrorvg: rootvg successfully mirrored, user should perform bosboot of system to initialize boot records. Then, user must modify bootlist to include: hdisk0 hdisk1. # bosboot -ad hdisk0 bosboot: Boot image is 45328 512 byte blocks. # bootlist -m normal hdisk0 hdisk1
A command nim -o deallocate should release a resource(s) from client. Here is an example of initated reinstall as described above, that we want abort because of some reasons. Look for allocated resources by exportfs and lsnimcommands.
root@mufasa:~ # lsnim -l simba simba: class = machines type = standalone connect = shell platform = chrp netboot_kernel = mp if1 = mufasa simba.domain.com 0004AC9EBE9A ent1 cable_type1 = N/A Cstate = BOS installation has been enabled prev_state = ready for a NIM operation Mstate = currently running boot = boot lpp_source = lpp_latest mksysb = pumba_sysb nim_script = nim_script spot = spot_latest cpuid = 0041CF0A4C00 control = master root@mufasa:~ #
Lets free resources locked for this operation:
root@mufasa:~ # nim -o deallocate -a lpp_source=lpp_latest -a mksysb=pumba_sysb -a spot=spot_latest simba 0042-001 nim: processing error encountered on "master": warning: 0042-302 m_deallocate: the state of "simba" prevents this operation from succeeding. Use the "reset" operation to correct its state then retry the intended operation.
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
root@mufasa:~ # nim -F -o reset simba root@mufasa:~ # lsnim -l simba simba: class = machines type = standalone connect = shell platform = chrp netboot_kernel = mp if1 = mufasa simba.domain.com 0004AC9EBE9A ent1 cable_type1 = N/A Cstate = ready for a NIM operation prev_state = BOS installation has been enabled Mstate = currently running lpp_source = lpp_latest mksysb = pumba_sysb spot = spot_latest cpuid = 0041CF0A4C00 control = master Cstate_result = reset root@mufasa:~ #
A "Cstate" changed to "ready", while resources still allocated. Lets repeat a previous "deallocate" command:
root@mufasa:~ # nim -o deallocate -a lpp_source=lpp_latest -a mksysb=pumba_sysb -a spot=spot_latest simba root@mufasa:~ # # Remove all in once: root@mufasa:~ # nim -o deallocate -a subclass=all simba root@mufasa:~ # exportfs exportfs: 1831-182 nothing exported root@mufasa:~ # lsnim -l simba simba: class = machines type = standalone connect = shell platform = chrp netboot_kernel = mp if1 = mufasa simba.domain.com 0004AC9EBE9A ent1 cable_type1 = N/A Cstate = ready for a NIM operation prev_state = BOS installation has been enabled Mstate = currently running cpuid = 0041CF0A4C00 Cstate_result = reset root@mufasa:~ #