Wednesday, October 3, 2012

IBM AIX - NIM Made Easy - A complete Overview!!

Master: It refers the machine where you setup and maintain your NIM environment

Client: It can be target for NIM Master-operations. Such as installation, updation.

NIM Classes: Machines, Network, Resources, Groups

Group: Collection of machines or resources

Resources : lpp_source, SPOT, mksysb, bosinst_data, script, image_data, installp_bundle

lsnim – extract the contents in nim master

lsnim –c machines   Shows the machine names

lsnim –l 

/etc/bootptab: This file is used by the bootpd daemon. With no operations this file empty. This file gets updated automatically by the NIM master when a NIM operation is executed that requires the client machine to boot from a NIM SPOT.

/etc/exports: Any sort of installation, boot, mksysb savevg etc operation requires the use of NFS. This file will be updated with which locations are NFS exported from the master to the client and the permissions associated with those exports.

/etc/hosts: It gives a relationship between a system’s hostname and an IP address. If your IP address does not match up to the correct hostname your installation fails.

/etc/niminfo: This file should always exist on the NIM master. This file is built when you first initialize the NIM environment. This is required to run nim commands and perform nim operations. If the /etc/niminfo file accidentally deleted you can rebuild the file.

/tftpboot: The main purpose of this directory is to hold the boot images that are created by nim when a boot or installation is initiated. This directory also holds informational files about the clients that are having a boot or installation operation performed.

SPOT: Shared product object tree.Its a directory of code(installed filesets). That is used during client booting procedure. This content equals to /usr file system(Binaries, executables and libraries, header files and shell scripts).
boot images can exist in the /tftpboot directory. kernels will be stored in /tftpboot directory.

lsnim -t spot -> list the different available spots
To find oslevel -r output by lsnim -l . If the SPOT and mksysb are not at the same level, installation will only work if the SPOT is at higher level than the mksysb.

lpp_source: Similar to AIX install CD’s. It contains AIX licensed program products(LPPs) in Backup File Format.
Lpp_source with attribute simages=yes means create a SPOT, and to install the AIX operating system.
Lpp_source with attribute simages=no means can not be used to install base AIX operating system.

lpp_source types: lsnim -t lpp_source

Mksysb:this resource is a file containing the image of the root volume group of machine.
It is used to restore a machine.

Defining MKSYSB resource:Nim –o define –t mksysb –a source= -a server=master –a location= resource name.
Lsnim –t mksyb

bosinst_data: bosinst_data resource is a flat ascii file, like bosinst.data used for restoring system backup images from tape or CD/DVD. this resource is for Push/pull installation of multiple machines at the same time.

script: contains all the commands to perform customization. such as file system resizing, additional user creation ..

To start a nim environment
  1. Select a machine to be the master
  2. Install AIX for the master
  3. install NIM file sets : bos.sysmgt.nim.master, bos.sysmgt.nim.spot
  4. Configure the selected machine as a NIM Master using smitty nimconfig  Mention Network name, Interface : nimconfig –a netname=net_10_1_1 –a pif_name=en0 –a netboot_kernel=mp –a cable_type=tp –a client_reg=no
  5. When machine added to NIM environment, the /etc/niminfo file is created.
  6. To rebuild the NIM master /etc/niminfo file, use the nimconfig –r command
  7. To rebuild and recover NIM client /etc/niminfo file use the niminit command. Ex: niminit –a master= -a name=
  8. Create file systems for nim   The lpp_source and SPOT resources are directories and the related filesystems must be created.
  9. Define basic resources(lpp_source, SPOT)  smitty nim_mkres
  10. Define the client (smitty nim_mkmac)
  11. Start the client installation(smitty nim_task_inst)
  12. Verify the /etc/bootptab
  13. Verify the boot files created or not in the /bootptab
NIM Daemons: nimesis, nimd, bootpd, tftpd
NIM Master uses the bootpd and tftpd
The bootpd daemon will also use the /etc/bootptab file when a NIM client is configured to be booted from the NIM master.
The tftpd daemon uses the /etc/tftpaccess.ctl file to determine which directory hierarchy is allowed to share.
/var/adm/ras directory contains the nim master log files.
/usr/ad/ras/nimlog file contains information about failed NIM operations.
Alog command to view the nim logs: alog –f /usr/adm/ras/nimlog -o

Estimation of minimum disk requirements: lpp_source   6GB, SPOT 2GB, mksysb 40GB
File System Hierarchy:
/tftpboot: This is used for NIM master boot images(Kernels) and info files for the NIM clients.
/export/lpp_source: Used for storing versions of AIX base level filesets in specific directories
/export/spot: Used for storing non /usr
/export/images: This is used for storing system backup images. Images can be created by NIM mksysb.
/export/mksysb: This directory for the mksysb image files to install on clients-approx 1.5GB per image.
/export/res: for bosinst_data, image_data and scripts.
/export/53 contains lppsource_53TL6 and spot_53TL6
NIM server size depends upon how many versions of AIX filesets, TLs, PTFs, Service Packs
Filesets for NIM Master.: bos.net.tcp.server, bos.net.nfs.server, bos.sysmgt.nim.master, bos.sysmgt.nim.spot.

Master config: smitty nim configure NIM environment advanced configuration Initialize nim master only. ( give details like network name and interface)

Making the lppsource:
  • Copy software from CD or DVD into /export/53 file system Smitty bffcreate  ( give input device, software package to copy , directory for storing sw package)
  • Define it as a NIM resource: smitty nim configure the NIM environment  Advanced configuration  Create basic installation resources  create a new LPP_source ( give resource server, LPP_source name, LPP_source directory)
Making the SPOT: smitty NIM  configure the NIM environment  Advanced configuration   Create Basic installation resources   Create a New Spot ( give Resource server, input device, SPOT name and SPOT directory.

NIM Configuration:
Define Client Machine: smitty nim   perform nim administration tasks  manage machines  define a machine(NIM machine name, machine type(standalone), hardware platform type(chrp), kernel to use for network boot(mp), cable type(tp)

Display NIM network objects: lsnim –l –c networks

The Basic NIM installation resources:
1) one nim lpp_source and one SPOT
2) for mksysb installation mksysb resource and SPOT

Define lpp_source: nim –o define –t lpp_source –a server=master –a location=/export/lpp_source/lpp5300 –a source=/dev/cd0 lpp5300

Creating a NIM lpp_source from a directory  Nim –o define –t lpp_source –a server=master –a location=/export/lpp_source/lpp5300 lpp5300

Removing NIM lpp_source: nim –o remove lpp5300

Check a NIM lpp_source: nim –Fo check lpp5304

Creating a NIM spot: nim –o define –t spot –a server=master –a location=/export/spot –a source=lpp5300 –a installp_flags=-aQg spot5300

Listing Filesets in a SPOT: nim –o lslpp –a filesets=all –a lslpp_flags=La spot6100-01
Nim –o lslpp spot6100-01
Listing fixes in a SPOT: nim –o fix_query spot6100-01
TL of a SPOT: lsnim –l spot6100-01|grep oslevel

Listing Client Filesets: nim –o lslpp –a filesets=all –a lslpp_flags=-La client.

Removing the NIM spot   nim –o remove spot5300

Checking the SPOT nim –o check spot5300

Resetting the NIM spot   nim –Fo check spot5300

Create a nim client  nim –o define –t standalone –a if1=”net_10_1_1 lpar55 0 ent0” LPAR55

Define NIM machines using smit nim_mkmac

Removing NIM client Definition: nim –o remove LPAR55

Installing NIM Clients:
Base Operating System Installation
System Clone installation
Automated customization after a generic BOS install.

BOS install through NIM:
  • Nim –o allocate –a spot=spot5304 –a lpp_source=lpp5304 LPAR55
  • Initiate the install: nim –o bos_inst –a source=spot5304 –a installp_flags=agX –a accept_licenses=yes LPAR55
  • If the installation is unsuccessful, you need to reallocate the resources
  • Reset and deallocate NIM resources: Nim –Fo reset LPAR55, Nim –Fo deallocate –a subclass=all LPAR55
  • View the progress of installation: Nim –o showlog –a log_type=boot LPAR55
Using SMIT to install standalone client: smitty nim_bosinst  select a target for the operation  select the installation type   select the lpp_source  select the spot
After Initial program load   SMS Menu  setup remote IPL interpartition logical LAN  Select IP parameters(Client IP, Server IP, Gateway, Subnetmask) Ping Test Execute Ping Test  Select Boot Option  Select install/Boot Device(Network)  Select normal boot mode

Steps to migrate the NIM master to AIX 5L V5.3
  1. Unmount all NFS mounts
  2. Document the AIX and NIM master configuration(snap –ac, lsnim)
  3. Perform NIM database backup   smitty nim_backup_db  Backup the NIM database
  4. Perform a mksysb of the NIM Master
  5. insert Aix 5l v5.3 CD volume 1 into the CD drive
Creating mksysb from NIM client:
Nim –o define –t mksysb –a server=master –a source=lpar5 –a mk_image=yes –a location=/export/images/mksysb.lpar5 mksysb_lpar5

Backup the VIO server:
Backupios –file /home/padmin/viobackup/VIO.mksysb –mksysb

Restoring the VIO server:
Defining mksysb resource: smitty nim_mkres(select mksysb)  Define Spot resource: smitty nim_mkres(select spot)  perform the BOS installation

NIM Commands
nimconfig -a pif_name=en0 -a netname=net1 To initialise the NIM master with network name net1
nimconfig -r  To rebuild /etc/niminfo file which contains the variables for NIM
nim -o define -t lpp_source -a source=/dev/cd0 -a server=master –a location=/export/lpp_source/lpp_source1 lpp_source1  To define lpp_source1 image in /export/lpp_source/lpp_source directory from source cd0
nim -o define -t mksysb -a server=master -a location=/resources/mksysb.image mksysb1  To define mksysb resource mksysb1, from source /resources/mksysb.image on master
nim -o remove inst_resource  To remove the resource
nim –o showres lpp_source6100 Listing contents of the lpp_source.
Nim –o showres –a instfix_flags=T lppsource_61_01
nim -o check lpp_source1  To check the status of lpp_source lpp_source1
nim -o allocate -a spot=spot1 -a lpp_source=lpp_source1 node1  To allocate the resources spot1 and lpp_source1 to the client node1
nim -o bos_inst node1  To initialise NIM for the BOS installation on node1 with the allocated resources
nim -o dkls_init dcmds  To initialize the machine dcmds as diskless operation
nim -o dtls_init dcmds To initialize the machine dcmds for dataless operation
nim -o cust dcmds To initialize the machine dcmds for customize operation
nim -o diag dcmds To initialize the machine dcmds for diag operation
nim -o maint dcmds To initialize the machine dcmds for maintenance operation
nim -o define -t standalone -a platform=rspc -a if1=”net1 dcmds xxxxx” -a cable_type1=bnc dcmds To define the machine dcmds as standalone with platform as rspc and network as net1 with cable
type bnc and mac address xxxxx
nim -o unconfig master To unconfigure nim master master
nim -o allocate -a spot=spot1 dcmds To allocate the resource spot1 from machine dcmds
nim -o deallocate -a spot=spot1 dcmds To de allocate the resource spot1 from machine dcmds
nim -o remove dcmds To remove machine dcmds after removing all resources associated to it
nim -o reboot dcmds To reboot ther client dcmds
nim -o define -t lpp_source -a location=/software/lpp1 -a server=master -a source=/dev/cd0 lpp1 To define lppsource lpp1 on master at /software/lpp1 directory from source device /dev/cd0
lsnim  To list the nim resources
lsnim -l dcmds  To list the detailed info about the object dcmds
lsnim -O dcmds  To list the operation dcmds object can support
lsnim -c resources dcmds  To list the resources allocated to the machine dcmds
nimclient  The client version of nim command (User can obtain same results of nim in server )

NIM Master Configuration:
Nim Installation:
File sets required for NIM installation:
  • bos.sysmgt.nim.master
  • bos.sysmgt.nim.client
  • bos.sysmgt.nim.spot
Put volume 1 of your media installp –acgXd /dev/cd0 bos.sysmgt.nim OR use smit install_all

Initial Setup: smit nim_config_env

Initializing the NIM master: nimconfig –a pif_name=en0 –a master_port=1058 –a netname=master_net –a cable_type=bnc
Or smitty nimconfig.
Lsnim –l master   you will see information about NIM master
Lsnim –l |more  The boot resource created a /tftpboot directory to hold all of your boot images. All NIM clients that are on the same subnet as this master will be assigned to master_net network.

Set up first lpp_source resource: Create file system called /export/nim/lpp_source.
Nim –o define –t lpp_source –a location=/export/nim/lpp_source/53_05 –a server=master –a comments=’5300-05 lpp_source’ –a multi_volume=yes –a source=/dev/cd0 –a packages=all 5305_lpp
Or
Smit nim_mkres  select lpp_source
If you wish to add other volumes you can use
A) bffcreate the volumes into the lpp_source
B) Use NIM to add the volumes smitty nim_res_op select lpp_source select update give target lpp_source and source
Lsnim –l 5305_lpp
Rstate: If this is not set to ‘ready for use’ then you cannot use this resource. Running a check on the lpp_source will allow you to clear this up. Nim –o check

Set up first SPOT resource: create file system called /export/nim/spot.
Nim –o define –t spot –a server=master –a source=5305_lpp –a location=/export/nim/spot –a auto_expand=yes –a comments=’5300-05 spot’ 5305_spot
OR
Smitty nim_mkres select SPOT.
Lsnim –l 5305_spot

Unconfiguring NIM master: nim –o unconfigure master.

Installing software on a client: smitty nim (or smit nim_inst_latest) Perform NIM software installation and Maintenance tasks Install and update software Install Software select the client and the lpp_source.

Updating client software to a latest level: smitty nim(or nim_update_all) perform nim software installation and maintenance tasks install and update software update installed software to latest level select the client then select the lpp_source.

Alternate Disk Install for new TLs: smitty nim(or nim_alt_clone) Perform NIM software installation and Maintenance tasks  Alternate Disk Installation  Clone the rootvg to an alternate disk ( select taget machine and disk)

Alternate disk install for a new release: smit nim(or nimadm_migrate) Perform NIM software installation and Maintenance tasks Alternate disk installation  NIM alternate disk migration perform nim alternate disk migration( select client, disk name, LPP source and SPOT name)

Performing Installs from the client: smit nim(or nim_client_inst)   install and upgrade software.

RTE installation:
  • Requires lpp_source and spot
  • Default is to install the BOS.autoi bundle
  • Define the client on the NIM master
  • Prepare the NIM master to supply RTE install resources to the client
  • Initiate the installation from the client
Defining the client: smit nim_mkmac (give hostname) enter give machine type standalone, hardware platform type chrp, communication protocol need by client nimsh, cable type N/A.

Client on a new network: smit nim_mkmac  give hostname and enter. Type of network attached to network install interface  ent(Ethernet network) enter. Give NIM network network2 and subnetmask 255.255.255.0, default gateway used by machine and master.

Setting up the master to install: smit nim_bosinst select target machine select the installation type (rte) select the lpp_source select the SPOT install the base OS on standalone clients.

Checking the NIM master: lsnim –l client, tail –l /etc/bootptab(bf field in /etc/bootptab specifies the boot file that will
be transferred to the client using TFTP after the client contacts the master using BOOTP) , ls –l /tftpboot(Actually a symbolic link) , showmont –e ( shows exported files)

Typical Install Sequence:
  • Client initates BOOTP request to NIM server.
  • NIM server responds with information about the boot file (bootptab file)
  • Client initates TFTP of boot file from NIM server.
  • Client runs boot file
  • Client NFS mounts SPOT and lpp_source
  • Install Operating system
Accessing SMS: Open HMC  select LPAR  Activate  select profile (default) click on open a terminal window Advanced select boot mode SMS  ok   select remote IPL  select the adapter select internet protocol version (IPv4) select network service(BOOTP) Setting IP parameters( select client IP, server IP, gateway, subnet mask) setting the bootlist(select install/boot device select network  select network service(BOOTP) select the normal boot mode)   setting the boot(are you sure you want to exit SMS(yes)

Monitoring progress on the master: lsnim –l client ( info   prompting_for_data_at_console)

Installation: Main BOS installation menu ( select install now with default settings)
To view the bosinst log   nim –o showlog –a log_type=bosinst client.
Listing valid operations for an object type: lsnim –Pot master
Listing valid operations for an object: lsnim –O client
Rebuilding the /etc/niminfo file: nimconfig –r
Niminit -a name=client –a master=master
Backing up the NIM database: smitty nim_backup_db (default value is /etc/objrepos/nimdb.backup)
Restore the previously created backup: smitty nim_restore_db
NIM Log files:
/var/adm/ras/nimlog
/var/adm/ras/nim.installp
/var/adm/ras/nimsh.log
/var/adm/ras/bosinstlog
/var/adm/ras/nim.setup
High availability ( Alternate NIM master)
/etc/niminfo: Lists the active NIM master, and a list of valid alternate masters.
Configure alternate NIM master: smit niminit_altmstr
Synchronizing NIM database: smit nim_altmstr ( select synchronize alternate master’s NIM DB)

0 comments:

Post a Comment

Pages