Perform a mksysb client restore using NIM.

This post will describe how to perform a unattended mksysb restore of a NIM client which will be booted from the NIM master via a network interface. Prior to this operation it is necessary that the client mashine is defined as a NIM client and a mksysb image of the client has been created.

In order to perform a mksysb image restore a SPOT resource must be allocated to the NIM client and it must be the same level as the mksysb image. Using the lsnim command we can check the level of the mksysb/spot.

# lsnim -l mk_p2_1201
mk_p2_1201:
class = resources
type = mksysb
arch = power
Rstate = ready for use
prev_state = unavailable for use
location = /nim/images/mk_p2_2012
version = 6
release = 1
mod = 6
oslevel_r = 6100-05
alloc_count = 0
server = master
extracted_spot = SPOT_P2_6105
creation_date = Wed Jan 4 12:22:47 2012
source_image = power2

# nim -o fix_query SPOT_61_ML5 | grep ML
All filesets for 6100-00_AIX_ML were found.
All filesets for 6100-01_AIX_ML were found.
All filesets for 6100-02_AIX_ML were found.
All filesets for 6100-03_AIX_ML were found.
All filesets for 6100-04_AIX_ML were found.
All filesets for 6100-05_AIX_ML were found.

lsnim -l SPOT_61_ML5
SPOT_61_ML5:
   class         = resources
   type          = spot
   plat_defined  = chrp
   arch          = power
   bos_license   = yes
   Rstate        = ready for use
   prev_state    = verification is being performed
   location      = /nim/aix61ml5/SPOT_61_ML5/usr
   version       = 6
   release       = 1
   mod           = 5
   oslevel_r = 6100-05
   alloc_count   = 0
   server        = master
   if_supported  = chrp.64 ent
   Rstate_result = success
   mk_netboot    = yes
   mk_netboot    = yes

If the installation should run in unattended mode the bosinst.data file has to be setup accordingly and defined as a NIM resource.

The bosinst.data file can be extracted from the mksysb image:

# restore -xvqf mk_p2_1201 ./bosinst.data
New volume on mk_p2_1201:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Wed Jan  4 13:49:33 GMT 2012
Files are backed up by name.
The user is root.
x         6481 ./bosinst.data

# ls
bosinst.data  mk_p2_1201

The following entries are the minimum mandatory parameters required for a unattended installation.

CONSOLE = /dev/lft0
INSTALL_METHOD = overwrite
PROMPT = no
ACCEPT_LICENSES = yes

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

target_disk_data:
HDISKNAME = hdisk0

Next the bosinst.data file has to be defined as a NIM resource

 smitty nim_mkres
 bosinst_data

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
* Resource Name                                      [power2_bosinst_data]
* Resource Type                                       bosinst_data
* Server of Resource                                 [master]                                                                                      
* Location of Resource                               [/nim/bs/bosinst.data]                                                                       
  NFS Client Security Method                         []                                                                                            
  NFS Version Access                                 []                                                                                             
  Comments                                           []

  Source for Replication                             []                                                                                            

Verify the resource using lsnim


 lsnim -l p2_bosinst_data
p2_bosinst_data:
   class       = resources
   type        = bosinst_data
   Rstate      = ready for use
   prev_state  = unavailable for use
   location    = /nim/bs/bosinst.data
   alloc_count = 0
   server      = master

Now we can initiate the installstion using smitty nim_bosinst.

Select the client mashine.

As installstion type select mksysb.

Select the mksysb image file and the correspotnding SPOT which must be the same level as the mksysb image.


                                                            Install the Base Operating System on Standalone Clients

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]
* Installation Target                                 power2
* Installation TYPE                                   mksysb
* SPOT                                                SPOT_61_ML5                                                                                                            
  LPP_SOURCE                                         []                                                                                                                     
  MKSYSB                                              mk_p2_1201
  
  BOSINST_DATA to use during installation            []                                                                                                                     
  IMAGE_DATA to use during installation              []                                                                                                                    
  RESOLV_CONF to use for network configuration       []                                                                                                                    
  Customization SCRIPT to run after installation     []                                                                                                                    
  Customization FB Script to run at first reboot     []                                                                                                                     
    ACCEPT new license agreements?                   [no]                                                                                                                   
  Remain NIM client after install?                   [yes]                                                                                                                 
  PRESERVE NIM definitions for resources on          [yes]                                                                                                                  
    this target?
  
  FORCE PUSH the installation?                       [yes]                                                                                                                 
  
  Initiate reboot and installation now?              [yes]                                                                                                                 
    -OR-
  Set bootlist for installation at the               [no]                                                                                                                  
     next reboot?
  
  Additional BUNDLES to install                      []                                                                                                                    
    -OR-
  Additional FILESETS to install                     []                                                                                                                   
    (bundles will be ignored)
  
  installp Flags
    COMMIT software updates?                         [yes]                                                                                                                
    SAVE replaced files?                             [no]                                                                                                                 
    AUTOMATICALLY install requisite software?        [yes]                                                                                                                 
    EXTEND filesystems if space needed?              [yes]                                                                                                                
    OVERWRITE same or newer versions?                [no]                                                                                                                 
    VERIFY install and check file sizes?             [no]                                                                                                                   
    ACCEPT new license agreements?                   [yes]                                                                                                                 
      (AIX V5 and higher machines and resources)
    Preview new LICENSE agreements?                  [no]                                                                                                                
  

“FORCE PUSH” & “Initiate reboot and installation now?” will Initiate the operation from the NIM master server on the client. The NIM master will alter the bootlist order on the client, as the primary boot device will be specified the network adapter of the client machine. Using the lsnim command we can verify which adapter on the client mashine is specified in the NIM database as the network interface:

 # lsnim -l power2 | grep if
   if1               = EN_0 power2 0 ent4

After we start the nim bos_inst operation the following message will appear on the client.


roadcast message from root@power2 (tty) at 15:33:33 ... 

*******************************************************************
*******************************************************************
*******************************************************************

   NIM has initiated a bos installation operation on this machine.
   Automatic reboot and reinstallation will follow shortly...

*******************************************************************
*******************************************************************
*******************************************************************


Before the client will be rebooted we can verify the bootlist order using the bootlist command.

# bootlist -m normal -o
ent4 bserver=192.168.2.6 client=192.168.2.7 gateway=192.168.2.6
hdisk0 blv=hd5 pathid=0

On the master server we can monitor the status of the process.

# lsnim -l power2
power2:
...
   Cstate            = BOS installation has been enabled
   prev_state        = ready for a NIM operation
   Mstate            = currently running
   
...
  
   Cstate            = Base Operating System installation is being performed
   prev_state        = BOS installation has been enabled
   Mstate            = in the process of booting
   info              = BOS install 23% complete : 21% of mksysb data restored.
   

...

   Cstate            = post install processing is being performed
   prev_state        = customization is being performed
   Mstate            = in the process of booting
   info              = BOS install 87% complete : Creating boot image.

...
  
   Cstate            = ready for a NIM operation
   prev_state        = post install processing is being performed
   Mstate            = in the process of booting
   info              = BOS install 100% complete
 
...
   Cstate            = ready for a NIM operation
   prev_state        = in the process of booting


After this, if nothing went wrong the restored client should be up and running.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 25 other followers

%d bloggers like this: