IBM Developer

Tutorial

Migrate NIM server to the latest IBM AIX release

Step-by-step guide to a simplified procedure using the virtual media library and the alt_disk_mksysb command

By Srikanth Thanneeru, Saikrishna Akkela

Introduction

Maintaining the Network Installation Manager (NIM) server at the latest level is crucial in a NIM environment. Before migrating any logical partition (LPAR) that acts as a NIM client, it is recommended to first migrate the NIM server. Migrating a NIM server to the latest level can be complex. This tutorial outlines two simplified approaches for migrating the NIM server to the latest IBM AIX release:

  • Migration using the virtual media library
  • Migration using the alt_disk_mksysb command

Note: If your NIM server’s running version is 7.3.X.Y, and you are upgrading clients from 7.3.X.Y to 7.3.X+1.Y+1, then there is no need to upgrade the NIM server. It will continue to operate as expected. However, if you want to update the NIM server from 7.3.X.Y to the latest service pack or technology level, you can use the standard AIX update commands, such as alt_disk_copy, install_all_updates, or geninstall.

Terminology

Here are the key terms used in this tutorial:

  • rootvg: The root volume group (rootvg) containing the base operating system and essential files.
  • alt_disk_copy: Command to clone the root volume group to an alternate disk for upgrades or system maintenance.
  • install_all_updates: Command to install all available updates for installed software packages on the system.
  • geninstall: Command that simplifies and manages the installation of software packages on AIX systems.
  • alt_disk_mksysb: Command to create a backup of the rootvg on an alternate disk, enabling a system recovery or upgrade.
  • mksysb: Command used to create a bootable system backup of the rootvg.
  • gunzip: Utility to decompress files.
  • altinst_rootvg: An alternate instance of the root volume group, used during disk cloning or system updates.
  • alt_rootvg_op: Command to perform operations on an alternate root volume group.
  • old_rootvg: The original root volume group, typically preserved during system upgrades.
  • bos.sysmgt.nim.master: Fileset that defines a system as a NIM master, managing software installation for client systems.
  • installp: AIX command for installing and managing software packages and patches.
  • lpp_source: A directory or resource that contains software installation images used by the NIM environment.
  • 72TL5SP6_lpp: Example of a specific lpp_source resource representing AIX 7.2, Technology Level 5, Service Pack 6.
  • nimvg: Volume group dedicated to store NIM resources.
  • SPOT: Shared Product Object Tree, a NIM resource containing boot images and installation files.
  • 72TL5SP6_spot: Example of a SPOT resource built from AIX 7.2 Technology Level 5, Service Pack 6.

Migration using the virtual media library

Perform the following steps to migrate a NIM server using the virtual media library on a Virtual I/O Server (VIOS) instance:

  1. Assign an optical disk of latest level AIX digital versatile disc (DVD) to your NIM master using VIOS's virtual media library. For more information, refer to the How to configure a VIOS Media Repository/Virtual Media Library (ex. AIX Install/Restore) documentation.

  2. Back up the NIM database using the following commands:

    # lsnim
    master            machines        master
    boot              resources       boot
    nim_script        resources       nim_script
    certificate       resources       certificate
    skynet            networks        ent
    72TL5SP6_lpp      resources       lpp_source
    72TL5SP6_spot     resources       spot
    # /usr/lpp/bos.sysmgt/nim/methods/m_backup_db /export/nim/backups/nimdb.bkp.1
    a ./etc/objrepos/nim_attr 8 blocks.
    a ./etc/objrepos/nim_attr.vc 8 blocks.
    a ./etc/objrepos/nim_object 8 blocks.
    a ./etc/objrepos/nim_object.vc 8 blocks.
    a ./etc/NIM.level 1 blocks.
    a ./etc/niminfo 1 blocks.
    a ./etc/NIM.primary.cpuid 1 blocks.
    #
    

    Note: Always back up your NIM database before performing any update operations. To ensure safety, copy this backup to a different location.

  3. Reboot the NIM server and perform migration using the AIX base operating system (BOS) installation settings. During reboot, choose to boot from the CD-ROM option.

    PowerPC Firmware
    Version FW860.20 (SV860_064)
    SMS (c) Copyright IBM Corp. 2000,2016 All rights reserved.
    -------------------------------------------------------------------------------
    Select Device
    Device  Current  Device
    Number  Position  Name
    1.        -      Interpartition Logical LAN
             ( loc=U8247.22L.211E16A-V4-C2-T1 )
    2.        -      SCSI 49 GB Harddisk, part=2 (AIX 7.3.0)
             ( loc=U8247.22L.211E16A-V4-C104-T1-L8300000000000000 )
    3.        1      SCSI 58 GB Harddisk, part=2 (AIX 7.2.0)
             ( loc=U8247.22L.211E16A-V4-C104-T1-L8100000000000000 )
    4.        -      SCSI CD-ROM
             ( loc=U8247.22L.211E16A-V4-C104-T1-L8400000000000000 )
    
    -------------------------------------------------------------------------------
    Navigation keys:
    M = return to Main Menu
    ESC key = return to previous screen         X = eXit System Management Services
    -------------------------------------------------------------------------------
    Type menu item number and press Enter or select Navigation key:4
    

    In the AIX BOS installation and maintenance, select the change/show installation settings and install option.

    Welcome to Base Operating System
                        Installation and Maintenance
    
    Type the number of your choice and press Enter.  Choice is indicated by >>>.
    
     >>> 1 Start Install Now with Default Settings
    
         2 Change/Show Installation Settings and Install
    
         3 Start Maintenance Mode for System Recovery
    
         4 Make Additional Disks Available
    
         5 Select Storage Adapters
    
         88  Help ?
         99  Previous Menu
    
     >>> Choice [1]: 2
    

    In the AIX BOS installation and settings, select migration as the method of installation and select the target disk (example hdisk0).

                               Installation and Settings
    
     Either type 0 and press Enter to install with current settings, or type the
     number of the setting you want to change and press Enter.
    
         1  System Settings:
              Method of Installation.............Migration
              Disk Where You Want to Install.....hdisk0
    
         2  Primary Language Environment Settings (AFTER Install):
              Cultural Convention................English (United States)
              Language ..........................English (United States)
              Keyboard ..........................English (United States)
              Keyboard Type......................Default
         3  Security Model.......................Default
         4  More Options  (Software install options)
         5  Select Edition.......................standard
     >>> 0  Install with the current settings listed above.
    
                            +-----------------------------------------------------
         88  Help ?         |    WARNING: Base Operating System Installation will
         99  Previous Menu  |    destroy or impair recovery of SOME data on the
                            |    destination disk hdisk0.
     >>> Choice [0]:0
    

    Wait for the migration process to complete.

  4. After the migration is complete, ensure that the NIM database is intact and preserved. Verify the NIM database using the following command:

     # lsnim
     master            machines        master
     boot              resources       boot
     nim_script        resources       nim_script
     certificate       resources       certificate
     skynet            networks        ent
     72TL5SP6_lpp      resources       lpp_source
     72TL5SP6_spot     resources       spot
     # nim -o check 72TL5SP6_lpp
     # nim -o check 72TL5SP6_spot
     #
    

This completes the migration of the NIM server using the VIOS virtual media library method.

Migration using the alt_disk_mksysb command

Note: This method does not preserve configurations, tunables, files, user-created file systems, or custom software on the new disk. To retrieve this information, activate the old_rootvg volume group using the alt_rootvg_op command, as explained in step 9 of this section. This allows you to access and recover specific files or configurations, including the NIM database backup.

To perform AIX migration using the alt_disk_mksysb command, you need an AIX mksysb image of the desired level. Starting Fall 2024, IBM will include an official AIX mksysb image with each service pack, along with the DVD images. This official mksysb image can be used for this method, allowing you to upgrade AIX to a new level.

  1. Inspect the current AIX version using the following command:

     # oslevel -s
     7200-05-05-2246
    
  2. Inspect available NIM resources using the following command:

     # lsnim
     master            machines        master
     boot              resources       boot
     nim_script        resources       nim_script
     certificate       resources       certificate
     skynet            networks        ent
     72TL5SP6_lpp      resources       lpp_source
     72TL5SP6_spot     resources       spot
     #
    

    As NIM resources are spread across multiple file systems, some belonging to the rootvg and others to a separate volume group, such as nimvg. You can use the lsnim command to display the full details of a particular resource, including its physical location on the file system.

  3. Inspect the details of NIM resources (lpp_source: 72TL5SP6_lpp, SPOT: 72TL5SP6_spot in our case) using the following commands:

     # lsnim -l 72TL5SP6_lpp
     72TL5SP6_lpp:
        class       = resources
        type        = lpp_source
        arch        = power
        Rstate      = ready for use
        prev_state  = unavailable for use
        location    = /export/nim/lpp/72TL5SP6_lpp
        simages     = yes
        alloc_count = 0
        server      = master
     # df -g /export/nim/lpp/72TL5SP6_lpp
     Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
     /dev/hd4          10.12      4.19   59%     3711     1% /
     # lsnim -l 72TL5SP6_spot
     72TL5SP6_spot:
        class         = resources
        type          = spot
        plat_defined  = chrp
        arch          = power
        bos_license   = yes
        Rstate        = ready for use
        prev_state    = verification is being performed
        location      = /nim1/spot/72TL5SP6_spot/usr
        version       = 7
        release       = 2
        mod           = 5
        oslevel_r     = 7200-05
        oslevel_s     = 7200-05-06-2319
        alloc_count   = 0
        server        = master
        if_supported  = chrp.64 ent
        Rstate_result = success
     # df -g 72TL5SP6_spot
     # df -g /nim1/spot/72TL5SP6_spot/usr
     Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
     /dev/fslv00       10.00      8.76   13%    22514     2% /nim1
     #
    
     # lspv
     hdisk0          0001e16a038e0469                    rootvg          active
     hdisk1          0001e16a88d81706                    nimvg           active
     hdisk2          0001e16a62d28d30                    None
     #
     # lspv -l hdisk1
     hdisk1:
     LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
     loglv00               1       1       00..01..00..00..00    N/A
     fslv00                160     160     160..00..00..00..00   /nim1
     #
    
  4. Back up the NIM database and resources using the following command:

     # /usr/lpp/bos.sysmgt/nim/methods/m_backup_db /export/nim/backups/nimdb.bkp.1
     a ./etc/objrepos/nim_attr 8 blocks.
     a ./etc/objrepos/nim_attr.vc 8 blocks.
     a ./etc/objrepos/nim_object 8 blocks.
     a ./etc/objrepos/nim_object.vc 8 blocks.
     a ./etc/NIM.level 1 blocks.
     a ./etc/niminfo 1 blocks.
     a ./etc/NIM.primary.cpuid 1 blocks.
     # ls -lrt /export/nim/backups/nimdb.bkp.1
     -rw-r--r--    1 root     system        30720 Aug 25 13:08 /export/nim/backups/nimdb.bkp.1
     #
    
  5. Run the alt_disk_mksysb command using the later version of AIX mksysb utility on a free disk. Decompress the official mksysb from the distribution using gunzip before proceeding with the alt_disk_mksysb command.

     # ls -lrt AIX_73TL2SP2.mksysb
     -rw-r--r--    1 root     system   10058393600 Aug 26 01:29 AIX_73TL2SP2.mksysb
     # lspv
     hdisk0          0001e16a038e0469                    rootvg          active
     hdisk1          0001e16a88d81706                    nimvg           active
     hdisk2          0001e16a62d28d30                    None
     #
     # alt_disk_mksysb -m /AIX_73TL2SP2.mksysb -d hdisk2
     Restoring /image.data from mksysb image.
     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_hd11admin
     Creating logical volume alt_lg_dumplv
     Creating logical volume alt_livedump
     Creating logical volume alt_rep00
     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/sys/inst.images file system.
     Creating /alt_inst/var file system.
     Creating /alt_inst/var/adm/ras/livedump file system.
     Restoring mksysb image to alternate disk(s).
     Linking to 64bit kernel.
     Changing logical volume names in volume group descriptor area.
     Fixing LV control blocks...
     forced unmount of /alt_inst/var/adm/ras/livedump
     forced unmount of /alt_inst/var/adm/ras/livedump
     forced unmount of /alt_inst/var
     forced unmount of /alt_inst/var
     forced unmount of /alt_inst/usr/sys/inst.images
     forced unmount of /alt_inst/usr/sys/inst.images
     forced unmount of /alt_inst/usr
     forced unmount of /alt_inst/usr
     forced unmount of /alt_inst/tmp
     forced unmount of /alt_inst/tmp
     forced unmount of /alt_inst/opt
     forced unmount of /alt_inst/opt
     forced unmount of /alt_inst/home
     forced unmount of /alt_inst/home
     forced unmount of /alt_inst/admin
     forced unmount of /alt_inst/admin
     forced unmount of /alt_inst
     forced unmount of /alt_inst
     Fixing file system superblocks...
     Bootlist is set to the boot disk: hdisk2 blv=hd5
     # lspv
     hdisk0          0001e16a038e0469                    rootvg          active
     hdisk1          0001e16a88d81706                    nimvg           active
     hdisk2          0001e16a62d28d30                    altinst_rootvg
     #
    
  6. Reboot the system to the altinst_rootvg volume group. As the bootlist has already been set to hdisk2 in the previous step, run the reboot command to initiate the boot from the alternate disk.

     # reboot
    
  7. Install the NIM master fileset. After rebooting to the altinst_rootvg, you can see that the original rootvg is renamed as old_rootvg. You will also find a file system, /usr/sys/inst.images where you can find all the filesets corresponding to the corresponding mksysb level.

     # mount
       node       mounted        mounted over    vfs       date        options
     -------- ---------------  ---------------  ------ ------------ ---------------
              /dev/hd4         /                jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd2         /usr             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd9var      /var             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd3         /tmp             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd1         /home            jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/hd11admin   /admin           jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /proc            /proc            procfs Aug 26 03:43 rw
              /dev/hd10opt     /opt             jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/livedump    /var/adm/ras/livedump jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/rep00       /usr/sys/inst.images jfs2   Aug 26 03:43 rw,log=INLINE
              /dev/fslv00      /nim1            jfs2   Aug 26 03:43 rw,log=/dev/loglv00
              /ahafs           /aha             ahafs  Aug 26 03:43 rw
     #
    
  8. After the system reboots, install the bos.sysmgt.nim.master file set from the /usr/sys/inst.images directory using the installp command:

     # installp -ad /usr/sys/inst.images bos.sysmgt.nim.master
     +-----------------------------------------------------------------------------+
                         Pre-installation Verification...
     +-----------------------------------------------------------------------------+
     Verifying selections...done
     Verifying requisites...done
     Results...
    
     SUCCESSES
     ---------
       Filesets listed in this section passed pre-installation verification
       and will be installed.
    
       Selected Filesets
       -----------------
       bos.sysmgt.nim.master 7.3.2.2               # Network Install Manager - Ma...
    
       << End of Success Section >>
    
     +-----------------------------------------------------------------------------+
                        BUILDDATE Verification ...
     +-----------------------------------------------------------------------------+
     Verifying build dates...done
     FILESET STATISTICS
     ------------------
         1  Selected to be installed, of which:
             1  Passed pre-installation verification
       ----
         1  Total to be installed
    
     +-----------------------------------------------------------------------------+
                              Installing Software...
     +-----------------------------------------------------------------------------+
    
     installp: APPLYING software for:
             bos.sysmgt.nim.master 7.3.2.2
    
     . . . . . << Copyright notice for bos.sysmgt >> . . . . . . .
     Licensed Materials - Property of IBM
    
     5765CD300
        Copyright International Business Machines Corp. 1993, 2024.
    
     All rights reserved.
     US Government Users Restricted Rights - Use, duplication or disclosure
     restricted by GSA ADP Schedule Contract with IBM Corp.
     . . . . . << End of copyright notice for bos.sysmgt >>. . . .
    
     Successfully updated the Kernel Authorization Table.
     Successfully updated the Kernel Role Table.
     Successfully updated the Kernel Command Table.
     Successfully updated the Kernel Device Table.
     Successfully updated the Kernel Object Domain Table.
     Successfully updated the Kernel  Domains Table.
     Successfully updated the Kernel RBAC log level.
     Finished processing all filesets.  (Total time:  13 secs).
    
     +-----------------------------------------------------------------------------+
                                     Summaries:
     +-----------------------------------------------------------------------------+
    
     Installation Summary
     --------------------
     Name                        Level           Part        Event       Result
     -------------------------------------------------------------------------------
     bos.sysmgt.nim.master       7.3.2.2         USR         APPLY       SUCCESS
     #
    
  9. Wake up the old_rootvg volume group using the alt_rootvg_op command to access the NIM database backup stored in it.

     # lspv
     hdisk0          0001e16a038e0469                    old_rootvg
     hdisk1          0001e16a88d81706                    nimvg           active
     hdisk2          0001e16a62d28d30                    rootvg          active
     #
    
     # alt_rootvg_op -W -d hdisk0
     Waking up old_rootvg volume group ...
     # mount
       node       mounted        mounted over    vfs       date        options
     -------- ---------------  ---------------  ------ ------------ ---------------
              /dev/hd4         /                jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd2         /usr             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd9var      /var             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd3         /tmp             jfs2   Aug 26 03:42 rw,log=/dev/hd8
              /dev/hd1         /home            jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/hd11admin   /admin           jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /proc            /proc            procfs Aug 26 03:43 rw
              /dev/hd10opt     /opt             jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/livedump    /var/adm/ras/livedump jfs2   Aug 26 03:43 rw,log=/dev/hd8
              /dev/rep00       /usr/sys/inst.images jfs2   Aug 26 03:43 rw,log=INLINE
              /dev/fslv00      /nim1            jfs2   Aug 26 03:43 rw,log=/dev/loglv00
              /ahafs           /aha             ahafs  Aug 26 03:43 rw
              /dev/alt_hd4     /alt_inst        jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd11admin /alt_inst/admin  jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd1     /alt_inst/home   jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd10opt /alt_inst/opt    jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd3     /alt_inst/tmp    jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd2     /alt_inst/usr    jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_hd9var  /alt_inst/var    jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
              /dev/alt_livedump /alt_inst/var/adm/ras/livedump jfs2   Aug 26 03:48 rw,log=/dev/alt_hd8
     #
    
  10. Restore the NIM database backup from the /alt_inst file system, where the file systems from old_rootvg are now mounted.

     # /usr/lpp/bos.sysmgt/nim/methods/m_restore_db /alt_inst/export/nim/backups/nimdb.bkp.1
     Level check is successful.
    
     x ./etc/objrepos/nim_attr, 4096 bytes, 8 tape blocks
     x ./etc/objrepos/nim_attr.vc, 4096 bytes, 8 tape blocks
     x ./etc/objrepos/nim_object, 4096 bytes, 8 tape blocks
     x ./etc/objrepos/nim_object.vc, 4096 bytes, 8 tape blocks
     x ./etc/NIM.level, 10 bytes, 1 tape blocks
     x ./etc/niminfo, 190 bytes, 1 tape blocks
     x ./etc/NIM.primary.cpuid, 13 bytes, 1 tape blocks
     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 10551596.
     08/26 04:11:57 tftpd: [00000001] EZZ7001I Retrieval failed for the message: TFTP_MSG_C_1: {1,1} Starting.
     #
     # lsnim
     master            machines        master
     boot              resources       boot
     nim_script        resources       nim_script
     certificate       resources       certificate
     skynet            networks        ent
     72TL5SP6_lpp      resources       lpp_source
     72TL5SP6_spot     resources       spot
     #
    
  11. Copy the lpp_source (72TL5SP6_lpp directory, located in the old_rootvg volume group in our case) to the current rootvg.

     # lsnim -l 72TL5SP6_lpp
     72TL5SP6_lpp:
        class       = resources
        type        = lpp_source
        arch        = power
        Rstate      = ready for use
        prev_state  = unavailable for use
        location    = /export/nim/lpp/72TL5SP6_lpp
        simages     = yes
        alloc_count = 0
        server      = master
     #
     # mkdir -p /export/nim/lpp
     # cp -r /alt_inst/export/nim/lpp/72TL5SP6_lpp /export/nim/lpp/.
     #
     # nim -o check 72TL5SP6_lpp
     #
    
  12. Copy the SPOT (72TL5SP6_spot file system, located in the nimvg volume group in our case) to the current rootvg. As it resides in a separate volume group, we can find it directly.

     # nim -o check 72TL5SP6_spot
     #
    
  13. Put the old_rootvg to sleep using the following command.

     # alt_rootvg_op -S
    

This completes the migration of the NIM server using the mksysb and alt_disk_mksysb commands.

Conclusion

This tutorial explained two approaches for migrating a NIM server to the latest AIX release using the virtual media library and the alt_disk_mksysb command. Both methods are effective for different scenarios and emphasize critical steps, such as backing up the NIM database, ensuring integrity, and verifying migration. Based on the NIM resources and the infrastructure, you can choose any of the methods for migrating your NIM server. By following these procedures, you can smoothly migrate your NIM server while minimizing risks to your environment.