AIX Upgrade with NIM – nim_alt_clone

0
3555

Several methods are available to apply the latest AIX technology level (TL) and service pack (SP) to AIX systems. My favorite has always been multibos, which allows you to update a second instance of AIX within a single root volume group (rootvg). Its advantage is you don’t need a second disk to perform the update. The downside is your rootvg logical volumes are renamed to “bos_.” This causes discomfort for some administrators.

Alternatively, you can use Network Install Manager (NIM) and alt_disk_install to install TL/SP updates. NIM provides a method for cloning your rootvg to an alternate disk and then installing the latest fixes to the alternate rootvg image. Potential advantages of nim_alt_clone (as opposed to multibos or alt_disk_install on its own) include:

  • Your rootvg logical volumes aren’t renamed, and
  • You can perform the update on a group of NIM clients

To perform this task on a single NIM client, start by verifying you’ve created a new NIM lpp_source for fixes on NIM master (nim1). The SP4 lpp_source resource (in bold) contains Service Pack 4 for AIX V7.1 TL1. This resource will be used to update the NIM client in this example.

root@nim1 : / # lsnim -t lpp_source | grep SP4
SP4                         resources       lpp_source

The NIM client (aix1) has a spare disk available (hdisk1). Use this for the alternate rootvg. This is where an image of the existing rootvg will be housed and the updates applied.

aix1 : /home # lspv
hdisk1       00c342c637f21a59             None
hdisk2       00c342c6161c6b47             rootvg        active

Three log files will be created and referenced on the NIM client during the nim_alt_clone operation. If I’ve previously used this method to update a client, I prefer to clear these log files before I start a new update. This way I can review the log files without wading through many lines of old information.

aix1 : / # cd /var/adm/ras/
aix1 : /var/adm/ras # ls -ltr *alt*
-rw-r--r--  1 root   system    0 Jul 02 14:14 altinst_rootvg.log
-rw-r--r--  1 root   system    916402 Jul 02 15:06 nim.alt_disk_install
-rw-r--r--  1 root   system    96997 Jul 02 15:06 alt_disk_inst.log

aix1 : /var/adm/ras # for i in `ls *alt*`
> do
> >$i
> done

aix1 : /var/adm/ras # ls -ltr *alt*
-rw-r--r--  1 root     system       0 Jul 02 15:08 nim.alt_disk_install
-rw-r--r--  1 root     system       0 Jul 02 15:08 altinst_rootvg.log
-rw-r--r--  1 root     system       0 Jul 02 15:08 alt_disk_inst.log

You can initiate the nim_alt_clone operation either from the command line or the System Management Interface Tool (SMIT). To start the update from the NIM master command line, enter:

nim -o alt_disk_install -a source=rootvg -a disk=hdisk1 -a
fixes=update_all -a lpp_source=SP4 -a installp_flags="-acNgXY" aix1

This command indicates you wish to perform an alt_disk_install operation on the NIM client’s rootvg. It also specifies hdisk1 is the cloning target and that the file sets in the cloned rootvg will be updated (update_all) from the SP4 lpp_source. In this instance, I’ve specified a single NIM client (aix1). To perform the same operation on a group of NIM clients, specify a NIM machine group as the target instead.

Once this command has been executed, you’ll return to the command prompt almost immediately. All activity is now occurring on the NIM client. From the NIM master, you can check the current state of the NIM client with the lsnim command. The output indicates that the alt_disk_install operation is underway on the client; in particular, the process is backing up the client’s rootvg file systems and restoring them to the alternate (cloned) rootvg.

root@nim1 : / # lsnim -l aix1
aix1:
   class          = machines
   type           = standalone
   connect        = shell
   platform       = chrp
   netboot_kernel = 64
   if1            = network1 aix1 0
   cable_type1    = N/A
   Cstate         = alt_disk_install operation is being performed
   prev_state     = a client is being prepared for alt_disk_install
   Mstate         = currently running
   info       = Backing-up the rootvg files and restoring them to the
                alternate file system...
   lpp_source     = SP4
   cpuid          = 00C342C64C00
   control        = master
   Cstate_result  = success

If you prefer, you can use SMIT to perform this task (as shown in this SMIT panel):

root@nim1 : / # smit nim_alt_clone

                        Clone the rootvg to an Alternate Disk

Type or select values in entry fields.
Press Enter AFTER making all desired changes.
                                                        [Entry Fields]
* Target Machine / Group to Install                  [aix1]          +
* Target Disk(s) to install                          [hdisk1]
  Phase to execute                                    all            +
  IMAGE_DATA resource                                []              +/
    EXCLUDE_FILES resource                           []              +/
     (leave blank to include all files in backup)

  BUNDLE to install                                  []              +
    -OR-
  Fileset(s) to install                              []

  FIX_BUNDLE to install                              []              +
    -OR-
  FIXES to install                                   [update_all]
  LPP_SOURCE                                         [SP4]           +
  (required if filesets, bundles or fixes used)

  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            +

  Customization SCRIPT resource                      []              +/
  Set bootlist to boot from this disk
  on next reboot                                      yes            +
  Reboot when complete?                               no             +
  Verbose output?                                     no             +
  Debug output?                                       no             +

  Group controls (only valid for group targets):
    Number of concurrent operations                  []              #
    Time limit (hours)                               []              #

On the client, you can review the nim.alt_disk_install log file to determine if the updates were installed successfully. In this example, the log file shows that the alt_disk_copy utility cloned rootvg to hdisk1 and then installed the updates.

aix1 : /var/adm/ras # ls -ltr *alt*
-rw-r--r--  1 root   system         0 Jul 03 11:53 altinst_rootvg.log
-rw-r--r--  1 root   system    271213 Jul 03 12:11 alt_disk_inst.log
-rw-r--r--  1 root   system    907044 Jul 03 12:11 nim.alt_disk_install 

aix1 : /var/adm/ras # vi nim.alt_disk_install
BEGIN:Tue Jul  3 11:53:35 2012:07030153352012
+---------------------------------------------------------------------+
ATTENTION: calling new module /usr/sbin/alt_disk_copy.
Please see the alt_disk_copy man page and documentation for more details.
Executing command: {/usr/sbin/alt_disk_copy -N -b "update_all" -I
"-acNgXY" -l "/tmp/_nim_dir_7536682/lpp_source" -d "hdisk1"}
+---------------------------------------------------------------------+
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5
Creating logical volume alt_hd6
Creating logical volume alt_hd8
Creating logical volume alt_hd4
Creating logical volume alt_hd2
Creating logical volume alt_hd9var
Creating logical volume alt_hd3
Creating logical volume alt_hd1
Creating logical volume alt_hd10opt
Creating logical volume alt_local
Creating logical volume alt_loglv
Creating logical volume alt_hd7
Creating logical volume alt_hd71
Creating logical volume alt_hd11admin
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/usr/local file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/log file system.
Creating /alt_inst/var/tsm/log file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the
alternate file system...
Installing optional filesets or updates into alt_inst_rootvg...
…etc…
+---------------------------------------------------------------------+
                   BUILDDATE Verification ...
+---------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS
------------------
  221  Selected to be installed, of which:
      221  Passed pre-installation verification
  ----
  221  Total to be installed
+---------------------------------------------------------------------+
                         Installing Software...
+---------------------------------------------------------------------+

installp:  APPLYING software for:
        perl.man.en_US 5.10.1.100
…etc…

rsct.core.utils            3.1.2.1        USR        COMMIT     SUCCESS
rsct.core.utils            3.1.2.1        ROOT       COMMIT     SUCCESS
rsct.core.rmc              3.1.2.1        USR        COMMIT     SUCCESS
rsct.core.rmc              3.1.2.1        ROOT       COMMIT     SUCCESS

installp:  * * * A T T E N T I O N ! ! !
        Software changes processed during this session require
        any diskless/dataless clients to which this SPOT is
        currently allocated to be rebooted.
install_all_updates: Log file is /var/adm/ras/install_all_updates.log
install_all_updates: Result = SUCCESS
Modifying ODM on cloned disk.
Building boot image on cloned disk.
forced unmount of /alt_inst/var/tsm/log
forced unmount of /alt_inst/var/log/audit
forced unmount of /alt_inst/var/log
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr/local/chksys
forced unmount of /alt_inst/usr/local
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt/Symantec
forced unmount of /alt_inst/opt/Symantec
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home/ncp
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk1 blv=hd5

END:Tue Jul  3 12:11:49 2012:07030211492012

You can also check the level of the cloned rootvg environment using the chroot command on the NIM client. First you must “wake up” the alternate rootvg.

aix1 : / # alt_rootvg_op -W -d hdisk1
Waking up altinst_rootvg volume group ...

aix1 : / # df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          524288    380024   28%     3091     3% /
/dev/hd2         3801088    396856   90%    34020     8% /usr
/dev/hd9var      2621440   2279336   14%     3560     2% /var
/dev/hd3          524288    499272    5%      105     1% /tmp
/dev/hd1          524288    507336    4%      102     1% /home
/proc                  -         -    -         -     -  /proc
/dev/hd10opt      524288    278872   47%     3370     6% /opt
/dev/local        524288    480712    9%      262     1% /usr/local
/dev/loglv        524288    506416    4%       62     1% /var/log
/dev/hd11admin    262144    253816    4%       20     1% /admin
/dev/alt_hd4      524288    365552   31%     3871     3% /alt_inst
/dev/alt_hd11admin 262144   253808    4%       22     1% alt_inst/admin
/dev/alt_hd1      524288    507336    4%      104     1% /alt_inst/home
/dev/alt_hd10opt 1310720   562888   58%     5694     4% /alt_inst/opt
/dev/alt_hd3     524288    499120    5%      116     1% /alt_inst/tmp
/dev/alt_hd2     5636096   184120   97%   103336    15% /alt_inst/usr
/dev/alt_local   524288    480712    9%    262   1% /alt_inst/usr/local
/dev/alt_hd9var  2621440   1835656   30%   6632     3% /alt_inst/var
/dev/alt_loglv   524288    506408    4%    63     1% /alt_inst/var/log

Next, start a (chroot) shell within the alternate rootvg and run the oslevel command to verify the updated TL/SP information.

aix1 : / # chroot /alt_inst /usr/bin/ksh

aix1 : / # oslevel -s
7100-01-04-1216

aix1 : / # instfix -i | grep AIX
    All filesets for 7.1.0.0_AIX_ML were found.
    All filesets for 7100-00_AIX_ML were found.
    All filesets for 7100-01_AIX_ML were found.

aix1 : / # instfix -i | grep SP
    All filesets for 71-00-011037_SP were found.
    All filesets for 71-00-021041_SP were found.
    All filesets for 71-00-031115_SP were found.
    All filesets for 71-01-011141_SP were found.
    All filesets for 71-00-041140_SP were found.
    All filesets for 71-01-021150_SP were found.
    All filesets for 71-01-031207_SP were found.
    All filesets for 71-00-051207_SP were found.
    All filesets for 71-01-041216_SP were found.

aix1 : / # lppchk -m3 -v
aix1 : / # exit

Once you exit the chroot shell, you’re returned to the existing rootvg environment. The oslevel command confirms that service pack 4 is not installed in the original rootvg (as expected).

aix1 : / # oslevel -s
7100-01-01-1141

Now that you’ve verified the correct AIX level, you can put the cloned rootvg back to “sleep.”

aix1 : / # alt_rootvg_op -S altinst_rootvg
Putting volume group altinst_rootvg to sleep ...
forced unmount of /alt_inst/var/log
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr/local
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
Fixing LV control blocks...
Fixing file system superblocks...

The bootlist command confirms that you will reboot using the alternate rootvg disk (hdisk1).

aix1 : / # bootlist -m normal -o
hdisk1 blv=hd5 pathid=0
hdisk1 blv=hd5 pathid=1

aix1 : / # lspv
hdisk1        00c342c637f21a59                  altinst_rootvg
hdisk2        00c342c6161c6b47                  rootvg          active

aix1 : / # shutdown -Fr

; The system reboots here…

aix1 : / # uptime
  02:54PM   up 1 min,  1 user,  load average: 1.23, 0.37, 0.13
aix1 : / #

aix1 : / # oslevel -s
7100-01-04-1216

aix1 : / # df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4          524288    365136   31%     3850     3% /
/dev/hd2         5636096    184128   97%   103336    15% /usr
/dev/hd9var      2621440   1829816   31%     6760     3% /var
/dev/hd3          524288    498632    5%      128     1% /tmp
/dev/hd1          524288    507336    4%      104     1% /home
/proc                  -         -    -         -     -  /proc
/dev/hd10opt     1310720    523160   61%    10181     7% /opt
/dev/local        524288    480712    9%      262     1% /usr/local
/dev/loglv        524288    506392    4%       63     1% /var/log
/dev/hd11admin     262144    253808    4%       22     1% /admin

If necessary, you can change the boot list to point at the old rootvg (hdisk2) and restart the system on the previous TL/SP. You might choose to do this if there’s a problem with the updates and you need to revert to the previously installed AIX SP level.

aix1 : / # lspv
hdisk1         00c342c637f21a59                  rootvg          active
hdisk2         00c342c6161c6b47                  old_rootvg

Once you’re happy that the system is functioning as expected with the new updates, remove the old rootvg.

aix1 : / # alt_rootvg_op -X old_rootvg

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.