Friday, June 15, 2012

Setting up NIM Server

 Setting up NIM Master server: used AIX 7 but pretty much works the same for AIX 5 & 6
Install NIM Filesets(Client, Master and SPOT)
# smitty install_latest


Create Volume Group, loglv, and filesystem for NIM resources
# mkvg -f -S -s 128 -y nim_vg hdisk3
# mklv -t jfs2log -y nim_jfs2log nim_vg 1
# logform /dev/nim_jfs2log
# mklv -t jfs2 -y nim_base nim_vg 2
# crfs -v jfs2 -d /dev/nim_base -m /nim -p rw -A yes -u NIM
# mount /nim

Create Filesystem for Installation Images
# mklv -t jfs2 -y nim_images nim_vg 100
nim_images
# crfs -v jfs2 -d /dev/nim_images -m /nim/images -p rw -A yes -u NIM
File system created successfully.
13106596 kilobytes total disk space.
New File System size is 26214400
# mount /nim/images


Create Filesystem for LPP Sources
# mklv -t jfs2 -y nim_lppsrc nim_vg 100
nim_lppsrc
# crfs -v jfs2 -d /dev/nim_lppsrc -m /nim/lppsource -p rw -A yes -u NIM
File system created successfully.
13106596 kilobytes total disk space.
New File System size is 26214400
# mount /nim/lppsource


Creat Filesystem for SPOTS
# mklv -t jfs2 -y nim_spot nim_vg 30
nim_spot
# crfs -v jfs2 -d /dev/nim_spot -m /nim/spot -p rw -A yes -u NIM
File system created successfully.
3931836 kilobytes total disk space.
New File System size is 7864320
# mount /nim/spot


Verify the Filesystems Created
# df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          917504    341240   63%    11455    21% /
/dev/hd2        16646144    329032   99%    49881    54% /usr
/dev/hd9var      1179648    356512   70%     8470    17% /var
/dev/hd3         1966080   1949800    1%       99     1% /tmp
/dev/fwdump       262144    261448    1%        4     1% /var/adm/ras/platform
/dev/hd1          131072    103728   21%       25     1% /home
/dev/hd11admin     262144    261384    1%        7     1% /admin
/proc                  -         -    -         -     -  /proc
/dev/hd10opt      917504    540312   42%     7173    11% /opt
/dev/livedump     524288    523552    1%        4     1% /var/adm/ras/livedump
/dev/nim_base     524288    523488    1%        7     1% /nim
/dev/nim_images   26214400  26209744    1%        4     1% /nim/images
/dev/nim_lppsrc   26214400  26209744    1%        4     1% /nim/lppsource
/dev/nim_spot    7864320   7862464    1%        4     1% /nim/spot


 Initialize NIM
To initiatize nim on the server with IP: 10.62.137.109 & NetMask: 255.255.255.0, run the following
 # nimconfig -a netname=net_10_62_137 -a pif_name=en0 -a netboot_kernel=64 -a c>
0513-071 The nimesis Subsystem has been added.
0513-071 The nimd Subsystem has been added.
0513-059 The nimesis Subsystem has been started. Subsystem PID is 6946994.

Upon Initializing NIM, some base resources are created as shown below
# lsnim
master           machines        master
boot             resources       boot
nim_script       resources       nim_script
net_10_62_137     networks        ent

Create Basic NIM Resources
Following basic resources must be created.
  • an LPP source (NIM object of type lppsource)
  • a SPOT (NIM object of type spot)
  • NIM scripts (NIM objects of type script and fb_script
Creating LPP Source from AIX 7 DVD
For creating an LPP source from an AIX 7.1 installation DVD.We copy the files to our target filesystem (/nim/lppsource) using bffcreate. Since we want to be able to serve more than one LPP source we decide to store the files in a subfolder LPP71_TL00:  
# mkdir /nim/lppsource/LPP71_TL00 
# smitty bffcreate
 

I have downloaded the TL  filesets under /datafs/ for AIX 7100-01-00-1140.. We now copy the filesets into the LPP source. Please note the target directory should be /nim/lppsource/LPP71_TL00/installp/ppc

# smitty bffcreate


I have downloaded Service pack: 7100-01-01-1141 and ran smitty bffcreate again for updating service pack
# smitty bffcreate


Define LPP Source
# cd /nim/lppsource/LPP71_TL00/installp/ppc
# inutoc .
# nim -o define -t lpp_source \
> -a server=master \
> -a location=/nim/lppsource/LPP71_TL00 \
> -a comments='Full AIX 7100-01-03 Source' \
> lpp_aix710

Preparing to copy install images (this will take several minutes)...

Now checking for missing install images...
All required install images have been found. This lpp_source is now ready.

Save some space by  removing superseeded filesets  : You can remove Language software by selecting yes if you don't want to keep language software.



Create SPOT  from LPP source:
 

Create Installation Image 
This is an option step needed if you want to install servers from mksysb image instead of using lpp source. If you want to define mksysb resource, create mksysb from existing AIX7 installation, copy it over to NIM Master. If you do not have any AIX 7 in your environment, then create an installation from lppsource on a spare lpar, customize it and create mksysb or create mksysb from the nim master before configuring the nim master..
After you have a mksysb image of AIX 7, you can define the mksysb nim resource as below
# nim -o define -t mksysb \
-a server=master \
-a comments='MKSYSB AIX 7 Installation - Created <DATE> \
-a location=/nim/install_mksysbimages/mksysb_aix7 \
mksysb_aix7


Create Scripts
If you have customization scripts like   first boot script called fboot_aix7.sh and a postinstall script called pboot_aix7.sh in place, then we have to define two more NIM resources:

Firstboot Script
# vi fboot_aix7.sh
# chmod ug+x fboot_aix7.sh
# nim -o define -t fb_script \
            -a server=master \
            -a comments='Firstboot script for AIX 7' \
            -a location=/nim/scripts/fboot_aix7.sh \
          fb_aix7

Postinstall Script

# vi pboot_aix7.sh
# chmod ug+x pboot_aix7.sh
# nim -o define -t script \
            -a server=master \
            -a comments='Postinstall script for AIX 7 installations' \
            -a location=/nim/scripts/
pboot_aix7.sh \
          script_aix7_post


 This completes the NIM Master setup, then do the followingon Nim Master to

Define a client: use smitty nim->Perform Nim Admin Tasks->Manage Machines->Define a Machine or command line as below.
#nim -o define -t standalone -a platform=chrp -a netboot_kernel=64 -a if1="net_10_62_137 -a cable_type1=tp <client>" <client>
 Allocate resources:
# nim -o allocate -a spot=spot_aix710 -a lpp_source=LPP71_TL00 <ClientName>
Initialize lpp installation:
nim -o bos_inst -a spot=spot_aix710 -a lpp_source=LPP71_TL00 -a no_client_boot=yes -a accept_licenses=yes <client>
If the installation Fails and you have to restart installation, deallocate all resources before reallocating
# nim -Fo deallocate -a subclass=all <ClientName> 

Other useful commands and resources