How to migrate to AIX 7.1 (or 6.1) via NIM server with nimadm

root's picture

Nim configuration and pre install backup:

1. Register client on NIM server if it doens't exists already:

PS: THIS IS DONE ON THE CLIENT, NOT ON THE NIM SERVER. Replace YOUR_MASTER with your nim server's hostname.

# if [ $(oslevel|grep "^5") ]; then KERN=mp; else KERN=64; fi
# niminit -a name=$(hostname) -a pif_name="find_net $(hostname) 0" -a master=gznim -a platform=$(getconf MACHINE_ARCHITECTURE) -a netboot_kernel=${KERN} -a connect=nimsh

Or via SMITTY:

Configure Network Installation Management Client Fileset

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

                                                        [Entry Fields]
* Machine Name                                       [gzlpar]
* Primary Network Install Interface                  [en0]                                      +
* Host Name of Network Install Master                [gznim]
  
  Hardware Platform Type                              chrp
  Kernel to use for Network Boot                     [mp]                                       +
  Communication Protocol used by client              [nimsh]                                   +
  Ethernet Interface Options
    Network Speed Setting                            []                                          +
    Network Duplex Setting                           []                                          +
  Comments                                           []

  Alternate Port Numbers for Network Communications
       (reserved values will be used if left blank)
    Client Registration                              []                                           #
    Client Communications                            []                                          #
Output (I had the client already configured):

Client:

# niminit
0042-041 niminit: /etc/niminfo already exists

Nim server:

[gznim:root:/home/root:] lsnim -l gzlpar     
gzlpar:
   class          = machines
   type           = standalone
   connect        = nimsh
   platform       = chrp
   netboot_kernel = mp
   if1            = vlan111 gzlpar 0
   cable_type1    = N/A
   Cstate         = ready for a NIM operation
   prev_state     = lppchk operation is being performed
   Mstate         = currently running
   cpuid          = 00C659D24C00
   Cstate_result  = success

2. Perform backup of client system:

Via NIM master:
nim -o define -t mksysb -a server=master -a location=/export/mksysb/gzlpar/gzlpar_$(date +%Y%m%d%H%M%S)_sysb -a source=gzlpar -a mksysb_flags=eiX -a mk_image=yes gzlpar_bkp_premig

Or with mksysb from client (copy it outside the partition afterwards):
mksysb -eiX /backups-tmp/gzlpar-rootvg.sysb

Output:

[gznim:root:/home/root:] nim -o define -t mksysb -a server=master -a location=/export/mksysb/gzlpar/gzlpar_$(date +%Y%m%d%H%M%S)_sysb -a source=gzlpar -a mksysb_flags=eiX -a mk_image=yes gzlpar_bkp_premig
0042-001 nim: processing error encountered on "master":
   0042-001 m_mkbosi: processing error encountered on "gzlpar":
   warning: 0042-175 c_mkbosi: An unexpected result was returned by the
        "/usr/sbin/mount" command:
        
mount: access denied for gznim:/export/mksysb/gzlpar
mount: giving up on:
        gznim:/export/mksysb/gzlpar
Permission denied
rc=175
0042-175 c_mkbosi: An unexpected result was returned by the "/usr/sbin/mount" command:
mount: access denied for gznim:/export/mksysb/gzlpar
mount: giving up on:
        gznim:/export/mksysb/gzlpar
Permission denied

The error regarding Permission denied on nfs is because /etc/exports should be empty or should not have any entry related to nim operations. Once the conflict was fixed, the operation went OK:

[gznim:root:/home/root:] grep gzlpar /etc/exports
[gznim:root:/home/root:] grep mksysb /etc/exports
/export/mksysb -vers=4,sec=sys:krb5p:krb5i:krb5:dh,access=@192.168.195.0/26:@192.168.195.64/26:@192.168.195.128/27:@192.168.196.0/24:@192.168.195.160/27:@192.168.195.200/29:@192.168.194.0/24:@129.39.133.32/27:@129.39.133.50/27:@129.39.133.64/26:@129.39.133.128/25:@129.39.141.0/24:@129.39.141.128/26:@129.39.142.160/27:@129.39.143.0/26:@129.39.143.96/27:@129.39.143.160/27:@129.35.160.0/27:@129.35.166.0/28:@158.98.237.0/25:@129.39.142.96/27:@129.39.143.26/26:root=@192.168.195.0/26:@192.168.195.64/26:@192.168.195.128/27:@192.168.196.0/24:@192.168.195.160/27:@192.168.195.200/29:@192.168.194.0/24:@129.39.133.32/27:@129.39.133.50/27:@129.39.133.64/26:@129.39.133.128/25:@129.39.141.0/24:@129.39.141.128/26:@129.39.142.160/27:@129.39.143.0/26:@129.39.143.96/27:@129.39.143.160/27:@129.35.160.0/27:@129.35.166.0/28:@158.98.237.0/25:@129.39.142.96/27:@129.39.143.26/26:gznim,root=@192.168.195.0/26:@192.168.195.64/26:@192.168.195.128/27:@192.168.196.0/24:@192.168.195.160/27:@192.168.195.200/29:@192.168.194.0/24:@129.39.133.32/27:@129.39.133.50/27:@129.39.133.64/26:@129.39.133.128/25:@129.39.141.0/24:@129.39.141.128/26:@129.39.142.160/27:@129.39.143.0/26:@129.39.143.96/27:@129.39.143.160/27:@129.35.160.0/27:@129.35.166.0/28:@158.98.237.0/25:@129.39.142.96/27:@129.39.143.26/26:root=@192.168.195.0/26:@192.168.195.64/26:@192.168.195.128/27:@192.168.196.0/24:@192.168.195.160/27:@192.168.195.200/29:@192.168.194.0/24:@129.39.133.32/27:@129.39.133.50/27:@129.39.133.64/26:@129.39.133.128/25:@129.39.141.0/24:@129.39.141.128/26:@129.39.142.160/27:@129.39.143.0/26:@129.39.143.96/27:@129.39.143.160/27:@129.35.160.0/27:@129.35.166.0/28:@158.98.237.0/25:@129.39.142.96/27:@129.39.143.26/26:gznim
[gznim:root:/home/root:] exportfs -u /export/mksysb
[gznim:root:/home/root:] mv /etc/exports /etc/exports.tmp 

[gznim:root:/home/root:] nim -o define -t mksysb -a server=master -a location=/export/mksysb/gzlpar/gzlpar_$(date +%Y%m%d%H%M%S)_sysb -a source=gzlpar -a mksysb_flags=eiX -a mk_image=yes gzlpar_bkp_premig

+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+

Required = 11474417 (11206 MB)    Available = 790102232 (771585 MB)



Creating information file (/image.data) for rootvg.

Creating list of files to back up 
Backing up 86069 files..............................
14817 of 86069 files backed up (17%)......................

86069 of 86069 files backed up (100%)
0512-038 savevg: Backup Completed Successfully.
[gznim:root:/home/root:] ls -la /export/mksysb/gzlpar/gzlpar_*
-rw-r--r--    1 root     system   10699110400 Jan  8 13:28 /export/mksysb/gzlpar/gzlpar_20150108131936_sysb

3. Make sure the fileset bos.alt_disk_install.rte is on the same level in NIM and in the SPOT used for migration:

# lslpp -l bos.alt_disk_install.rte
# nim -o showres [SPOT_resource] | grep bos.alt_disk_install.rte 
# nim -o showres [lpp_source] | grep bos.alt_disk_install.rte

If you need to update lpp_source and spot with bos.alt_disk_install.rte fileset use following commands:

# nim -o update -a packages='bos.alt_disk_install.rte' -a source='[full_path]' -a show_progress=yes [lpp_source]
# nim -o cust -a lpp_source=[lpp_source] -a filesets=bos.alt_disk_install.rte [spot]

The package can be downloaded from IBM website:
http://www-01.ibm.com/support/docview.wss?uid=isg1fileset1493029612

Alternatively, you can create a different spot and lpp_source on the same level with nim server but it's not mandatory.
There are different ways to get this done. I did it as following:
Downloaded lppsource from IBM website, then I have dowloaded the fix pack from fixcentral.
https://cirep.lge.fr.ibm.com/xarpages/home/aix_overview/install_new_server/aix_version_71
http://www-933.ibm.com/support/fixcentral/

Afterwards, I have created lpp_source (copied the downloaded files in /export/mksysb/global/71-03-04/, update it to latest level (same as nim) and created spot from it.

Lpp source creation:
# nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/core/7.1/71-03-04 lppsource_71-03-04

Lpp source update:
# nim -o update -a packages=all -a source=/export/mksysb/global/71-03-04/ -a show_progress=yes lppsource_71-03-04[

Spot creation from lpp source and installation of bos.alt_disk_install.rte:

# nim -o define -t spot -a server=master -a location=/export/spot/7.1/ -a source=lppsource_71-03-04 spot_71-03-04
# nim -o cust -a lpp_source=lppsource_71-03-04 -a filesets=bos.alt_disk_install.rte spot_71-03-04

Checked again the levels of bos.alt_disk_install.rte:

# lslpp -l bos.alt_disk_install.rte
# nim -o showres spot_71-03-04 | grep bos.alt_disk_install.rte
# nim -o showres lppsource_71-03-04 | grep bos.alt_disk_install.rte

Output:

[gznim:root:/home/root:] oslevel -s
7100-03-04-1441
[gznim:root:/home/root:] lsnim |grep 71-03
lppsource_71-03-01             resources       lpp_source
spot_71-03-01                  resources       spot
bundle_71-03-01                resources       installp_bundle
bundle_X11_71-03-01            resources       installp_bundle
bundle_NIMMASTER_71-03-01      resources       installp_bundle
bundle_LDAP_71-03-01           resources       installp_bundle
bundle_DIRECTOR_71-03-01       resources       installp_bundle

[gznim:root:/home/root:] lslpp -l bos.alt_disk_install.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.alt_disk_install.rte  7.1.3.30  APPLIED    Alternate Disk Installation
                                                 Runtime

Path: /etc/objrepos
  bos.alt_disk_install.rte  7.1.3.30  APPLIED    Alternate Disk Installation
                                                 Runtime

[gznim:root:/home/root:] nim -o showres lppsource_71-03-01 | grep bos.alt_disk_install.rte
  bos.alt_disk_install.rte    7.1.0.0                    I  N usr,root 
  bos.alt_disk_install.rte    7.1.2.15                   S  N usr,root 
  bos.alt_disk_install.rte    7.1.3.0                    S  N usr,root 
[gznim:root:/home/root:] nim -o showres spot_71-03-01 | grep bos.alt_disk_install.rte     
  bos.alt_disk_install.rte   7.1.3.0    C     F    Alternate Disk Installation
[gznim:root:/export/lpp_source/core/7.1:] nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/core/7.1/71-03-04 lppsource_71-03-04
Preparing to copy install images (this will take several minutes)...

Now checking for missing install images...
All required install images have been found. This lpp_source is now ready.
[gznim:root:/export/lpp_source/core/7.1:] lsnim -l lppsource_71-03-04
lppsource_71-03-04:
   class       = resources
   type        = lpp_source
   arch        = power
   Rstate      = ready for use
   prev_state  = unavailable for use
   location    = /export/lpp_source/core/7.1/71-03-04
   simages     = yes
   alloc_count = 0
   server      = master
[gznim:root:/export/lpp_source/core/7.1:] ls -la /export/lpp_source/core/7.1/71-03-04
total 264
drwxr-xr-x    3 root     system         4096 Jan  9 12:42 .
drwxr-xr-x    9 root     system         4096 Jan  8 17:01 ..
-rwx------    1 root     system        12767 Jan  9 12:42 AIX.71-03-01.tl.lppsource.install
-r--r-----    1 root     system        49493 Jan  9 12:42 BuildServer_lppsource_list_AIX_71-03-01
-rw-r--r--    1 root     system          766 Jan  9 12:42 BuildServer_lppsource_list_AIX_71-03-01.log
-rw-r--r--    1 root     system        49724 Jan  9 12:42 BuildServer_lppsource_list_AIX_71-03-01_gznim
drwxr-xr-x    3 root     system          256 Jan  9 12:42 installp
[gznim:root:/export/lpp_source/core/7.1:] 


[gznim:root:/export/lpp_source/core/7.1:] nim -o update -a packages=all -a source=/export/mksysb/global/71-03-04/ -a show_progress=yes lppsource_71-03-04

/export/lpp_source/core/7.1/71-03-04/installp/ppc/infocenter.man.EN_US.libs.7.1.3.30.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/infocenter.man.EN_US.files.7.1.3.30.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/infocenter.man.EN_US.commands.7.1.3.30.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/rsct.opt.storagerm.3.2.0.0.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/rsct.opt.stackdump.3.2.0.0.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/rsct.opt.fence.3.2.0.0.I
/export/lpp_source/core/7.1/71-03-04/installp/ppc/rsct.core.3.2.0.0.I

[... useless output deleted ...]

[gznim:root:/export/lpp_source/core/7.1:]

[gznim:root:/home/root:] nim -o define -t spot -a server=master -a location=/export/spot/7.1/ -a source=lppsource_71-03-04 spot_71-03-04

 Creating SPOT in "/export/spot/7.1/" on machine "master" from "lppsource_71-03-04" ...

 Restoring files from BOS image.  This may take several minutes ...

 Installing filesets ...

 Be sure to check the output from the SPOT installation
 to verify that all the expected software was successfully
 installed.  You can use the NIM "showlog" operation to
 view the installation log file for the SPOT.


+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

[... useless output deleted ...]

+-----------------------------------------------------------------------------+
                   BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS 
------------------
  952  Selected to be installed, of which:
      834  Passed pre-installation verification
      115  Replaced by superseding updates
        3  Already installed (directly or via superseding filesets)
   50  Additional requisites to be automatically installed
  ----
  884  Total to be installed

+-----------------------------------------------------------------------------+
                         Installing Software...
+-----------------------------------------------------------------------------+

[... useless output deleted ...]


 Checking filesets and network boot images for SPOT "spot_71-03-04".
 This may take several minutes ...

[gznim:root:/home/root:]                  

[gznim:root:/home/root:] lslpp -l bos.alt_disk_install.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  bos.alt_disk_install.rte  7.1.3.30  APPLIED    Alternate Disk Installation
                                                 Runtime

Path: /etc/objrepos
  bos.alt_disk_install.rte  7.1.3.30  APPLIED    Alternate Disk Installation
                                                 Runtime
[gznim:root:/home/root:] nim -o showres spot_71-03-04 | grep bos.alt_disk_install.rte
[gznim:root:/home/root:] nim -o showres lppsource_71-03-04 | grep bos.alt_disk_install.rte
  bos.alt_disk_install.rte    7.1.0.0                    I  N usr,root 
  bos.alt_disk_install.rte    7.1.2.15                   S  N usr,root 
  bos.alt_disk_install.rte    7.1.3.0                    S  N usr,root 
  bos.alt_disk_install.rte    7.1.3.30                   S  N usr,root 
[gznim:root:/home/root:] 

[gznim:root:/home/root:] nim -o cust -a lpp_source=lppsource_71-03-04 -a filesets=bos.alt_disk_install.rte spot_71-03-04
 Installing filesets ...

 Be sure to check the output from the SPOT installation
 to verify that all the expected software was successfully
 installed.  You can use the NIM "showlog" operation to
 view the installation log file for the SPOT.


+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...Verifying requisites...done
Results...

WARNINGS
--------
  Problems described in this section are not likely to be the source of any
  immediate or serious failures, but further actions may be necessary or
  desired.

  Superseded Fileset Updates
  --------------------------
  Fileset updates listed in this section will not be installed.  Newer
  updates which supersede (replace) these were selected instead (either by
  you or automatically by the installation program).  Make sure that the
  superseding updates listed passed pre-installation verification.

  bos.alt_disk_install.rte 7.1.2.15                 (Superseded by 7.1.3.30)
  bos.alt_disk_install.rte 7.1.3.0                  (Superseded by 7.1.3.30)

  << End of Warning Section >>

SUCCESSES
---------
  Filesets listed in this section passed pre-installation verification
  and will be installed.

  Selected Filesets
  -----------------
  bos.alt_disk_install.rte 7.1.0.0            # Alternate Disk Installation ...
  bos.alt_disk_install.rte 7.1.3.30           # Alternate Disk Installation ...

  << End of Success Section >>

+-----------------------------------------------------------------------------+
                   BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS 
------------------
    4  Selected to be installed, of which:
        2  Passed pre-installation verification
        2  Replaced by superseding updates
  ----
    2  Total to be installed

+-----------------------------------------------------------------------------+
                         Installing Software...
+-----------------------------------------------------------------------------+

installp: APPLYING software for:
        bos.alt_disk_install.rte 7.1.0.0


. . . . . << Copyright notice for bos.alt_disk_install >> . . . . . . .
 Licensed Materials - Property of IBM

 5765H4000
   Copyright International Business Machines Corp. 1997, 2010.

 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.alt_disk_install >>. . . . 

0518-506 odmget: Cannot open object class file_overlay
        Check path name and permissions.
0518-506 odmget: Cannot open object class file_overlay
        Check path name and permissions.
Filesets processed:  1 of 2  (Total time:  2 secs).

installp: APPLYING software for:
        bos.alt_disk_install.rte 7.1.3.30


. . . . . << Copyright notice for bos.alt_disk_install >> . . . . . . .
 Licensed Materials - Property of IBM

 5765H4000
   Copyright International Business Machines Corp. 1997, 2014.

 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.alt_disk_install >>. . . . 

0518-506 odmget: Cannot open object class file_overlay
        Check path name and permissions.
0518-506 odmget: Cannot open object class file_overlay
        Check path name and permissions.
Finished processing all filesets.  (Total time:  4 secs).

+-----------------------------------------------------------------------------+
                                Summaries:
+-----------------------------------------------------------------------------+

Pre-installation Failure/Warning Summary
----------------------------------------
Name                      Level           Pre-installation Failure/Warning
-------------------------------------------------------------------------------
bos.alt_disk_install.rte  7.1.3.0         To be superseded by 7.1.3.30
bos.alt_disk_install.rte  7.1.2.15        To be superseded by 7.1.3.30


Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
bos.alt_disk_install.rte    7.1.0.0         USR         APPLY       SUCCESS    
bos.alt_disk_install.rte    7.1.0.0         ROOT        APPLY       SUCCESS    
bos.alt_disk_install.rte    7.1.3.30        USR         APPLY       SUCCESS    
bos.alt_disk_install.rte    7.1.3.30        ROOT        APPLY       SUCCESS    

 Checking filesets and network boot images for SPOT "spot_71-03-04".
 This may take several minutes ...

[gznim:root:/home/root:] nim -o showres spot_71-03-04 | grep bos.alt_disk_install.rte                                   
  bos.alt_disk_install.rte  7.1.3.30    A     F    Alternate Disk Installation

Prerequisites:

Check that the previous install has been committed, in order to save place in /usr

Commit all packages with SMIT (smitty commit) or with the commands below:

# /usr/lib/instl/sm_inst installp_cmd -c -f'all' '-g' '-X' - Verification
# lslpp -l | grep -i applied
# installp -s all
# lppchk -v

Output (installp command could give you different output if you still have APPLIED packages so do not worry - it will apply them for you.):

# /usr/lib/instl/sm_inst installp_cmd -c -f'all' '-g' '-X' - Verification
installp  -cgX -J  -f File 2>&1

File:
    all                                                     

+-----------------------------------------------------------------------------+
                        Pre-commit Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

WARNINGS
--------
  Problems described in this section are not likely to be the source of any
  immediate or serious failures, but further actions may be necessary or
  desired.

  Nothing to Commit
  -----------------
  There is nothing in the APPLIED state that needs to be committed.

  << End of Warning Section >>
# lslpp -l | grep -i applied
# installp -s all
installp:  No filesets were found in the Software
        Vital Product Database in the APPLIED state.
# lppchk -v
#

Space verification:

The filesystem /tmp must have at least 1GB free.
The filesystem /var must have at least 1GB free.
The filesystem / must have at least 10M free.
The filesystem /usr must have at least 1G free.
The filesystem /opt must have at least 10M free.
Minimum Paging Space 512M.
Minimum Free Memory 128M.
Minimum rootvg free space 500M.

Output:

# df -m /tmp /var / /usr /opt
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd3       10688.00   5165.45   52%      383     1% /tmp
/dev/hd9var      880.00     350.00  61%     5521     7% /var
/dev/hd4         128.00     68.41   47%     5216    24% /
/dev/hd2        3584.00    796.55   78%    56950    24% /usr
/dev/hd10opt     640.00     27.65   96%     8600    54% /opt
# lsvg rootvg |grep FREE
MAX LVs:            256                      FREE PPs:       738 (47232 megabytes)
# lsps -s
Total Paging Space   Percent Used
      8192MB               1%

# chfs -a size=+1G /var
Filesystem size changed to 3932160
# df -g /var
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd9var        1.88      1.35   29%     5521     2% /var
/dev/hd9var     1920.00   1380.67   29%     5524     2% /var

Check the length of LV names in rootvg:

Long names (above 12 chars) will bring problems during the alternate rootvg creation, because they are renamed by adding alt_ prefix.
If command returns one or more LV(s), rename them to stay below 12 digits. If no output, you are good to move forward.

# lsvg -l rootvg | egrep -v "^rootvg|POINT$" | awk '{system("printf "$1"; printf "$1" | wc -m")}' | awk '{if ($2>12) {print $1,$2}}'

Expected output (none):

# lsvg -l rootvg | egrep -v "^rootvg|POINT$" | awk '{system("printf "$1"; printf "$1" | wc -m")}' | awk '{if ($2>12) {print $1,$2}}'
#

Check Scheduled Jobs

Jobs that are scheduled during the migration, should be removed or rescheduled.
# crontab -l
Also, all at jobs should be removed by moving the file /var/spool/cron/atjobs.
You can verify that no jobs are scheduled by running the following command:
# at -l

Save the following files if you have edited them:

/usr/adm/cron/at.allow
/usr/adm/cron/at.deny
/usr/adm/cron/cron.allow
/usr/adm/cron/cron.deny

Backup and disable root crontab (remember the saved file, you will have to restore it after the migration):

# crontab -l > premigration.crontab
# crontab -r

Output:

# ls -la /usr/adm/cron/cron.*    
-rw-r-----    1 bin      cron              3 May 27 2008  /usr/adm/cron/cron.deny
# ls -la /usr/adm/cron/at.*      
-rw-r-----    1 bin      cron              4 May 27 2008  /usr/adm/cron/at.deny

# cat /usr/adm/cron/at.deny
#
# cat /usr/adm/cron/cron.deny
# 

# crontab -l > premigration.crontab
# crontab -r
# crontab -l
can't open yourfile in /var/spool/cron/crontabs directory.
No such file or directory

Backup some files which could be modified during OS migration (if required):

# cp -p /etc/motd /etc/motd.pre71
# cp -p /etc/mail/sendmail.cf /etc/mail/sendmail.cf.pre71

Output:

# cp -p /etc/motd /etc/motd.pre71
# cp -p /etc/mail/sendmail.cf /etc/mail/sendmail.cf.pre71
# ls -la /etc/motd*
-r--r--r--    1 bin      bin             997 May 28 2008  /etc/motd
-r--r--r--    1 bin      bin             997 May 28 2008  /etc/motd.pre71
# ls -la /etc/mail/sendmail.cf*
-r-xr--r--    1 root     system        47410 Jan 26 2011  /etc/mail/sendmail.cf
-r-xr--r--    1 root     system        47410 Jan 26 2011  /etc/mail/sendmail.cf.pre71

Prepare secondary hdisk for rootvg cloning:

a. check if rootvg is mirrored and if yes, check the correct symetric <LV> distribution over PV:

# bootlist -m normal -o
# lsvg -l rootvg
# lsvg -p rootvg
# lspv -l hdiskX > lspv_hdiskX
# lspv -l hdiskY > lspv_hdiskY
# diff lspv_hdiskX lspv_hdiskY

b. Check last boot disks and DO NOT REMOVE this one:

# bootinfo -b

c. Remove the second disk from mirror (assuming the 2nd disk in our case is hdisk2):

# unmirrorvg -c 1 rootvg hdisk2
# chpv -c hdisk2
# lsvg -p rootvg

d. Check that hdisk2 is totally free and no more LV left on hdisk2:

# lspv -l hdisk2

If there are still LVs left, you will have to move them to another disk. At the end, the command lspv -l hdisk2 should display nothing.

# migratepv –l <whatever_lv_was_left> hdisk2 hdisk0
# lsvg –p rootvg
# lspv –l hdisk2

e. Remove the disk from rootvg. Hdisk2 should not be part of any VG after that.
# reducevg rootvg hdisk2
# lsvg -p rootvg
# lspv

Output:

# bootlist -m normal -o
hdisk0 blv=hd5
hdisk0 blv=hd5
hdisk0 blv=hd5
hdisk0 blv=hd5
hdisk0 blv=hd5
# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       2       2    closed/syncd  N/A
hd6                 paging     128     256     2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       2       4       2    open/syncd    /
hd2                 jfs2       56      112     2    open/syncd    /usr
hd9var              jfs2       30      60      2    open/syncd    /var
hd3                 jfs2       167     334     2    open/syncd    /tmp
hd1                 jfs2       4       8       2    open/syncd    /home
hd10opt             jfs2       10      20      2    open/syncd    /opt
lv02                jfs        25      50      2    open/syncd    /Depot
dooncelv            jfs2       2       4       2    open/syncd    /DoOnceAIX
loglv00             jfslog     1       2       2    open/syncd    N/A
lv03                jfs        1       2       2    open/syncd    /opt/Tivoli
dumplv              jfs2       1       2       2    open/syncd    /var/adm/ras/dump_copydir
srmlv               jfs2       1       2       2    open/syncd    /var/adm/perfmgr
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            799         369         67..00..00..144..158
hdisk2            active            799         369         67..00..00..144..158
# lspv -l hdisk0 > lspv_hdisk0
# lspv -l hdisk2 > lspv_hdisk2
# diff lspv_hdisk0 lspv_hdisk2
1c1
< hdisk0:
---
> hdisk2:


# bootinfo -b
hdisk0
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            799         369         67..00..00..144..158
hdisk2            active            799         369         67..00..00..144..158
# unmirrorvg -c 1 rootvg hdisk2
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run 'chpv -c <diskname>'
        as root user to clear the boot record and avoid a potential boot
        off an old boot image that may reside on the disk from which this
        logical volume is moved/removed.
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
        bosboot of system to reinitialize boot records.  Then, user must modify
        bootlist to just include:  hdisk0.
# chpv -c hdisk2
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            799         369         67..00..00..144..158
hdisk2            active            799         799         160..160..159..160..160
# lspv -l hdisk2
# reducevg rootvg hdisk2
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            799         369         67..00..00..144..158
# lspv
hdisk0          00c659d2534e5277                    rootvg          active
hdisk1          00c659d25360587d                    datavg          active
hdisk2          00c659d25362656a                    None            
hdisk3          00c659d25cf44eb0                    datavg          active

PS: If you do not have rootvg mirrored or do not have an extra free disk, you will have to add one to the machine. This part is not covered here.

Uninstall the following AIX.DoOnce packages (IBM internal specific):

AIX.DoOnce.SecurityTool.rte
AIX.DoOnce.CustomTool.rte
lslpp -l | grep DoOnce
installp -u AIX.DoOnce.SecurityTool.rte
installp -u AIX.DoOnce.CustomTool.rte

Output:

# lslpp -l | grep DoOnce                     
  AIX.DoOnce.CustomTool.rte  5.4.0.0  COMMITTED  AIX Do Once Custom Tool
  AIX.DoOnce.SecurityTool.rte
# installp -u AIX.DoOnce.SecurityTool.rte
+-----------------------------------------------------------------------------+
                    Pre-deinstall Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

SUCCESSES
---------
  Filesets listed in this section passed pre-deinstall verification
  and will be removed.

  Selected Filesets
  -----------------
  AIX.DoOnce.SecurityTool.rte 6.6.0.0         # AIX Do Once Security Tool (I...

  << End of Success Section >>

FILESET STATISTICS 
------------------
    1  Selected to be deinstalled, of which:
        1  Passed pre-deinstall verification
  ----
    1  Total to be deinstalled

+-----------------------------------------------------------------------------+
                           Deinstalling Software...
+-----------------------------------------------------------------------------+

installp: DEINSTALLING software for:
        AIX.DoOnce.SecurityTool.rte 6.6.0.0

Finished processing all filesets.  (Total time:  1 secs).

+-----------------------------------------------------------------------------+
                                Summaries:
+-----------------------------------------------------------------------------+

Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
AIX.DoOnce.SecurityTool.rte 6.6.0.0         USR         DEINSTALL   SUCCESS    
# installp -u AIX.DoOnce.CustomTool.rte
+-----------------------------------------------------------------------------+
                    Pre-deinstall Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

SUCCESSES
---------
  Filesets listed in this section passed pre-deinstall verification
  and will be removed.

  Selected Filesets
  -----------------
  AIX.DoOnce.CustomTool.rte 5.4.0.0           # AIX Do Once Custom Tool

  << End of Success Section >>

FILESET STATISTICS 
------------------
    1  Selected to be deinstalled, of which:
        1  Passed pre-deinstall verification
  ----
    1  Total to be deinstalled

+-----------------------------------------------------------------------------+
                           Deinstalling Software...
+-----------------------------------------------------------------------------+

installp: DEINSTALLING software for:
        AIX.DoOnce.CustomTool.rte 5.4.0.0

Finished processing all filesets.  (Total time:  2 secs).

+-----------------------------------------------------------------------------+
                                Summaries:
+-----------------------------------------------------------------------------+

Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
AIX.DoOnce.CustomTool.rte   5.4.0.0         USR         DEINSTALL   SUCCESS    
# lslpp -l | grep DoOnce
#

Check if client has TCB enabled, if yes either perform traditional installation or disable TCB permanently
If TCB is disabled and then after migration it is re-enabled, it will damage the system. Also, if TCB is not disabled, the migration will fail.

1. Check if TCB is enabled:
#odmget -q attribute=TCB_STATE PdAt

2. If the output of above command contains tcb_enabled:
# odmget -q attribute=TCB_STATE PdAt | sed 's/tcb_enabled/tcb_disabled/'| odmchange -o PdAt -q attribute=TCB_STATE

Output (in my case, it was disabled):

# odmget -q attribute=TCB_STATE PdAt | grep deflt
        deflt = "tcb_disabled"

Verify AIO configuration on servers hosting databases (you may need it after the migration):

# lsdev -Cl aio0
# lsattr -El aio0

Output:

# lsdev -Cl aio0
aio0 Defined  Asynchronous I/O (Legacy)
# lsattr -El aio0
autoconfig defined STATE to be configured at system restart True
fastpath   enable  State of fast path                       True
kprocprio  39      Server PRIORITY                          True
maxreqs    4096    Maximum number of REQUESTS               True
maxservers 10      MAXIMUM number of servers per cpu        True
minservers 1       MINIMUM number of servers                True

The Migration

Before starting the migration, as with all nim operations, make sure you won't get any nfs conflicts so clear out /etc/exports and unexport (exportfs -u /mount/point) any nim directory that could interfere with this operation.
nimadm -c [client_name] -s [SPOT] -l [lpp_source] -d [destination_drive] -Y

Output:

[gznim:root:/home/root:] nimadm -c gzlpar -l lppsource_71-03-04 -s spot_71-03-04 -d hdisk2 -Y
Initializing the NIM master.
Initializing NIM client gzlpar.
Verifying alt_disk_migration eligibility.
Initializing log: /var/adm/ras/alt_mig/gzlpar_alt_mig.log
Starting Alternate Disk Migration.

+-----------------------------------------------------------------------------+
Executing nimadm phase 1.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 1.
Client alt_disk_install command: alt_disk_copy -M 7.1 -P1 -d "hdisk2"
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_lv02.
Creating logical volume alt_dooncelv.
Creating logical volume alt_loglv00.
Creating logical volume alt_lv03.
Creating logical volume alt_dumplv.
Creating logical volume alt_srmlv.
Creating logical volume alt_hd11admin.
Creating /alt_inst/ file system.
Creating /alt_inst/Depot file system.
Creating /alt_inst/DoOnceAIX file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/opt/Tivoli file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/perfmgr file system.
Creating /alt_inst/var/adm/ras/dump_copydir 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...
Phase 1 complete.

+-----------------------------------------------------------------------------+
Executing nimadm phase 2.

During the process, if you are curious, you can check from time to time with different terminal, the output of command lsnim -l tsmmgr:

[gznim:root:/home/root:] lsnim -l gzlpar
gzlpar:
   class          = machines
   type           = standalone
   connect        = nimsh
   platform       = chrp
   netboot_kernel = mp
   if1            = vlan111 gzlpar 0
   cable_type1    = N/A
   Cstate         = ready for a NIM operation
   prev_state     = lppchk operation is being performed
   Mstate         = currently running
   lpp_source     = lppsource_71-03-04
   spot           = spot_71-03-04
   cpuid          = 00C659D24C00
   control        = master
   Cstate_result  = success
[gznim:root:/home/root:] lsnim -l gzlpar
gzlpar:
   class          = machines
   type           = standalone
   locked         = 11337944
   connect        = nimsh
   platform       = chrp
   netboot_kernel = mp
   if1            = vlan111 gzlpar 0
   cable_type1    = N/A
   Cstate         = alt_disk_mig operation is being performed
   prev_state     = ready for a NIM operation
   Mstate         = currently running
   lpp_source     = lppsource_71-03-04
   spot           = spot_71-03-04
   cpuid          = 00C659D24C00
   control        = master
   Cstate_result  = success
[gznim:root:/home/root:] cat /etc/exports
/export/lpp_source/core/7.1/71-03-04 -ro,root=gzlpar,access=gzlpar
/export/spot/7.1/spot_71-03-04/usr -ro,root=gzlpar,access=gzlpar

Also, if you check the partition, you will see the unallocated disk is now part of alternate rootvg and extra mounts are present:

# lspv
hdisk0          00c659d2534e5277                    rootvg          active
hdisk1          00c659d25360587d                    datavg          active
hdisk2          00c659d25362656a                    altinst_rootvg  active
hdisk3          00c659d25cf44eb0                    datavg          active
# df | grep alt
/dev/alt_hd4      262144    140136   47%     5240    25% /alt_inst
/dev/alt_lv02    3276800    158216   96%      433     1% /alt_inst/Depot
/dev/alt_dooncelv     262144    255616    3%      141     1% /alt_inst/DoOnceAIX
/dev/alt_hd11admin     262144    261448    1%        4     1% /alt_inst/admin
/dev/alt_hd1      524288     62872   89%     4069    36% /alt_inst/home
/dev/alt_hd10opt    1310720     56664   96%     8600    54% /alt_inst/opt
/dev/alt_lv03     131072    126872    4%       17     1% /alt_inst/opt/Tivoli
/dev/alt_hd3    21889024  10569680   52%      382     1% /alt_inst/tmp
/dev/alt_hd2     7340032   5562136   25%     6346     2% /alt_inst/usr
/dev/alt_hd9var    3932160   3930840    1%        8     1% /alt_inst/var
/dev/alt_srmlv     131072    130392    1%        4     1% /alt_inst/var/adm/perfmgr
/dev/alt_dumplv     131072    130392    1%        4     1% /alt_inst/var/adm/ras/dump_copydir

At the end, if you do not have any errors (normally everything should go smoothly), you just reboot to hdisk2 and you will find yourself in the migrated environment. And if for whatever reason you are not satisfied with this new version, you can always rollback by rebooting into hdisk0. Neat, huh?

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root