Wednesday, 14 September 2011

NIM explained

NIM explained

General information

NIM is a system to systematically install, update and maintain AIX machines (NIM clients) from one specialized system (the NIM server). One can use the system do maintain diskless workstations or dataless workstations too, but (to my knowledge) this is rarely used. The vast majority of NIM servers is used to install machines - "standalone clients" in NIMs wording - and i will concentrate on this aspect.

There are three basic types of resources a NIM server can employ to install clients: mksysbs, SPOTs and LPP-sources. There are some other resources of minor importance which you will probably not have to deal with.

MKSYSB is an installable and bootable image of the rootvg of a machine. since the rootvg contains all the really important filesystems (/, /usr, /etc, and so on) it is easy to use this as a means of installing machines. MKSYSBs are used in two ways usually: you can create and maintain a very simple, very basic MKSYSB and use that as the basis for every installation. You would install this mksysb which woulkd contain only the absolute minimum and then add software until the desired configuration is reached. The second way to use MKSYSBs is to create one from a running machine as a means to take a "configuration snapshot", complete with all the configured users, filesystems, printqueues, etc.. If the hardware breaks you could use this image to restore the machine quickly.

The next resource is a LPPSOURCE. This is just a bunch of installable packages in a directory with a name to go by. NIM will provide ways to find out which packages are in it, replace selected packages, etc. But in fact this is just a collection of installp-packages and a name to handle the collection as a whole.

The third resource is the SPOT (Shared Product Object Tree). You can create a SPOT from an lpp_source by "installing" into it. Think of it as a shareable /usr-filesystem. During a nim-installation the system would (nfs-)mount such a SPOT and use it and its executables to install to its local disk - say, by restoring a mksysb image, installing some packages from a lpp_source, etc. It is the NIM-equivalent of the initial RAMdisk-system a linux system comes up with after booting from a CD.

How to set up a basic nim-server

First install the nim.server-package onto the machine and configure it. This can be done using some SMITTY panels and the panels are pretty self-explanatory. This part is really easy. You have to provide a "root" directory where the nim-resources will reside later. For this you will need lots - really lots - of space. Start with a minimum of 50-100G for testing purposes but be prepared to increase this as soon as you start using the system regularly. Note too, that a nim server always has to be at least at the same OS level (including maintenance levels, technical levels, etc.) as the clients it is serving. If you want to server 5.2 clients have the nim server at least at the same level, better at 5.3, latest ML.

The next part is to create a lpp-source. Again use the SMIT panels, use "smitty nim" to get into smittys main nim menu, "perform NIM Administration Tasks"/"Manage Resources"/"Define a Resource" - select "lpp_source" from the menu and follow the directions. Do yourself a favor and copy the installation media somewhere prior to this and tell the machine where to find it - otherwise you will now have to feed it the disks for a few hours.

It is a good idea to not delete the copies of the installation media, but save them in case you need to update the lpp_source later. Since you may have to maintain several revision levels in parallel do NOT just update what you have, instead create a new copy and update *this*. (By now you will probably understand why you need so much space. ;-)) )

After creating the lpp_source (it takes some time) you are ready to create a SPOT from it. This means basically to do an installation on a pseudo-machine which consists only of a /usr-filesystem. Again go to the SMIT menu "define a resource" and select "spot", then follow the directions using the newly created lpp_source as "source of install images". This will take a few hours. It is a good idea to update the created spot several times using this lpp_source, as some dependencies are (rarely, but why take the risk) solved only after several tries. after every run look if there has something been changed in the spot, if nothing changes any more you are finished.

It is also a good idea to create some strict naming convention for the resources. I usually inlude the type of resource and the exact software level, like:

lpp_source: lpp_AIX53_ML03
spot: spot_AIX53_ML03
mksysb: mks_AIX53_ML03

There no better or worse solution to that, just be consistent with yourself.

After having a lpp_source and a spot (there are some other resources like boot code for IPL ROMs, etc. which are created automatically in this process) you are ready to start a test installation. You will need a scratch machine for that.

Start by writing down the MAC adress of the interface you will use to install over later. This information is needed on the nim server. Now define a new client ("Manage machines"/"Define a machine" and follow the directions) and fill out the form coming up. "Network Adapter Hardware Adress" is where you put in the MAC adress.

After having defined the client use lsnim to see an overview of your defined resources so far, lsnim -l to get detail information about each resource. You are now ready to do your first installation.

Use the SMIT menu "Perform NIM Administration Tasks"/"Manage Machines"/Managae Network Install Resource Allocation" to allocate the SPOT and the lpp_source to your machine. Note that this is only valid for ONE TRY. You will have to allocate these resources again for the next installation. This way you have complete control over what happens with the resources you provide with your NIM master.

Note: If resource confilicts happen (yes, this is a somewhat unreliable part of NIM, the deallocation of resources is not always handled properly) use "Deallocate Network Install Resources with the "Force" option, this usually cleans things up. For the deallocation ALWAYS use the "force" option.

Upon the allocation nim will itself make all the necessary entries in /etc/exports to nfs-export the allocated resources to the machine. Strange effects happen if you export these directories (or super-directories of it) yourself. If you experience problems there check /etc/exports, correct it if necessary (remove your entries) and run "exportfs -va" to use the new configuration.

Boot your client now to the POST-menu, enter the ip-adress of the nim-server as a server holding the boot image and the machine should start to install. First the initial kernel is loaded via tftp (you will have to provide some filespace for /tftpboot on the NIM master), then the SPOT and lpp_source are used to install the machine.

After this and WITHOUT doing any configuration work on the machine use "Define a Resource" on the master to create a new resource of type mksysb and use the newly installed machine to create it. This way you will have to missing mksysb as a starting image (therefore: no configuration, unless you want it to be on every machine you will install in the future). You can use that to install other machines from this mksysb.

You can of course create other mksysbs (SPOTs, lpp_sources, ...) to fine-tune your installation process, but with the thing described here you will be initially up and running.

No comments:

Post a Comment

Twitter Bird Gadget