NIM

Network Installation Management, or NIM

With NIM, you can have unattended installation of clients. The NIM Server also provides you with the backup images of all your Servers (the NIM clients).

NIM objects:
————
This topic explains the objects concept as it is used in the NIM environment. The machines you want to manage in the NIM environment, their resources, and the networks through
which the machines communicate are all represented as objects within a central database that resides on the master. Network objects and their attributes reflect the physical characteristics of the network environment. This information does not affect the running of a physical network but is used internally by NIM for configuration information.
Each object in the NIM environment has a unique name that you specify when the object is defined. The NIM name is independent of any of the physical characteristics of the object it identifies and is only used for NIM operations. The benefit of unique names is that an operation can be performed using the NIM name without having to specify which physical attribute should be used. NIM determines which object attributes to use. For example, to easily identify NIM clients, the host name of the system can be used as the NIM object name, but these names are independent of each other. When an operation is performed on a machine, the NIM name is used, and all other data for the machine (including the host name) is retrieved from the NIM database.

NIM machines:
————-
The types of machines that can be managed in the NIM environment are standalone, diskless, and dataless clients. This section describes the differences between the machines, the attributes required to define the machines, and the operations that can be performed on them.

The NIM environment is composed of two basic machine roles: master and client. The NIM master manages the installation of the rest of the machines in the NIM environment. The master is the only machine that can remotely run NIM commands on the clients. All other machines participating in the NIM environment are clients to the master, including machines that may also serve resources.
NIM Resources (from somewhat older source):
————–
NIM allows you to customize installations and maintain clients on the network from a centralized location (the NIM master) or the NIM client itself. The master contains the NIM database and can serve resources. Resources in NIM are files or directories containing data that NIM will use to install, customize, and maintain NIM clients. A NIM client is any machine configured and defined in the NIM database. Some key NIM resources used in our setup are:

– Licensed Program Product Source Directory (lpp_source): This directory contains backup file format (BFF) images, which AIX installp uses to load software. One way to understand the role of the
lpp_source directory in a BOS installation is to compare it to all the installation images needed to support any configuration (specifically different device configurations) along with a base core set
of software (called simages) that are on the BASE installation CDs. We created a base 433 lpp_source, multiple lpp_sources containing different maintenance levels, and separate lpp_sources for our 32-bit and 64-bit third-party application software.

– Shared Product Object Tree (SPOT): This directory is created from an lpp_source and is equivalent in content to a /usr file-system on AIX. The purpose of a SPOT in a NIM installation is similar to the boot images and BOS installation scripts (bi_main, rc.boot, and rc.bosinst) on volume 1 of the BASE install CD. The SPOT must contain support for all boot environments (platform, network type, kernel type).
We created several different SPOTs for the different data centers and maintenance levels we use to support our systems.

– bosinst_data: This data file contains information that drives the BOS install (e.g., prompt vs. no-prompt, which disk to install the OS on, and the type of installation (Overwrite, Preservation, or Migration) to name a few). First, we created separate bosinst_data resources for each machine type (S80, H70, B50, M80, P680, and 43P). Then, by specifying two disks to target in our bosinst_data resource and specifying copies in the image_data resource, we could set up mirroring during the initial load.

– image_data: This data file contains information about the characteristics of the OS being installed. For example, it includes the size of file systems, whether or not to mirror, and whether or not to
disk stripe. We created separate image_data resources for each machine type (S80, H70, B50, M80, P680 and 43P).

– Installp_bundles: This data file contains a customized list of additional software to install after the base AIX software is loaded. If you have different configurations that you need to duplicate
on a repeatable basis, this resource is very useful. In our environment, we have different OS software requirements for development, QA, and production above the minimal AIX software needed to support different hardware systems. The easiest way to facilitate and maintain these different requirements, which need to be consistent, is to use installp_bundles.

– mksysb: This is a backup archive file that contains a system image of rootvg. Because of our network security restrictions (no one machine could be connected to all the networks
within our organization), we used mksysb and savevg tapes to replicate the NIM master to the other data centers. If we had one machine connected to the different data centers, we could have used NIM to replicate and update the NIM masters in the different data centers by BOS-installing a NIM mksysb resource and using a NIM script to restore the other volume group data.

– mac_group: This is a logical grouping of machine types (standalone, diskless, or dataless) that enables the systems administrator to target one or more machines with a single command or
NIM operation. We did not use this feature, but we could have taken advantage of this by grouping all like systems and like configurations to install to more than one machine at a time.
We used the 43P systems as our NIM masters for each data center because they could complete remote installations of machines or be moved and directly connected to a server for OS installations.
These NIM masters were also designated as the resource servers in our environment. To ensure consistency and standardization of each NIM master (for the different data centers),
we created a standard NIM master machine, which we cloned. We made a stacked tape containing a mksysb image and a savevg image of the standard NIM master to sync up and update the other NIM masters.
Here are the commands we ran on the standard NIM master to create this stacked single tape:
# mksysb -i /dev/rmt0
# tctl -f/dev/rmt0.1 fsf4
# savevg -i -m {volume_group_name} -f/dev/rmt0.1
# mt -f/dev/rmt0 rewind

To restore the tape to the other NIM masters, we did the following:

Booted and restored the mksysb image from the stacked tape
# tctl -f/dev/rmt0.1 fsf4
# restvg volume_group_name

Setup NIM:
———-

Needed Filesets:

You should have the following installed on your master

# lslpp -l | grep bos.sysmgt.nim

bos.sysmgt.nim.client  5.1.0.25  COMMITTED Network Install Manager
bos.sysmgt.nim.master  5.1.0.25  COMMITTED Network Install Manager
bos.sysmgt.nim.spot    5.1.0.25  COMMITTED Network Install Manager

These are available on the AIX Product CD 1.

If you need to install the NIM client, master and spot filesets

# installp -qaX -d /dev/cd0 bos.sysmgt.nim.master bos.sysmgt.nim.client bos.sysmgt.nim.spot

At the end of the install you should see the below

Installation Summary
Name Level Part Event Result

bos.sysmgt.nim.client 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.spot 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.master 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.client 5.3.0.0 ROOT APPLY SUCCESS

To install NIM:

You can use the fast path

# smitty nim_config_env

to setup the basic NIM environment for the first time. It needs a minimum of two pieces of information.
– Input device for installation images
– Primary network interface

Default values are provided for the remaining options. Once this smitty panel has been completed successfully,
the following actions will have been completed:
. NIM master initialized on the primary interface
. NIM daemons running
. lpp_source created and available
. SPOT resource created and available (Shared Product Object Tree)

# smitty nim_config_env

                 Configure a Basic NIM Environment (Easy Startup)

     Initialize the NIM Master:
     * Primary Network Interface for the NIM Master            []
     Basic Installation Resources:
     * Input device for installation images                    []
     * LPP_SOURCE Name                                         [lpp_source]
     * LPP_SOURCE Directory                                    [/export/lpp_source]
       Create new filesystem for LPP_SOURCE?                   [yes]
       Filesystem SIZE (MB)                                    [650]
       VOLUME GROUP for new filesystem                         [rootvg]
     * SPOT Name                                               [spot1]
     * SPOT Directory                                          [/export/spot]
       Create new filesystem for SPOT?                         [yes]
       Filesystem SIZE (MB)                                    [350]                  
       VOLUME GROUP for new filesystem                         [rootvg]
     ..
     ..

 

EZNIM:
——

The “smit eznim” option installs the “bos.sysmgt.nim.master” fileset and configures the NIM environment.
The configuration involves creating the NIM database and populating it with several entries.
Several basic NIM resources will then be created and defined in the NIM database.

1. smitty eznim
2. Select “Configure as a NIM Master”
3. Select “Setup the NIM Master Environment”
4. Verify the default selections for software source, volume group etc..

To display the NIM resources that have been created, do the following:
use “smit eznim_master_panel” fast path, or select “Show the NIM environment”.
The nim_master_setup command:
—————————–

The nim_master_setup command installs the bos.sysmgt.nim.master fileset, configures the NIM master,
and creates the required resources for installation, including a mksysb system backup.

The nim_master_setup command uses the rootvg volume group and creates an “/export/nim” file system, by default.
You can change these defaults using the volume_group and file_system options. The nim_master_setup command
also allows you to optionally not create a system backup, if you plan to use a mksysb image
from another system. The nim_master_setup usage is as follows:

Usage nim_master_setup: Setup and configure NIM master.
      nim_master_setup [-a mk_resource={yes|no}]
 [-a file_system=fs_name]
 [-a volume_group=vg_name]
 [-a disk=disk_name]
 [-a device=device]
 [-B] [-v]

 -B    Do not create mksysb resource.
 -v    Enable debug output.

 Default values:
 mk_resource = yes
 file_system = /export/nim
 volume_group = rootvg
 device = /dev/cd0

To install the NIM master fileset and initialize the NIM environment using install media located
in device /dev/cd1, type:
# nim_master_setup -a device=/dev/cd1

To initialize the NIM environment without creating NIM install resources, type:
# nim_master_setup -a mk_resource=no

To initialize the NIM environment, create NIM install resources without creating a backup image,
using install media located under mount point /cdrom, type:
# nim_master_setup -a device=/cdrom -B

To define NIM resources in an existing NIM environment, using install media located in device /dev/cd0,
and create a new file system named /export/resources/NIM under volume group nimvg, type:
# nim_master_setup -a volume_group=nimvg -a file_system=/export/resources/NIM
The nim_clients_setup command:
——————————

The nim_clients_setup command is used to define your NIM clients, allocate the installation resources,
and initiate a NIM BOS installation on the clients.

The nim_clients_setup command uses the definitions in the basic_res_grp resource to allocate
the necessary NIM resources to perform a mksysb restore operation on the selected clients.
The usage for nim_clients_setup is as follows:

Usage nim_clients_setup: Setup and Initialize BOS install for NIM clients.
       nim_clients_setup [-m mksysb_resource]
 [-c] [-r] [-v] client_objects
-m    specify mksysb resource object name -OR- absolute file path.
-c    define client objects from client.defs file.
-r    reboot client objects for BOS install.
-v    Enables debug output.

Note: If no client object names are given, all clients in the NIM environment are enabled for
BOS installation; unless clients are defined using the -c option.

Examples:
To define client objects from /export/nim/client.defs file, initialize the newly defined clients
for BOS install using resources from the basic_res_grp resource group, and reboot the clients to begin install, type:
# nim_clients_setup -c -r

To initialize clients client1 and client2 for BOS install, using the backup file
/export/resource/NIM/530mach.sysb as the restore image, type:
# nim_clients_setup -m /export/resource/NIM/530mach.sysb \ client1 client2

To initialize all clients in the NIM environment for native (rte) BOS install using resources
from the basic_res_grp resource group, type:
# nim_clients_setup -n
How to define a standalone machine in NIM.

      nim -o define -t standalone \
                -a platform=chrp \
                -a if1=”subnet-74 FQDN of Machine 0″ \
                -a cable_type1=tp \
                -a net_settings1=”speed duplex” \
                -a netboot_kernel=”up or mp \
                name of resource

How to initiate an install of a machine from a mksysb image.

      nim -o bos_inst \
                -a source=mksysb \
                -a spot=aix520-01_spot \
                -a mksysb=base520-02-64bit_mksysb or base520-02-32bit_mksysb \
                -a accept_licenses=yes \
                -a preserve_res=yes \
                -a installp_flags=”cNgXY” \
                -a fb_script=osg-mksysb-install_firstboot \
                name of resource

If you do not want the machine to be rebooted right now, then add the following:

     -a no_client_boot=yes

How to reset the NIM state of a machine.

      nim -o reset \
                name of resource
 
You can add the following to force a reset

                -a force=yes

If after you try to reset the state and try to install again and you are told that the resource is
still allocated run the following:

      nim -Fo deallocate \
 -a subclass=all
 name of resource
How to take a mksysb of a machine.

        nim -o define -t mksysb \
           -a server=master \
           -a location=/export/nim/mksysb/<name of resource>.mksysb \
                  -a source=resource name of machine to take mksysb \
            -a mk_image=yes \
            -a mksysb_flags=’e’\
           -a exclude_files=osg-default_exclude \
           name of resource
   
How to make a NIM exclude file.

        nim -o define -t exclude_files \
                  -a server=master
           -a location=/export/nim/misc/osg-default.exclude \
           osg-default_exclude
   
How to define a script resource in NIM.

        nim -o define -t script \
           -a server=master \
           -a location=/export/nim/misc/<name of the resource>.sh \
           name of resource
   
How to define a firstboot script

        nim -o define -t fb_script \
           name of the mksysb
   
How to remove a NIM resource.

        nim -o remove \
             -a rm_image=yes \
           name of the mksysb
   
Note that this process doesremove the mksysb file on disk.

Updating installed software
      nimclient -o cust \
                -a lpp_source=lpp source \
                -a installp_bundle=installp bundle
Remark about nimsh:
——————-

Using the NIM service handler for client communication
NIM makes use of the remote shell server (rshd) when it performs remote execution on clients. The server provides
remote execution facilities with authentication based on privileged port numbers from trusted hosts.

AIX® 5.3 uses NIM Service Handler (NIMSH) to eliminate the need for rsh services during NIM client communication.
The NIM client daemon (NIMSH) uses reserved ports 3901 and 3902, and it installs as part of the
bos.sysmgt.nim.client fileset.

NIMSH allows you to query network machines by hostname. NIMSH processes query requests and returns NIM client
configuration parameters used for defining hosts within a NIM environment. Using NIMSH, you can define
NIM clients without knowing any system or network-specific information.

While NIMSH eliminates the need for rsh, it does not provide trusted authentication based on key encryption.
To use cryptographic authentication with NIMSH, you can configure OpenSSL in the NIM environment.
When you install OpenSSL on a NIM clients, SSL socket connections are established during NIMSH
service authentication. Enabling OpenSSL provides SSL key generation and includes all cipher suites
supported in SSL version 3.

 

64.2 Complete NIM Example:
==========================

(This is actually a nice example).

 

1.Installing the NIM filesets<top>

The required filesets for a NIM master server and client

bos.sysmgt.nim.client
bos.sysmgt.nim.master
bos.sysmgt.nim.spot
These are available on the AIX Product CD 1.

Install the NIM client, master and spot filesets

# installp -qaX -d /dev/cd0 bos.sysmgt.nim.master bos.sysmgt.nim.client bos.sysmgt.nim.spot

At the end of the install you should see the below

Installation Summary
——————–
Name Level Part Event Result

bos.sysmgt.nim.client 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.spot 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.master 5.3.0.0 USR APPLY SUCCESS
bos.sysmgt.nim.client 5.3.0.0 ROOT APPLY SUCCESS
2.Create a tftpboot filesystem and mount it <top>

# crfs -v jfs2 -g rootvg -a size=381M -m /tftpboot -A yes -t rw
# mount /tftpboot
3.Configure the NIM environment (ensure you have AIX product CD 1 loaded in the CD or DVD Drive<top>

# smitty nim_config_env

Select the defaults as below, apart from the size of the /export/lpp_source and /export/spot filesystems.
As we are going to be copying additional products into these areas we need a reasonable amount of space

You also need to specify the primary network interface and path to the CD or DVD drive

Initialize the NIM Master:
* Primary Network Interface for the NIM Master [en0]
Basic Installation Resources:
* Input device for installation images [/dev/cd0]
* LPP_SOURCE Name [lpp_source1]
* LPP_SOURCE Directory [/export/lpp_source]
Create new filesystem for LPP_SOURCE? [yes]
Filesystem SIZE (MB) [6553]
VOLUME GROUP for new filesystem [rootvg]
* SPOT Name [spot1]
* SPOT Directory [/export/spot]
Create new filesystem for SPOT? [yes]
Filesystem SIZE (MB) [2097]
VOLUME GROUP for new filesystem [rootvg]
Create Diskless/Dataless Machine Resources? [no]
Specify Resource Name to Define:
ROOT (required for diskless and dataless) [root1]
DUMP (required for diskless and dataless) [dump1]
PAGING (required for diskless) [paging1]
HOME (optional) [home1]
SHARED_HOME (optional) [shared_home1]
TMP (optional) [tmp1]
Diskless/Dataless resource directory [/export/dd_resource]
Create new filesystem for resources? [yes]
Filesystem SIZE (MB) [150]
VOLUME GROUP for new filesystem [rootvg]
Define NIM System Bundles? [yes]
Add Machines from a Definition File? [no]
Specify Filename []
* Remove all newly added NIM definitions [no]
and filesystems if any part of this
operation fails?
4.Populating the lpp_source1 resource with additional software<top>

Copy the contents of AIX Volume 2,5, Expansion Pack and the AIX ToolBox to the lpp_source, for each CD
enter the below

# nim -o update -a packages=all -a source=/dev/cd0 lpp_source1
5.Updating the SPOT and lpp_source1 resources<top>

If the AIX CD’s you are using to create the lpp and spot resources is a base level AIX CD, and the clients
you are intending to build are at a higher level than the base level. You will need to update the
lpp and spot resources.

Identify the location of your update filesets and update with the below command

# nim_update_all -l lpp_source1 -s spot1 -d /location/of/filesets –u –B

Once complete, confirm the maintenance level of the spot1 resource with the below command

# lsnim –l spot1

In this example, I have updated the lpp_source1 and spot1 to AIX 5.3 ML 3

spot1:
class = resources
type = spot
plat_defined = chrp
arch = power
bos_license = yes
Rstate = ready for use
prev_state = verification is being performed
location = /export/spot/spot1/usr
version = 5
release = 3
mod = 0
oslevel_r = 5300-01
alloc_count = 0
server = master
Rstate_result = success
mk_netboot = yes
mk_netboot = yes
mk_netboot = yes
6.Defining NIM machines <top>

Before you can start a BOS install task you need to define the machines you are going to install.

You need details of

a.server hostname
b.platform
c.netboot_kernel
d.subnet mask
e.default gateway of the master
f.master name

To define a NIM client, for eg sp-tsm2

# nim -o define -t standalone -a platform=chrp \
-a netboot_kernel=mp \
-a if1=”find_net sp-tsm2.caledonia.speedy.wan 0″ \
-a net_definition=”ent 255.255.255.0 10.110.72.1 master” sp-tsm2

If you are adding a machine that is already running, you need to ensure the bos.sysmgt.nim.client fileset
is installed and issue the following command on the client

note: change the name= and master= to match the client and master you are adding

# niminit -a name=pr-testerp -a master=pr-tsm -a pif_name=en0
The output from the following command will show your newly defined machine

# lsnim –c machines

[sp-tsm1] scripts # lsnim -c machines
master machines master
sp-tsm2 machines standalone

To get detailed output of your newly created machine, run the below

[sp-tsm1] scripts # lsnim -l sp-tsm2
sp-tsm2:
class = machines
type = standalone
connect = shell
platform = chrp
netboot_kernel = mp
if1 = speedy_network sp-tsm2.caledonia.speedy.wan 0
cable_type1 = N/A
Cstate = ready for a NIM operation
prev_state = not running
Mstate = currently running
cpuid = 00C13E8A4C00
Cstate_result = success
7.Configuring client communications

To configure SSL client communication as opposed to the traditional and un-secure rhost method perform the following

a.On the master server and clients install the openssl rpm from the AIX toolbox

# rpm –ivh openssl-0.9.7g-1

b.Next configure the NIM master for SSL

# nimconfig –c

c.Then on each client configure as below

# mv /etc/niminfo /etc/niminfo.bak
# niminit -aname=pr-testdb -amaster=pr-tsm -a connect=nimsh
# nimclient –C

d.On the NIM master test the nimsh communication

# nim -o lslpp pr-testdb
8.Defining NIM groups<top>

Once you have defined your machines, add them to add mac_group. This will aid administration for future
installation tasks

To define a group containing the sp-tsm2 machine run the below command
# nim –o define –t mac_group –a add_member=sp-tsm2 speedy_mac_group

For each machine to be added, use the option and argument ‘-a add_member=<hostname>’ where <hostname> is the name
of the server you are adding
9.Defining a bosinst.data file<top>

A bosinst data file is a file contained answers to questions usually asked during a manual BOS install.
A standard Red Squared bosinst.data file contains the below information and is stored in the /export/bosinst
directory. (note the highlighted areas, specifically the disk location. We will be mirroring the root disk
as part of the post task during the BOS install procedure)

control_flow:
CONSOLE = Default
INSTALL_METHOD = overwrite
PROMPT = no
EXISTING_SYSTEM_OVERWRITE = yes
INSTALL_X_IF_ADAPTER = yes
RUN_STARTUP = yes
RM_INST_ROOTS = no
ERROR_EXIT =
CUSTOMIZATION_FILE =
TCB = no
INSTALL_TYPE =
BUNDLES =
RECOVER_DEVICES = no
BOSINST_DEBUG = no
ACCEPT_LICENSES = yes
DESKTOP = NONE
INSTALL_DEVICES_AND_UPDATES = yes
IMPORT_USER_VGS =
ENABLE_64BIT_KERNEL = yes
CREATE_JFS2_FS = yes
ALL_DEVICES_KERNELS = yes
GRAPHICS_BUNDLE = yes
MOZILLA_BUNDLE = no
KERBEROS_5_BUNDLE = no
SERVER_BUNDLE = yes
REMOVE_JAVA_118 = no
HARDWARE_DUMP = yes
ADD_CDE = yes
ADD_GNOME = no
ADD_KDE = no
ERASE_ITERATIONS = 0
ERASE_PATTERNS =
target_disk_data:
LOCATION =
SIZE_MB =
HDISKNAME = hdisk0

locale:
BOSINST_LANG = en_US
CULTURAL_CONVENTION = en_GB
MESSAGES = en_US
KEYBOARD = en_GB

large_dumplv:
DUMPDEVICE=lg_dumplv
SIZEGB=2

dump:
PRIMARY=/dev/lg_dumplv
SECONDARY=/dev/sysdumpnull
FORCECOPY=no
COPYDIR=/dump
ALLOWS_ALLOW=yes

Once you have created the bosinst.data file, you need to define it to the NIM environment with the below command

# nim –o define –t bosinst_data –a server=master \
10.Defining a post script resource<top>

A script resource is used as part of the bosinst task. The resource contains commands to be executed
on the NIM client after the BOS install has completed. The inst_script file should reside in the “/export/bosinst”
directory.

The below inst_script contains commands relevant to an Oracle database server

Note: In all instances the root disk should be mirrored

/usr/sbin/chdev -l sys0 -a maxuproc=5000
/usr/sbin/chdev -l sys0 -a autorestart=true
/usr/sbin/vmo -o lru_file_repage=0
/usr/sbin/vmo -o strict_maxclient=0
/usr/sbin/vmo -o maxperm%=45
/usr/sbin/vmo -o maxclient%=45
/usr/sbin/vmo -o minperm%=15
/usr/sbin/tunchange -f nextboot -t vmo -o lru_file_repage=0
/usr/sbin/tunchange -f nextboot -t vmo -o strict_maxclient=0
/usr/sbin/tunchange -f nextboot -t vmo -o maxperm%=45
/usr/sbin/tunchange -f nextboot -t vmo -o maxclient%=45
/usr/sbin/tunchange -f nextboot -t vmo -o minperm%=15
/usr/sbin/chfs -a size=+1024M /usr
/usr/sbin/chfs -a size=+512M /opt
/usr/sbin/chfs -a size=+512M /home
/usr/sbin/chfs -a size=+512M /tmp
/usr/sbin/chfs -a size=+512M /var
/usr/bin/mkgroup id=500 oinstall
/usr/bin/mkuser id=1001 groups=oinstall oracle
/usr/bin/mkgroup id=501 red2ops
/usr/bin/mkuser id=1002 groups=red2ops red2ops
/usr/bin/mkdir /home/root
/usr/bin/chuser home=/home/root root
/usr/sbin/crfs -v jfs2 -g rootvg -a size=128M -m /usr/local -A yes -t rw
/usr/sbin/crfs -v jfs2 -g rootvg -a size=128M -m /usr/red2 -A yes -t rw
/usr/sbin/crfs -v jfs2 -g rootvg -a size=8G -m /oracle_home -A yes -t rw
/usr/sbin/crfs -v jfs2 -g rootvg -a size=3G -m /oracle_base -A yes -t rw
/usr/sbin/crfs -v jfs2 -g rootvg -a size=3G -m /dump -A yes -t rw
/usr/sbin/mount -a
/usr/bin/chown oracleinstall /oracle_home
/usr/bin/chown oracleinstall /oracle_base
/usr/bin/echo ’sp-tsm1 root’ >> /home/root/.rhosts
/usr/bin/rcp sp-tsm1:/home/root/.profile /home/root/.profile
/usr/bin/rcp sp-tsm1:/home/root/.kshrc /home/root/.kshrc
/usr/bin/rcp sp-tsm1:/etc/security/limits.nim /etc/security/limits
/usr/sbin/extendvg rootvg hdisk1
/usr/sbin/mirrorvg rootvg
/usr/sbin/syncvg -v rootvg
/usr/sbin/bosboot -a -d /dev/hdisk1
/usr/sbin/chvg -a ‘y’ -Q ‘n’ -x ‘n’ rootvg
/usr/bin/bootlist -m normal hdisk0 hdisk1
/usr/sbin/chps -s16 hd6
/usr/bin/sysdumpdev –K

Once created, define the script to the NIM server with the below command

# nim –o define –t script –a server=master \
–a location=/export/bosinst/inst_script inst_script
Details of your newly created script resource can be viewed with the below

[sp-tsm1] bosinst # lsnim -l speedy_inst_script
speedy_inst_script:
class = resources
type = script
Rstate = ready for use
prev_state = unavailable for use
location = /export/bosinst/inst_script
alloc_count = 0
server = master
11.Backing up and restoring the NIM database<top>

Now that you have created a number of resources and machines, it would be a good idea to add a cron job
to take a backup of the NIM database on a weekly basis. This will by default be picked up by Tivoli and mksysb
then sent to tape.

Create an executable script called nim_backup_db.sh located in /usr/red2/scripts

#!/bin/sh
#——————————————————————————–
#
# File : nim_backup_db.sh
#
# Author : Steve Burgess
#
# Description : Wrapper script to backup the NIM database
#
# Change History:
#
# Date Version Author Description
# ——- ——- —————- —————————–
#——————————————————————————–

#————————-
# Backup The NIM database
#————————-

/usr/lpp/bos.sysmgt/nim/methods/m_backup_db /etc/objrepos/nimdb_backup 2>&1 | tee /usr/red2/logs/nim_backup.log

if [ $? -ne 0 ]
then
echo “`date +%Y%m%d` NIM_BACKUP_FAILURE” | tee -a /usr/red2/logs/nim_backup.log
else
echo “`date +%Y%m%d` NIM_BACKUP_SUCCESS” | tee -a /usr/red2/logs/nim_backup.log
fi

 

Add the script to roots crontab (as below)
# Backup the NIM database once a week
1 00 * * 0 /usr/red2/scripts/nim_backup_db.sh > /dev/null 2>&1
To restore the NIM database following corruption or applying to another server

# /usr/lpp/bos.sysmgt/nim/methods/m_restore_db –f /etc/objrepos/nimdb.backup

 

12.Initiating a BOS Installation <top>

You are now ready to initiate a BOS install for one of your defined machines. Run the below command
to initate a BOS install for sp-tsm2:

nim -o bos_inst -a source=rte \
-a lpp_source=lpp_source1 \
-a spot=spot1 \
-a filesets=”Java14_64 bos.adt bos.iconv X11.adt vac.C vac.aix50 tivoli.tsm.client.api.32bit tivoli.tsm.client.ba openssl-0.9.7d-1.aix5.1.ppc.rpm openssh.base
openssh.license lsof-4.61-3.aix5.1.ppc.rpm zip-2.3-3.aix4.3.ppc.rpm unzip-5.51-1.aix5.1.ppc.rpm” \
-a accept_licenses=yes \
-a script=inst_script \
-a boot_client=no \
-a bosinst_data=bosinst \
sp-tsm2

This will make the previously created resources, inst_script and bosinst available to the server.

Additional filesets, as defined in the line

-a filesets=<fileset names>

will be installed as part of the installation procedure. For additional filesets, append them to the filesets line

Next you need to follow the below procedure to boot your machine from the NIM server

· Begin with your machine turned off.
If the system provided requires a System Management Services (SMS) diskette, insert it into the diskette drive of the client and turn on the machine. If you do not insert an SMS diskette at this time and one is required, you will be prompted to insert one later.
A graphics image is displayed on your screen. Press the F1 key as icons begin to display from left to right on the bottom of your display.
The System Management Services menu displays on your screen. Select the Utilities option.
From the System Management Services Utilities menu, select the Remote Initial Program Load Setup option.
From the Network Parameters screen, select the IP Parameters option.
Set or change the values displayed so they are correct for snhent01.

Specify the IP address of:
The client machine you are booting in the client address field. : 10.20.5.253
Your NIM server in the bootp server address field. : 10.20.5.254
Your client’s gateway in the gateway address field. 10.20.5.1
Specify the subnet mask of 255.255.255.0 for the client machine if you are prompted for one in the subnet mask field. All machines in your subnet have the same subnet mask.
After you specify the addresses, press Enter to save the addresses and continue.
The Network Parameters screen is displayed. Select the Ping option.
Select the network adapter to be used as the client’s boot device.
Verify that the displayed addresses are the same as the addresses you specified for your boot device.
If the addresses are incorrect, press Esc until you return to the main menu. Then, go back to step 5.
If the addresses are correct, press Enter to perform the ping test. The ping test may take several seconds to complete.
If the ping test fails, verify that the addresses are correct, and perform network problem determination if necessary. If the ping test completes successfully, press Enter to acknowledge the success message. Then, press Esc until you return to the System Management Services menu.
From the System Management Services menu, choose the Select Boot Devices option.
Select the network adapter to be used for the network boot from the list of displayed bootable devices. Be sure to select the correct network type Ethernet. After making your selection, the machine will boot over the network.

Following successful BOS installation, you will need to confirm the post tasks you defined in your inst_script have completed. Anything that has failed will need to be run manually
13.Taking a mksysb of your new server<top>

To take a mksysb of the newly created server onto the NIM server, you will need to create an new filesystem (not in rootvg) to hold the mksysb images. The filesystem should have a mount point of /export/mksysb_clients and of the type jfs2. To create a 20gb filesystem in tsmvg run the below command

# crfs -v jfs2 -g tsmvg -a size=20G -m /export/mksysb_clients -A yes -t rw
To take a mksysb of a NIM client, run the below command

nim -o define -t mksysb \
-a server=master \
-a location=/export/mksysb_clients/sp-tsm2 \
-a source=sp-tsm2 \
-a mk_image=yes \
-a mksysb_flags=-e \
sp-tsm2_image

This will create a mksysb resource, as below

[sp-tsm1] scripts # lsnim -l sp-tsm2_image
sp-uat1_image:
class = resources
type = mksysb
arch = power
Rstate = ready for use
prev_state = unavailable for use
location = /export/mksysb_clients/sp-tsm2/sp-tsm2.mksysb
version = 5
release = 3
mod = 0
oslevel_r = 5300-03
alloc_count = 0
server = master
14.Restoring a host from a mksysb<top>

The procedure of restoring a host from a mksysb is fairly simple. In this example, we restore sp-tsm2

Enter the below command to initiate the restore from the NIM server

# nim -o bos_inst -a source=mksysb \
-a mksysb=sp-tsm2_image \
-a lpp_source=lpp_source1 \
-a spot=spot1 \
-a accept_licenses=yes \
-a boot_client=no \
sp-tsm2

Once entered, refer to section 11 to boot the server you are recovering over the network

15.Booting the server into diagnostics<top>

Occasionally you may need to boot the server into diagnostic mode to allow you to resolve a hardware issue. To do this, first enter the below
# nim –o diag –a spot=spot1 sp-tsm2

Once entered, refer to section 11 to boot the server into diagnostics over the network

16.Booting a server into maintenance<top>

Occasionally you may need to boot the server into maintenance mode. To do this, first enter the below

# nim –o maint_boot spot=spot1 sp-tsm2

Once entered, refer to section 11 to boot the server into diagnostics over the network

After successfully booting and defining the console, the System Maintenance menu is displayed. The maintenance menu options and their descriptions are described below.

Access a Root Volume Group
This option allows you to activate the root volume group and start the maintenance shell with a full set of commands.
Copy a System Dump to Removable Media
This option allows you to copy a previous system dump to external media.
Access Advanced Maintenance Function
This option allows you to start a maintenance shell with a limited set of commands.
17.Installing additional software on a client<top>

Occasionally you may need to install additional filesets on a client. You first need to add the software to the lpp_source by simply copying it to the lpp_source directory. You then need to action the below command

# nim –Fo check lpp_source1

Following that you can initiate the install on the client

# nim –o cust –a lpp_source=lpp_source1 –a filesets=bos.adt \
-a installp_flags=”a c g X p” sp-tsm2

Note: refer to the installp man page for options on installp_flags

To install a pre-defined or new installp bundle (output from # lsnim -t installp_bundle)

# nim –o cust –a lpp_source=lpp_source1 –a installp_bundle=openssh_server –a installp_flags=” a c g X p” pr-testdb

18.Update software on a client<top>

To update a client with the whole contents of an lpp resource, enter the below

# nim –o update –a packages=all –a source=lpp_source1 sp-tsm2

19.To add a new lpp resource that contains a new AIX level, then apply that update to a NIM client. <top>

First copy the contents of the ML to a filesystem area, then run

# nim –o define –t lpp_source –a location=/export/lpp_source/aix_maint_ML3 \
–a server=master aix_maint_ML3

To update a server from the new aix maint level # nim -o cust -a lpp_source=aix_maint_ML3 -a fixes=update_all \
-a installp_flags=”a c g X p” sp-tsm2

Posted in AIX. Tags: . Leave a Comment »

TSM client upgrade/install

ftp service.boulder.ibm.com
cd /storage/tivoli-storage-management/maintenance/client
drwxr-sr-x  10 17037    209             256 Jan 26 2007  v5r4
drwxr-sr-x  10 17037    209             256 Nov 15 2007  v5r5
226 Transfer complete.
mget client tar.Z
gunzip 5.4.2.0-TIV-TSMBAC-AIX.tar.Z
tar -tvf 5.4.2.0-TIV-TSMBAC-AIX.tar
tar -xvf 5.4.2.0-TIV-TSMBAC-AIX.tar
NFS mount directory on commonserver
Mount dir on target server
mount -n commonserver /sam /mnt
gunzip 5.4.2.0-TIV-TSMBAC-AIX.tar.Z
tar -tvf 5.4.2.0-TIV-TSMBAC-AIX.tar
tar -xvf 5.4.2.0-TIV-TSMBAC-AIX.tar
If you are copying the client files into a local directory first, a .toc file is automatically created by the installp command.
smitty installp
cd /usr/tivoli/tsm/client/ba/bin/
nohup dsmcad &
OR
dsmcad -optfile=/tsm/dsm.opt

Posted in AIX. Tags: . Leave a Comment »