IBM Support

Utilizing NIM to create a mksysb

How To


Summary

NIM can be utilized to not only define a mksysb file as a NIM resource, but NIM can also be utilized to create a mksysb file of a client's running OS, while defining the new mksysb file as a NIM resource at the same time.

Objective

What this document does and does not cover
What his document covers:
  1. How to define a NIM client.
  2. How to utilize NIM to create a mksysb file from a client's running OS, and define the file as a NIM mksysb resource at the same time.
  3. How to create a NIM mksysb resource from an existing mksysb file.
  4. How to verify a mksysb file is not corrupt
What this document does not cover:
  1. NIM network configurations.
  2. 'rsh', 'nimsh', and/or any other network problems.
  3. Defining any resources other than the client and mksysb.

Steps

I . Defining the NIM client
Initialize the NIM client by using the 'niminit' command on the client itself, which will build the /etc/niminfo file on the client, as well as reach out to the NIM master to make it aware of the client initializing itself (creating the client's definition in the NIM environment/database).
Initialize the NIM client by running the following commands on the client: 
{"nimclient01", "nimmaster01", and "en0" are just examples for the variables in this example 'niminit' command}
# niminit -a name=nimclient01 -a master=nimmaster01 -a pif=en0
-OR-
# smit niminit
                                                                     Configure Network Installation Management Client Fileset
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
                                                             [Entry Fields]
* Machine Name                                       [nimclient01]
* Primary Network Install Interface                  [en0]  +  
* Host Name of Network Install Master                [nimmaster01]
 
  Hardware Platform Type                              chrp
  Kernel to use for Network Boot                     [64]   +   
  Communication Protocol used by client              []  +  
  Ethernet Interface Options
    Network Speed Setting                            []  +
    Network Duplex Setting                           []  +
  VLAN Tag Priority (0 to 7)                         []   #
  VLAN Tag Identifier (0 to 4094)                    []   #
  Comments                                           []
 
Alternate Port Numbers for Network Communications
       (reserved values will be used if left blank)
    Client Registration                              []   #
    Client Communications                            []   #
F1=Help    F2=Refresh    F3=Cancel    F4=List        F5=Reset    F6=Command        F7=Edit        F8=Image    F9=Shel    F10=Exit    Enter=Do 
Once the 'niminit' command has been executed on the client, the 'lsnim' command can be used on the NIM master to verify the client has been defined, and also to verify the attributes for the client are correct.
For example:
NOTE: The below commands are run on the NIM master
# lsnim -t standalone

nimclient01           machines       standalone

# lsnim -l nimclient01

nimclient01:
   class          = machines
   type           = standalone
   connect        = shell
   platform       = chrp
   netboot_kernel = 64
   if1            = master_net nimclient01 0
   cable_type1    = N/A
   Cstate         = ready for a NIM operation
   prev_state     = ready for a NIM operation
   Mstate         = currently running
   cpuid          = 00F634864C00
   Cstate_result  = reset
II. Creating a new mksysb file from the client's running OS and defining it as a mksysb resource in the NIM database
IMPORTANT:  The OS of the client should be in a quiesced state when the mksysb is being created.
The mksysb script first creates a list of files in rootvg, along with a few attributes about the individual files.
If something has changed with a file (the file size has changed, the file checksum has changed, the file is no longer there, etc.) between the time the mksysb script creates the list of files and their attributes, and when the files are actually backed up, you will receive one or more “internal packing” errors. 
Make sure the OS is in a quiesced state, and if it is not then software packing will need to be disabled when creating the mksysb file (disabling software packing prevents the packing algorithm in the 'mksysb' command script from being run, and will result in a mksysb file which will be larger than if software packing was enabled [up to 2 – 3 times larger, depending on the types of files being backed up]) .
For more information about software packing, please open a case with AIX support.

Create a mksysb file from the running OS on the client, and define it as a mksysb resource by running the following commands on the NIM master: 
# nim -o define -t mksysb -a server=master -a location=/export/mksysb/nimclient01.mksysb.5June2092 -a mk_image=yes -a source=nimclient01  \
nimclient01_mksysb_5June2092
>NOTE: The above flags are the minimum flags needed for the operation. Please consult the 'nim' man page for the additional flags which can be used.

-OR-

# smitty nim_mkres
>Select mksysb
                                                                                                         Define a Resource
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
                                                        [Entry Fields]
* Resource Name                                      [nimclient01_mksysb_5June2092]
* Resource Type                                       mksysb
* Server of Resource                                 [master]   +
* Location of Resource                              [/export/mksysb/nimclient01.mksysb.5June2092]   /

  NFS Client Security Method                    []   +
  NFS Version Access                                []   +
  Comments                                               []
  Source for Replication                             []   +
                  -OR-
  System Backup Image Creation Options:
    CREATE system backup image?           yes   +
    NIM CLIENT to backup                          [nimclient01]   +

    PREVIEW only?                                     no   +                                                                                                                                                                        
    IGNORE space requirements?                        no   +
    EXPAND /tmp if needed?                            no   +
    Create MAP files?                                        no   +
    Backup extended attributes?                       yes   +
    Number of BLOCKS to write in a single output     []   +
     (leave blank to use system default)
    Use local EXCLUDE file?                             no   +
     (specify no to include all files in backup)
                  -OR-
    EXCLUDE_FILES resource                           []   +
     (leave blank to include all files in backup)
   Create backup using snapshots?                   yes   +
    Backup encrypted files?                                yes   +
    Backup DMAPI filesystem files?                    yes   +
  Disable software packing of backup?               no   +
  Use exclude_packing.rootvg file?                    no
F1=Help    F2=Refresh    F3=Cancel    F4=List        F5=Reset    F6=Command    F7=Edit        F8=Image    F9=Shel    F10=Exit    Enter=Do 
III. Creating a NIM mksysb resource from an existing mksysb file
For this example, the location of the mksysb file is:
/export/mksysb/nimclient01.mksysb.5June2092
Create the mksysb resource from an existing mksysb file:
# nim -o define -t mksysb -a server=master -a location=/export/mksysb/nimclient01.mksysb.5June2092 nimclient01_mksysb_5June2092

-OR-

# smitty nim_mkres
>Select mksysb
                                                                                                         Define a Resource
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
                                                        [Entry Fields]
* Resource Name                                      [nimclient01_mksysb_5June2092]
* Resource Type                                       mksysb
* Server of Resource                                 [master]   +
* Location of Resource                              [/export/mksysb/nimclient01.mksysb.5June2092]   /

  NFS Client Security Method                    []   +
  NFS Version Access                                []   +
  Comments                                               []
  Source for Replication                             []   +
                  -OR-
  System Backup Image Creation Options:
    CREATE system backup image?           no   +
    NIM CLIENT to backup                          []   +
    PREVIEW only?                                     no   +                                                                                                                                                                        
    IGNORE space requirements?                        no   +
    EXPAND /tmp if needed?                            no   +
    Create MAP files?                                        no   +
    Backup extended attributes?                       yes   +
    Number of BLOCKS to write in a single output     []   +
     (leave blank to use system default)
    Use local EXCLUDE file?                             no   +
     (specify no to include all files in backup)
                  -OR-
    EXCLUDE_FILES resource                           []   +
     (leave blank to include all files in backup)
   Create backup using snapshots?                   yes   +
    Backup encrypted files?                                yes   +
    Backup DMAPI filesystem files?                    yes   +
  Disable software packing of backup?               no   +
  Use exclude_packing.rootvg file?                    no
F1=Help    F2=Refresh    F3=Cancel    F4=List        F5=Reset    F6=Command         F7=Edit        F8=Image    F9=Shel    F10=Exit    Enter=Do 
IV. Verifying the integrity of the mksysb resource and mksysb file
First it must be stated that the only true way to verify the ability to restore a mksysb, is to actually restore the mksysb.
With that being said, there are some things you can do to verify whether the mksysb file is a proper backup/restore format file, with data in the file which can be read. This is what will be covered in this section.
Confirm the mksysb resource definition is valid by first verifying the resource definition exists, and then listing the attributes for the resource by using the 'lsnim' command.
For example:
# lsnim -t mksysb
nimclient01_mksysb_5June2092     resources       mksysb

# lsnim -l nimclient01_mksysb_5June2092
nimclient01_mksysb_5June2092:
   class         = resources
   type          = mksysb
   creation_date = Tue Jun 5 5:44:09 2092
   Rstate        = ready for use
   prev_state    = unavailable for use
   location      = /export/mksysb/nimclient01.mksysb.5June2092
   version       = 7
   release       = 3
   mod           = 1
   oslevel_r     = 7300-01
   oslevel_s     = 7300-01-02-2320
   alloc_count   = 0
   server        = master
Verify the mksysb file is a "backup/restore" format file, verify information can be obtained about the file, and verify data can be restored from the file:

# file /export/mksysb/nimclient01.mksysb.5June2092
/export/mksysb/nimlab14.mksysb.17Nov2023: backup/restore format file

 
# lsmksysb -lf /export/mksysb/nimclient01.mksysb.5June2092
VOLUME GROUP:           rootvg
BACKUP DATE/TIME:       Tue Jun 5 5:44:09 2092
UNAME INFO:             AIX nimclient01 3 7 00F3D6014C00
BACKUP OSLEVEL:         7.3.1.3
MAINTENANCE LEVEL:      7300-01
SERVICEPACK LEVEL:      7300-01-02-2320
BACKUP SIZE (MB):       30464
SHRINK SIZE (MB):       4062
VG DATA ONLY:           no
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     8       8       1    open/syncd    N/A
hd8                 jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       35      35      1    open/syncd    /
hd2                 jfs2       80      80      1    open/syncd    /usr
hd9var              jfs2       52      52      1    open/syncd    /var
hd3                 jfs2       115     115     1    open/syncd    /tmp
hd1                 jfs2       161     161     1    open/syncd    /home
hd10opt             jfs2       1       1       1    open/syncd    /opt
hd11admin           jfs2       2       2       1    open/syncd    /admin
lg_dumplv           sysdump    16      16      1    open/syncd    N/A
livedump            jfs2       4       4       1    open/syncd    /var/adm/ras/livedump

 
List the table of contents for the mksysb:
# restore -Tqvf  /export/mksysb/nimclient01.mksysb.5June2092       
New volume on /export/mksysb/nimclient01.mksysb.5June2092:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Tue Jun 5 5:44:09 2092
Files are backed up by name.
The user is root.
        7406 ./bosinst.data
          11 ./tmp/vgdata/rootvg/image.info
       11061 ./image.data
       70136 ./tmp/vgdata/rootvg/backup.data
           0 ./usr
           0 ./usr/X11R6
......cont'd...
 
           0 ./tmp
           5 ./u
          21 ./unix
           0 ./var
           0 ./proc
           0 ./730images
The total size is 2359216201 bytes.
The number of archived files is 37631.
Restore a file from the mksysb:
{Make sure to be in a directory/filesystem other than the root ( / ) filesystem}
# cd $HOME
# restore -xqvf /export/mksysb/nimclient01.mksysb.5June2092 ./bosinst.data
New volume on /export/mksysbnimclient01.mksysb.5June2092:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Tue Jun 5 5:44:09 2092
Files are backed up by name.
The user is root.
x         7406 ./bosinst.data
The total size is 7406 bytes.
The number of restored files is 1.
# head -5 bosinst.data
# @(#) 39 1.11.5.15 src/bos/usr/lpp/bosinst/bosinst.template/bosinst.template, bosinst, bos730, o2021_37A0 9/8/21 19:53:39
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos730 src/bos/usr/lpp/bosinst/bosinst.template/bosinst.template 1.11.5.15 

 
Again, the only true way to verify the ability to restore a mksysb, is to actually restore the mksysb. 
However, the above commands will provide enough information to know whether a restore of the mksysb should even be attempted.

Additional Information

Please open a case with AIX Remote Technical Support if you have any questions pertaining to the steps/commands/instructions in this document.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z000000cvyjAAA","label":"Install-\u003Emksysb\/backups"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions"}]

Document Information

Modified date:
21 November 2023

UID

ibm17078065