AIX (Advanced Interactive eXecutive) is a series of proprietary Unix operating systems developed and sold by IBM.
Performance Optimization With Enhanced RISC (POWER) version 7 enables a unique performance advantage for AIX OS.
POWER7 features new capabilities using multiple cores and multiple CPU threads, creating a pool of virtual CPUs.
AIX 7 includes a new built-in clustering capability called Cluster Aware
AIX POWER7 systems include the Active Memory Expansion feature.

Thursday, September 1, 2011

Create a NIM Server from Scratch

1. Introduction

AIX 7.1 is out. SP2 is already existing. Time to evaluate AIX 7.1 for productive use. And time to create a new NIM server to serve AIX 7.1.
This article assumes that the LPAR you want to use as a NIM server is already installed with AIX 7.1 SP2.

2. Install NIM Master filesets


master# smitty install_latest
                                Install Software
Ty+--------------------------------------------------------------------------+
Pr|                           SOFTWARE to install                            |
  |                                                                          |
[T| Move cursor to desired item and press F7. Use arrow keys to scroll.      |
* |     ONE OR MORE items can be selected.                                   |
* | Press Enter AFTER making all selections.                                 |
  |                                                                          |
  | [MORE...537]                                                             |
  |    @ 7.1.0.0  Filesystem Quota Commands                                  |
  |    @ 7.1.0.0  License Management                                         |
  |    @ 7.1.0.0  Network Install Manager - Client Tools                     |
  | >  + 7.1.0.0  Network Install Manager - Master Tools                     |
  | >  + 7.1.0.0  Network Install Manager - SPOT                             | 
  |    @ 7.1.0.0  Software Trace Service Aids                                | 
  |    @ 7.1.0.0  System Backup and BOS Install Utilities                    | 
  |    @ 7.1.0.0  System Management Interface Tool (SMIT)                    | 
  | [MORE...1188]                                                            | 
[M|                                                                          | 
  | F1=Help                 F2=Refresh              F3=Cancel                | 
F1| F7=Select               F8=Image                F10=Exit                 | 
F5| Enter=Do                /=Find                  n=Find Next              | 
F9+--------------------------------------------------------------------------+ 
 

3. Create Filesystems

First we create the NIM volume group, the loglv, and the base filesystem for the NIM resources:
master# mkvg -f -S -s 32 -y nim_master hdisk1
master# mklv -t jfs2log -y nim_jfs2log nim_master 16 
master# logform /dev/nim_jfs2log
logform: destroy /dev/rnim_jfs2log (y)?y
master# mklv -t jfs2 -y nim_base nim_master 2
master# crfs -v jfs2 -d /dev/nim_base -m /nim -p rw -A yes -u NIM
master# mount /nim
Then we create a filesystem for installation images:
master# mklv -t jfs2 -y nim_images nim_master 200
master# crfs -v jfs2 -d /dev/nim_images -m /nim/images -p rw -A yes -u NIM
master# mount /nim/images
... a filesystems for LPP sources...
master# mklv -t jfs2 -y nim_lppsrc nim_master 200
master# crfs -v jfs2 -d /dev/nim_lppsrc -m /nim/lppsource -p rw -A yes -u NIM
master# mount /nim/lppsource
... and a filesystem for the spots:
master# mklv -t jfs2 -y nim_spot nim_master 30
master# crfs -v jfs2 -d /dev/nim_spot -m /nim/spot -p rw -A yes -u NIM
master# mount /nim/spot
Let's check what we created:
master# df
Filesystem     512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           393216      4976   99%    10019    88% /
/dev/hd2          4063232    427232   90%    42567    46% /usr
/dev/hd9var        786432    244304   69%     5720    17% /var
/dev/hd3          1572864    850168   46%      159     1% /tmp
/dev/hd1           131072    129880    1%       62     1% /home
/dev/hd11admin     262144    261384    1%        5     1% /admin
/proc                   -         -    -         -     -  /proc
/dev/hd10opt       786432    398288   50%     7253    14% /opt
/dev/livedump      524288    523552    1%        4     1% /var/adm/ras/livedump
/dev/nim_base      131072    130328    1%        8     1% /nim
/dev/nim_images  13107200  13104544    1%        4     1% /nim/images
/dev/nim_lppsrc  13107200  13104544    1%        4     1% /nim/lppsource
/dev/nim_spot     1966080   1965120    1%        4     1% /nim/spot

4. Initialize NIM

Let's say our NIM server's ethernet interface for NIM tasks is en6 and is configured with the IP address 10.255.127.10 and a subnet mask of 255.255.255.0, then we can initialize the NIM server with a command like this:
master# nimconfig -a netname=net_10_255_127 -a pif_name=en6 -a netboot_kernel=64 \
                  -a cable_type=tp -a client_reg=no
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 7340138.
After initialization there are already some base NIM resources configured:
master# lsnim
master             machines        master
boot               resources       boot
nim_script         resources       nim_script
net_10_255_127     networks        ent

5. Create Basic NIM Resources

Three types of basic resources have to 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)

5.1 Create LPP source from DVD

First we want to create an LPP source from an AIX 7.1 installation DVD. As a first step 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 lpp_aix710:
master# mkdir /nim/lppsource/lpp_aix710
master# smitty bffcreate

  |      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             [/nim/lppsource/lpp_aix710]
  |   DIRECTORY for temporary storage during copying     [/tmp]
  |   EXTEND file systems if space needed?                yes                        +
  |   Process multiple volumes?                           yes                        +
There is no TL out yet for AIX 7.1 only Service Packs are available. In the below example we assume that we stored the filesets for SP2 under /tmp/ibmfixes/710/tl00/sp02. We now copy the filesets into the LPP source. Please note the target directory in the example below!
master# smitty bffcreate

  |     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               /tmp/ibmfixes/710/tl00/sp02
  | * SOFTWARE package to copy                           [all]                       +
  | * DIRECTORY for storing software package             [/nim/lppsource/lpp_aix710/installp/ppc]
  |   DIRECTORY for temporary storage during copying     [/tmp]
  |   EXTEND file systems if space needed?                yes                        +
  |   Process multiple volumes?                           yes                        +
If there would be a TL out we had to do this step twice - once for the TL and another time for the SP.
Now we are ready to define the LPP source:
master# cd /nim/lppsource/lpp_aix710/installp/ppc
master# inutoc .
master# nim -o define -t lpp_source \
            -a server=master \
            -a location=/nim/lppsource/lpp_aix710 \
            -a comments='Full AIX 7100-00-02 source' \
          lpp_aix710
To save some space we remove superseeded filesets and language bloat:
master# smitty nim_lppmgr
 
  |      Eliminate Unnecessary Software Images in an lpp_source
  | Type or select values in entry fields.
  | Press Enter AFTER making all desired changes.
  |                                                      [Entry Fields]
  |   TARGET lpp_source                                   lpp_aix710
  |   PREVIEW only?                                       no                       +
  |   REMOVE DUPLICATE software                           yes                      +
  |   REMOVE SUPERSEDED updates                           yes                      +
  |   REMOVE LANGUAGE software                            yes                      +
  |       PRESERVE language                              [en_US]
  |   REMOVE NON-SIMAGES software                         no                       +
  |   SAVE removed files                                  no                       +
  |       DIRECTORY for storing saved files              []
  |   EXTEND filesystems if space needed?                 yes                      +
If you want to keep the language filesets set  REMOVE LANGUAGE software to no.

5.2 Create Spot

After we successfully created the LPP source we are ready to create a spot from the source:
master# nim -o define -t spot \
            -a server=master \
            -a source=lpp_aix710 \
            -a location=/nim/spot \
            -a comments='Spot created from lpp_aix710' \
          spot_aix710
Note that we didn't use a separate path name for our spot under  location - just /nim/spot! NIM automatically appends the objectname (spot_aix710 here) to the path. You would find the spot under /nim/spot/spot_aix710/usr.

5.3 Create Scripts

Let's say we have a first boot script called fb_aix7.sh and a postinstall script called aix7_post.sh in place, then we have to define two more NIM resources:
Firstboot Script
master# vi fb_aix7.sh
master# chmod ug+x fb_aix7.sh
master# nim -o define -t fb_script \
            -a server=master \
            -a comments='Firstboot script for AIX 7' \
            -a location=/nim/scripts/fb_aix7.sh \
          fb_aix7
Postinstall Script
master# vi aix7_post.sh
master# chmod ug+x aix7_post.sh
master# nim -o define -t script \
            -a server=master \
            -a comments='Postinstall script for AIX 7 installations' \
            -a location=/nim/scripts/aix7_post.sh \
          script_aix7_post

6. Create an Installation Image

This step is only required if you intend to install your servers from an mksysb image rather than from an LPP source.
In order to define an MKSYSB resource you need an mksysb from an existing AIX7 installation. Copy it over to the NIM master. If there is no AIX7 server in your environment you have two options:
  1. Create an mksysb image from your NIM master (you should do this before you configure the server as a NIM master!)
  2. Do an LPP installation of a spare LPAR, do your site customization, and create a mksysb from this server
Once you have a mksysb image of an AIX 7.1 SP2 server in place you can define the NIM resource with a command like this:
master# nim -o define -t mksysb \
            -a server=master \
            -a comments='Mksysb AIX 7.1 TL0 SP2 - created 22.12.2010' \
            -a location=/nim/install_images/mksysb_aix710-sp02_test \
          mksysb_aix710-sp02_test
 


Appendix

A Useful Commands

This is only a brief and selective list of commands that might be useful if you setup a NIM server. If you need to find more commands please refer to the NIM Commands overview.
  • remove a resource:
    nim -o remove spot_aix710
  • add filesets to a spot
    smitty nim_inst_latest
  • define a client
    nim -o define -t standalone -a platform=chrp -a netboot_kernel=64 -a if1="net_10_255_127 -a cable_type1=tp <client>" <client>
  • initialize an lpp installation
    nim -o bos_inst -a spot=spot_aix710 -a lpp_source=lpp_aix710 -a no_client_boot=yes -a accept_licenses=yes <client>




No comments: