Topics: AIX, Installation, NIM

Creating an LPP source and SPOT in NIM

This is a quick and dirty method of setting up an LPP source and SPOT of AIX 5.3 TL10 SP2, without having to swap DVD's into the AIX host machine. What you basically need is the actual AIX 5.3 TL10 SP2 DVD's from IBM, a Windows host, and access to your NIM server. This process basically works for every AIX level, and has been tested with versions up to AIX 7.2.

If you have actual AIX DVD's that IBM sent to you, create ISO images of the DVD's through Windows, e.g. by using MagicISO. Or, go to Entitled Software Support and download the ISO images there.

SCP these ISO image files over to the AIX NIM server, e.g. by using WinSCP.

We need a way to access the data in the ISO images on the NIM server, and to extract the filesets from it (see IBM Wiki).

For AIX 5 systems and older:

Create a logical volume that is big enough to hold the data of one DVD. Check with "lsvg rootvg" if you have enough space in rootvg and what the PP size is. In our example it is 64 MB. Thus, to hold an ISO image of roughly 4.7 GB, we would need roughly 80 LPs of 64 MB.

# /usr/sbin/mklv -y testiso -t jfs rootvg 80
Create filesystem on it:
# /usr/sbin/crfs -v jfs -d testiso -m /testiso -An -pro -tn -a frag=4096 -a nbpi=4096 -a ag=8
Create a location where to store all of the AIX filesets on the server:
# mkdir /sw_depot/5300-10-02-0943-full
Copy the ISO image to the logical volume:
# /usr/bin/dd if=/tmp/aix53-tl10-sp2-dvd1.iso of=/dev/rtestiso bs=1m
# chfs -a vfs=cdrfs /testiso
Mount the testiso filesystem and copy the data:
# mount /testiso
# bffcreate -d /testiso -t /sw_depot/5300-10-02-0943-full all
# umount /testiso
Repeat the above 5 steps for both DVD's. You'll end up with a folder of at least 4 GB.

Delete the iso logical volume:
# rmfs -r /testiso
# rmlv testiso
When you're using AIX 7 / AIX 6.1:

Significant changes have been made in AIX 7 and AIX 6.1 that add new support for NIM. In particular there is now the capability to use the loopmount command to mount iso images into filesystems. As an example:
# loopmount -i aixv7-base.iso -m /aix -o "-V cdrfs -o ro"
The above mounts the AIX 7 base iso as a filesystem called /aix.

So instead of going through the trouble of creating a logical volume, creating a file system, copying the ISO image to the logical volume, and mounting it (which is what you would have done on AIX 5 and before), you can do all of this with a single loopmount command.

Make sure to delete any left-over ISO images:
# rm -rf /tmp/aix53-tl10-sp2-dvd*iso
Define the LPP source (From the NIM A to Z redbook):
# mkdir /export/lpp_source/LPPaix53tl10sp2
# nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/LPPaix53tl10sp2 -a source=/sw_depot/5300-10-02-0943-full LPPaix53tl10sp2
Check with:
# lsnim -l LPPaix53tl10sp2
Rebuild the .toc:
# nim -Fo check LPPaix53tl10sp2
For newer AIX releases, e.g. AIX 7.1 and AIX 7.2, you may get a warning like:
Warning: 0042-354 c_mk_lpp_source: The lpp_source is missing a
    bos.vendor.profile which is needed for the simages attribute. To add
    a bos.vendor.profile to the lpp_source run the "update" operation
    with "-a recover=yes" and specify a "source" that contains a
    bos.vendor.profile such as the installation CD.  If your master is not
    at level 5.2.0.0 or higher, then manually copy the bos.vendor.profile
    into the installp/ppc directory of the lpp_source.
If this happens, you can either do exactly what it says, copy the installp/ppc/bos.vendor.profile file from your source DVD ISO image into the installp/ppc directory of the LPP source. Or, you can remove the entire LPP source, then copy the installp/ppc/bos.vendor.profile form the DVD ISO image into the directory that contains the full AIX software set (in the example above: /sw_depot/5300-10-02-0943-full), and then re-create the LPP source. That should help to avoid the warning.

If you ignore this warning, then you'll notice that the next step (create a SPOT from the LPP source) will fail.

Define a SPOT from the LPP source:
# nim -o define -t spot -a server=master -a location=/export/spot/SPOTaix53tl10sp2 -a source=LPPaix53tl10sp2 -a installp_flags=-aQg SPOTaix53tl10sp2
Check the SPOT:
# nim -o check SPOTaix53tl10sp2
# nim -o lppchk -a show_progress=yes SPOTaix53tl10sp2

Topics: AIX, Installation, NIM, System Admin

Nimadm

A very good article about migrating AIX from version 5.3 to 6.1 can be found on the following page of IBM developerWorks:

http://www.ibm.com/developerworks/aix/library/au-migrate_nimadm/index.html?ca=drs

For a smooth nimadm process, make sure that you clean up as much filesets of your server as possible (get rid of the things you no longer need). The more filesets that need to be migrated, the longer the process will take. Also make sure that openssl/openssh is up-to-date on the server to be migrated; this is likely to break when you have old versions installed.

Very useful is also a gigabit Ethernet connection between the NIM server and the server to be upgraded, as the nimadm process copies over the client rootvg to the NIM server and back.

The log file for a nimadm process can be found on the NIM server in /var/adm/ras/alt_mig.

Topics: AIX, Installation, NIM, System Admin

Adding a fileset to a SPOT

For example, if you wish to add the bos.alt_disk_install.rte fileset to a SPOT:

List the available spots:

# lsnim -t spot | grep 61
SPOTaix61tl05sp03     resources       spot
SPOTaix61tl03sp07     resources       spot
List the available lpp sources:
# lsnim -t lpp_source | grep 61
LPPaix61tl05sp03       resources       lpp_source
LPPaix61tl03sp07       resources       lpp_source
Check if the SPOT already has this file set:
# nim -o showres SPOTaix61tl05sp03 | grep -i bos.alt
No output is shown. The fileset is not part of the SPOT. Check if the LPP Source has the file set:
# nim -o showres LPPaix61tl05sp03 | grep -i bos.alt
  bos.alt_disk_install.boot_images 6.1.5.2                    I  N usr
  bos.alt_disk_install.rte    6.1.5.1                    I  N usr,root
Install the first fileset (bos.alt_disk_install.boot_images) in the SPOT. The other fileset is a prerequisite of the first fileset and will be automatically installed as well.
# nim -o cust -a filesets=bos.alt_disk_install.boot_images
-a lpp_source=LPPaix61tl05sp03 SPOTaix61tl05sp03
Note: Use the -F option to force a fileset into the SPOT, if needed (e.g. when the SPOT is in use for a client).

Check if the SPOT now has the fileset installed:
# nim -o showres SPOTaix61tl05sp03 | grep -i bos.alt
  bos.alt_disk_install.boot_images
  bos.alt_disk_install.rte 6.1.5.1 C F Alternate Disk Installation

Topics: Installation, NIM

How to set up a NIM master

In this section, we will configure the NIM master and create some basic installation resources:

  • Ensure that Volume 1 of the AIX DVD is in the drive.
  • Install the NIM master fileset:
    # installp -agXd /dev/cd0 bos.sysmgt.nim
  • Configure NIM master:
    # smitty nim_config_env
    Set fields as follows:
    • "Primary Network Interface for the NIM Master": selected interface
    • "Input device for installation images": "cd0"
    • If you already have set up an /export file system, you may choose not to create new file systems for /export/lpp_source and /export/spot; It is up to you.
    • Select to prepend the level to the LPP_SOURCE and SPOT names, so you can identify the level of AIX that was used to create the LPP_SOURCE and SPOT.
    • "Remove all newly added NIM definitions if the operation fails": "yes"
    • Press Enter.
    • Exit when complete.
    If you run into an issue here, where it says that the SPOT cannot be created, because the LPP_SOURCE is missing the simages (short for system images) attribute, because fileset bos.vendor.profile is missing, then this means it is telling you that the LPP_SOURCE doesn't include all the required filesets to create the SPOT. This looks like a bug because fileset bos.vendor.profile can be found on the AIX media. But it seems somehow it is not copied to the target LPP_SOURCE folder while the LPP_SOURCE is created. It has been seen in AIX 7.1 TL4. If you run into this, do the following:
    • Check if bos.vendor.profile exists on the installation media. It should be in the installp/ppc folder.
    • If so, rerun the steps above (starting with smitty nim_config_env), and while the LPP_SOURCE is being created, copy the bos.vendor.profile file yourself from the AIX installation media to the LPP_SOURCE target folder. For example, if your installation folder is /aix (assuming you have mounted the first AIX installation ISO image using loopmount on mount point /aix; and assuming you are using AIX 7.1 TL4), then run:
      # cp /aix/installp/ppc/bos.vendor.profile /export/lpp_source/710-04lpp_source1/installp/ppc/bos.vendor.profile
  • Initialize each NIM client:
    # smitty nim_mkmac
    Enter the host name of the appropriate LPAR. Set fields as follows:
    • "Kernel to use for Network Boot": "mp"
    • "Cable Type": "tp"
    • Press Enter.
    • Exit when complete.
A more extensive document about setting up NIM can be found here:
http://www-01.ibm.com/support/docview.wss?context=SWG10q1=setup+guide&uid=isg3T1010383

Topics: AIX, Backup & restore, NIM, System Admin

How to unconfigure items after mksysb recovery using NIM

There will be a situation where you want to test a mksysb recovery to a different host. The major issue with this is, that you bring up a server within the same network, that is a copy of an actual server that's already in your network. To avoid running into 2 exactly the same servers in your network, here's how you do this:

First make sure that you have a separate IP address available for the server to be recovered, for configuration on your test server. You definitely don't want to bring up a second server in your network with the same IP configuration.

Make sure you have a mksysb created of the server that you wish to recover onto another server. Then, create a simple script that disables all the items that you don't want to have running after the mksysb recovery, for example:

# cat /export/nim/cust_scripts/custom.ksh
#!/bin/ksh

# Save a copy of /etc/inittab
cp /etc/inittab /etc/inittab.org

# Remove unwanted entries from the inittab
rmitab hacmp 2>/dev/null
rmitab tsmsched 2>/dev/null
rmitab tsm 2>/dev/null
rmitab clinit 2>/dev/null
rmitab pst_clinit 2>/dev/null
rmitab qdaemon 2>/dev/null
rmitab sddsrv 2>/dev/null
rmitab nimclient 2>/dev/null
rmitab nimsh 2>/dev/null
rmitab naviagent 2>/dev/null

# Get rid of the crontabs
mkdir -p /var/spool/cron/crontabs.org
mv /var/spool/cron/crontabs/* /var/spool/cron/crontabs.org/

# Disable start scripts
chmod 000 /etc/rc.d/rc2.d/S01app

# copy inetd.conf
cp /etc/inetd.conf /etc/inetd.conf.org
# take out unwanted items
cat /etc/inetd.conf.org | grep -v bgssd > /etc/inetd.conf

# remove the hacmp cluster configuration
if [ -x /usr/es/sbin/cluster/utilities/clrmclstr ] ; then
        /usr/es/sbin/cluster/utilities/clrmclstr
fi

# clear the error report
errclear 0

# clean out mail queue
rm /var/spool/mqueue/*
The next thing you need to do, is to configure this script as a 'script resource' in NIM. Run:
# smitty nim_mkres
Select 'script' and complete the form afterwards. For example, if you called it 'UnConfig_Script':
# lsnim -l UnConfig_Script
UnConfig_Script:
   class       = resources
   type        = script
   comments    = 
   Rstate      = ready for use
   prev_state  = unavailable for use
   location    = /export/nim/cust_scripts/custom.ksh
   alloc_count = 0
   server      = master
Then, when you are ready to perform the actual mksysb recovery using "smitty nim_bosinst", you can add this script resource on the following line:
Customization SCRIPT to run after installation [UnConfig_Script]

Topics: AIX, Backup & restore, NIM, System Admin

Using the image_data resource to restore a mksysb without preserving mirrors using NIM

Specify using the 'image_data' resource when running the 'bosinst' command from the NIM master:

From command line on the NIM master:

# nim -o bos_inst -a source=mksysb -a lpp_source=[lpp_source] -a spot=[SPOT] -a mksysb=[mksysb] -a image_data=mksysb_image_data -a accept_licenses=yes server1
Using smit on the NIM master:
# smit nim_bosinst
Select the client to install. Select 'mksysb' as the type of install. Select a SPOT at the same level as the mksysb you are installing. Select an lpp_source at the same level than the mksysb you are installing.

NOTE: It is recommended to use an lpp_source at the same AIX Technology Level, but if using an lpp_source at a higher level than the mksysb, the system will be updated to the level of the lpp_source during installation. This will only update Technology Levels.

If you're using an AIX 5300-08 mksysb, you cannot use an AIX 6.1 lpp_source. This will not migrate the version of AIX you are running to a higher version. If you're using an AIX 5300-08 mksysb and allocate a 5300-09 lpp_source, this will update your target system to 5300-09.
         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                       server1
* Installation TYPE                         mksysb
* SPOT                                      SPOTaix53tl09sp3
  LPP_SOURCE                               [LPPaix53tl09sp3]
  MKSYSB                                    server1_mksysb

  BOSINST_DATA to use during installation  []
  IMAGE_DATA to use during installation    [server1_image_date]

Topics: AIX, Backup & restore, NIM, System Admin

Creating an image_data resource without preserving mirrors for use with NIM

Transfer the /image.data file to the NIM master and store it in the location you desire. It is a good idea to place the file, or any NIM resource for that matter, in a descriptive manor, for example: /export/nim/image_data. This will ensure you can easily identify your "image_data" NIM resource file locations, should you have the need for multiple "image_data" resources.

Make sure your image.data filenames are descriptive also. A common way to name the file would be in relation to your clientname, for example: server1_image_data.

Run the nim command, or use smitty and the fast path 'nim_mkres' to define the file that you have edited using the steps above:

From command line on the NIM master:

# nim -o define -t image_data -a server=master -a location=/export/nim/image_data/server1_image_data -a comments="image.data file with broken mirror for server1" server1_image_data
NOTE: "server1_image_data" is the name given to the 'image_data' resource.

Using smit on the NIM master:
# smit nim_mkres
Select 'image_data' as the Resource Type. Then complete the following screen:
                       Define a Resource

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

                               [Entry Fields]
* Resource Name            [server1_image_data]
* Resource Type             image_data
* Server of Resource       [master]
* Location of Resource     [/export/nim/image_data/server1_image_data]
  Comments                 []

  Source for Replication   []
Run the following command to make sure the 'image_data' resource was created:
# lsnim -t image_data
The command will give output similar to the following:
# lsnim -t image_data
server1_image_data     resources       image_data
Run the following command to get information about the 'image_data' resource:
# lsnim -l server1_image_data
server1_image_data:
   class       = resources
   type        = image_data
   Rstate      = ready for use
   prev_state  = unavailable for use
   location    = /export/nim/image_data/server1_image_data
   alloc_count = 0
   server      = master

Topics: AIX, Backup & restore, NIM, System Admin

How to edit an image.data file to break a mirror

Create a new image.data file by running the following command:

# cd /
# mkszfile
Edit the image.data file to break the mirror, by running the following command:
# vi /image.data
What you are looking for are the "lv_data" stanzas. There will be one for every logical volume associated with rootvg.

The following is an example of an lv_data stanza from an image.data file of a mirrored rootvg. The lines that need changing are marked bold:
lv_data:
VOLUME_GROUP= rootvg
LV_SOURCE_DISK_LIST= hdisk0 hdisk1
LV_IDENTIFIER= 00cead4a00004c0000000117b1e92c90.2
LOGICAL_VOLUME= hd6
VG_STAT= active/complete
TYPE= paging
MAX_LPS= 512
COPIES= 2
LPs= 124
STALE_PPs= 0
INTER_POLICY= minimum
INTRA_POLICY= middle
MOUNT_POINT=
MIRROR_WRITE_CONSISTENCY= off
LV_SEPARATE_PV= yes
PERMISSION= read/write
LV_STATE= opened/syncd
WRITE_VERIFY= off
PP_SIZE= 128
SCHED_POLICY= parallel
PP= 248
BB_POLICY= non-relocatable
RELOCATABLE= yes
UPPER_BOUND= 32
LABEL=
MAPFILE= /tmp/vgdata/rootvg/hd6.map
LV_MIN_LPS= 124
STRIPE_WIDTH=
STRIPE_SIZE=
SERIALIZE_IO= no
FS_TAG=
DEV_SUBTYP=
Note: There are two disks in the 'LV_SOURCE_DISK_LIST', THE 'COPIES' value reflects two copies, and the 'PP' value is double that of the 'LPs' value.

The following is an example of the same lv_data stanza after manually breaking the mirror. The lines that have been changed are marked bold. Edit each 'lv_data' stanza in the image.data file as shown below to break the mirrors.
lv_data:
VOLUME_GROUP= rootvg
LV_SOURCE_DISK_LIST= hdisk0
LV_IDENTIFIER= 00cead4a00004c0000000117b1e92c90.2
LOGICAL_VOLUME= hd6
VG_STAT= active/complete
TYPE= paging
MAX_LPS= 512
COPIES= 1
LPs= 124
STALE_PPs= 0
INTER_POLICY= minimum
INTRA_POLICY= middle
MOUNT_POINT=
MIRROR_WRITE_CONSISTENCY= off
LV_SEPARATE_PV= yes
PERMISSION= read/write
LV_STATE= opened/syncd
WRITE_VERIFY= off
PP_SIZE= 128
SCHED_POLICY= parallel
PP= 124
BB_POLICY= non-relocatable
RELOCATABLE= yes
UPPER_BOUND= 32
LABEL=
MAPFILE= /tmp/vgdata/rootvg/hd6.map
LV_MIN_LPS= 124
STRIPE_WIDTH=
STRIPE_SIZE=
SERIALIZE_IO= no
FS_TAG=
DEV_SUBTYP=
Note: The 'LV_SOURCE_DISK_LIST' has been reduced to one disk, the 'COPIES' value has been changed to reflect one copy, and the 'PP' value has been changed so that it is equal to the 'LPs' value.

Save the edited image.data file. At this point you can use the edited image.data file to do one of the following: You can now use your newly edited image.data file to create a new mksysb to file, tape, or DVD.

E.g.: To file or tape: place the edited image.data file in the / (root) directory and rerun your mksysb command without using the "-i" flag. If running the backup through SMIT, make sure you set the option "Generate new /image.data file?" to 'no' (By default it is set to 'yes').

To DVD: Use the -i flag and specify the [/location] of the edited image.data file. If running through SMIT specify the edited image.data file location in the "User supplied image.data file" field.

Within NIM you would create an 'image_data' resource for use with NIM to restore a mksysb without preserving mirrors.

Note: If you don't want to edit the image.data file manually, here's a script that you can use to have it updated to a single disk for you, assuming your image_data file is called /image.data:
cat /image.data | while read LINE ; do
  if [ "${LINE}" = "COPIES= 2" ] ; then
    COPIESFLAG=1
    echo "COPIES= 1"
  else
    if [ ${COPIESFLAG} -eq 1 ] ; then
      PP=`echo ${LINE} | awk '{print $1}'`
      if [ "${PP}" = "PP=" ] ; then
        PPNUM=`echo ${LINE} | awk '{print $2}'`
        ((PPNUMNEW=$PPNUM/2))
        echo "PP= ${PPNUMNEW}"
        COPIESFLAG=0
      else
        echo "${LINE}"
      fi
    else
      echo "${LINE}"
    fi
  fi
done > /image.data.1disk

Topics: AIX, Installation, NIM, System Admin

How to migrate from p5 to p6

If your AIX server level is below 5.3 TL06, the easiest way is just to upgrade your current OS to TL 06 at minimum (take note it will depend of configurations for Power6 processors) then clone your server and install it on the new p6.

But if you want to avoid an outage on your account, you can do the next using a NIM server (this is not official procedure for IBM, so they do not support this):

  • Create your mksysb resource and do not create a spot from mksysb.
  • Create an lppsource and spot with minimum TL required (I used TL08).
  • Once you do nim_bosinst, choose the mksysb, and the created spot. It will send a warning message about spot is not at same level as mksysb, just ignore it.
  • Do all necessary to boot from NIM.
  • Once restoring the mksysb, there's some point where it is not able to create the bootlist because it detects the OS level is not supported on p6. So It will ask to continue and fix it later via SMS or fix it right now.
  • Choose to fix it right now (it will open a shell). You will notice oslevel is as the same as mksysb.
  • Create a NFS from NIM server or another server where you have the necessary TL and mount it on the p6.
  • Proceed to do an upgrade, change the bootlist, exit the shell. Server will boot with new TL over the p6.

Topics: AIX, NIM, System Admin

Doing a mksysb restore through NIM

A "how-to" restore a mksysb through NIM:

  • Create a mksysb resource in NIM: Logon to the NIM server as user root. Run smitty nim, Perform NIM Administration Tasks, Manage resources, Define a resource, select mksysb, type name mksysb_, enter "master" as Server of Resource, enter the full path to the mksysb file at Location of Resource: e.g. /backup/hostname.image.
  • Add the mksysb resource to the defined machine in NIM, together with the original SPOT and LPP source of the host: Run: smitty nim, Perform NIM Administration Tasks, Manage Machines, Manage Network Install Resource Allocation, Allocate Network Install Resources, select the machine, select the mksysb resource defined in the previous step, along with the correct SPOT and LPP_SOURCE of the oslevel of the system.
  • Do a perform operation on the machine in NIM and set it to mksysb: Run smitty nim, Perform NIM Administration Tasks, Manage Machines, Perform Operations on Machines, select the machine, select bos_inst, set the Source for BOS Runtime Files to mksysb, set Remain NIM client after install to no, set Initiate Boot Operation on Client to no, set Accept new license agreements to yes.
  • Start up the system in SMS mode and boot from the NIM server, using a virtual terminal on the HMC. Select the disks to install to. Make sure that you set import user volume groups to "yes". Restore the system.
By the way, another method to initiate a mksysb restore is by using:
# smitty nim_bosinst

Number of results found for topic NIM: 12.
Displaying results: 1 - 10.