Sunday 27 November 2016

AIX Migration from AIX5.3/6.1 to AIX 7.1 Using NIMADM



NIMADM is a facility to move the server from one operating system(AIX 5.3) to another operating system(AIX6.1 or 7.1).The nimadm is an utility having more advantages to compare CD/DVD migration.
In CD/DVD migration method will override /tmp, means whatever the data exist inside /tmp will removed be in new OS version.
NIMADM takes a copy of client server rootvg to spare disk(hdisk5) and simultaneously migrate the server to new OS version.This can be done without downtime and no disruption to client.mksysb backup is optional.

Minimum downtime: Once OS migration completed, downtime required for reboot the client to take into new OS version(AIX6.1 or 7.1). It will take 30-45min per the system.

No Outage : NIMADM is online migration,during the migration process no impact to applications and database.

Easy to Rollback: If applications/Databases are not running as ealier, it very simple to rollback to old level.Just change the bootlist and reboot client server. NIMADM failes in middle whatever the changes are made in altinst_root. It won't impact to original rootvg.

NIM Master take the workload, this will reduce the overhead on client

For example : Consider the naming conventions as below
NIM Master : aixnim
NIM Client  : aix45
lpp_source   : aix7134_lpp
SPOT          : aix1734_spot
Spare disk   : hdisk5

Pre-Checks and Implementation on NIM Master :
1. NIM master running AIX7.1 or latest level of Technology Level/Service Pack.
   # oslevel -s

2. Same level of bos.alt_disk_install.rte fileset must be installed on NIM master rootvg and SPOT
   # lslpp -l|grep -i bos.alt_disk_install.rte

3. NIM resources lpp_source and SPOT level must be same or lower version of NIM Master OS level. We won't migrate higher than NIM Master.
   # lsnim -l aix7134_lpp
   # lsnim -l aix7134_spot

4. Get the new disk from SAN with same or higher size of NIM master rootvg. To create nimadmvg
   # mkvg -y nimadmvg -s 128 hdisk1

5. Update ip address and client name in /etc/hosts
   # vi /etc/hosts
    
6. Define nim client machine
   # smit nim_mkmac

7. Check rsh connectivity between NIM master and client. NIM master able to run commands through rsh.
   # rsh aix45 date

8. bos.alt_disk_install.rte fileset must be installed on NIM master and also in the SPOT.If not you have to add the fileset to SPOT.  
 # lslpp -l bos.alt_disk_install.rte
   # nim -o showres aix7134_lpp | grep -i bos.alt_disk_install.rte (Check on lpp_source)

   # nim -o showres aix1734_spot | grep -i bos.alt_disk_install.rte (Check on SPOT)

   # nim -o cust -a filesets=bos.alt_disk_install.rte -a lpp_source=aix7134_lpp aix7134_spot (add fileset to SPOT)


Pre-Checks and Implementation on NIM Client :
9. Verify oslevel, missing filesets and commit applied filesets
   # oslevel -s
   # lppchk -vm3
   # instfix -i | grep ML
   # instfix -i | grep SP
   # installp -c all   (commit applied filesets)

10. Check hardware,software and firmware levels must be support to required AIX level which you migrating
   # lsmcode -c

11. Get spare disk with same or higher size of client rootvg. If rootvg mirrored break it and use it for migration.
   # lspv

rootvg mirrored :

   # bootinfo -b
   # mirrorvg rootvg hdisk1
   # reducevg -df rootvg hdisk1
   # chpv -c hdisk1
   # bootlist -m normal -o
   # bootlist -ad /dev/hdisk0
   # bootlist -m normal -o

12. lv names must be less tham 11 characters
   # lsvg -l rootvg

13. rsh must be enabled on client. Check root user home directory weather it will be / or /home/root (ex: /home/root)
   # chsubserver -a -v shell -p tcp6 -r inetd
   # refresh -s inetd

   # cd /home/root
   # rm .rhosts
   # vi .rhosts (add as below)
     aixnim  root
   # chmod 600 .rhosts

Check following command on NIM master
   # rsh aix45 date

14. Take the backup of system configuration files like /etc/sendmail.cf , /etc/motd, netstat -rn,vmo -a, ioo -a ...etc

15. Verify the /etc/niminfo file. NIM Master details must updated on this file. If not exist run (#smit nim) and enter NIM master details.
    # cat /etc/niminfo
    # smit nim (to create /etc/niminfo file)

16. Take the mksysb backup if you want.
   # mksysb -i <destination path>


Run NIMADM Command on NIM Master:

# nimadm -j <nimadmvg> -c <clientname> -l <lpp_source> -s <SPOT> -d <spare disk> -Y

# nimadm -j nimadmvg -c aix45 -l aix7134_lpp -s aix7134_spot -d hdisk5 -Y

  -j VG specified on NIM Master
  -c client machine name defined in NIM Master
  -l Name of lpp_source defined in NIM Master
  -s Name of SPOT defined in NIM Master
  -d spare disk for alternate rootvg(altinst_rootvg)
  -Y Accept license

Once migration starts cache file systems create the in nimadmvg and removes the after successful migration.
The migration process will takes in 12 phases .The following is the output of 12 phases while migration is going on

Post Migration :

1. After NIMADM completed,check the bootlist and set to hdisk5(altinst_rootvg)
   # bootlist -m normal -o
   # bootlist -m normal hdisk5 hdisk0

2. Inform to application/database team to stop  applications/database

3. Reboot the server and once it came up check the oslevel
   # oslevel -s

   # shutdown -Fr (It will take few minutes to Power UP)
   # oslevel -s
   # lppchk -vm3
   # instfix -i | grep ML
   # instfix -i | grep SP

4. Inform to application/database team to start  applications/database

5. Disable rsh after the migration
   # chsubserver -d -v shell -p tcp6 -r inetd
   # refresh –s inetd
   # cd /home/root
   # rm .rhosts
   # ln -s /dev/null .rhosts


NIMADM 12 Phases :

Initializing the NIM master.
Initializing NIM client aix45.
Verifying alt_disk_migration eligibility.
Initializing log: /var/adm/ras/alt_mig/aix45_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 -j -M 6.1 -P1 -d "hdisk5"
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_paging00
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_lg_dumplv
Creating logical volume alt_hd11admin
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files
for backup and restore into the alternate file system...
Phase 1 complete.

+-----------------------------------------------------------------------------+
Executing nimadm phase 2.
+-----------------------------------------------------------------------------+
Creating nimadm cache file systems on volume group migvg.
Checking for initial required migration space.
Creating cache file system /aix45_alt/alt_inst
Creating cache file system /aix45_alt/alt_inst/admin
Creating cache file system /aix45_alt/alt_inst/home
Creating cache file system /aix45_alt/alt_inst/opt
Creating cache file system /aix45_alt/alt_inst/tmp
Creating cache file system /aix45_alt/alt_inst/usr
Creating cache file system /aix45_alt/alt_inst/var

+-----------------------------------------------------------------------------+
Executing nimadm phase 3.
+-----------------------------------------------------------------------------+
Syncing client data to cache ...

+-----------------------------------------------------------------------------+
Executing nimadm phase 4.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.

+-----------------------------------------------------------------------------+
Executing nimadm phase 5.
+-----------------------------------------------------------------------------+
Saving system configuration files.
Checking for initial required migration space.
Setting up for base operating system restore.
/aix45_alt/alt_inst
Restoring base operating system.
Merging system configuration files.
Running migration merge method: ODM_merge Config_Rules.
Running migration merge method: ODM_merge SRCextmeth.
Running migration merge method: ODM_merge SRCsubsys.
Running migration merge method: ODM_merge SWservAt.
Running migration merge method: ODM_merge pse.conf.
Running migration merge method: ODM_merge vfs.
Running migration merge method: ODM_merge xtiso.conf.
Running migration merge method: ODM_merge PdAtXtd.
Running migration merge method: ODM_merge PdDv.
Running migration merge method: convert_errnotify.
Running migration merge method: passwd_mig.
Running migration merge method: login_mig.
Running migration merge method: user_mrg.
Running migration merge method: secur_mig.
Running migration merge method: RoleMerge.
Running migration merge method: methods_mig.
Running migration merge method: mkusr_mig.
Running migration merge method: group_mig.
Running migration merge method: ldapcfg_mig.
Running migration merge method: ldapmap_mig.
Running migration merge method: convert_errlog.
Running migration merge method: ODM_merge GAI.
Running migration merge method: ODM_merge PdAt.
Running migration merge method: merge_smit_db.
Running migration merge method: ODM_merge fix.
Running migration merge method: merge_swvpds.
Running migration merge method: SysckMerge.

+-----------------------------------------------------------------------------+
Executing nimadm phase 6.
+-----------------------------------------------------------------------------+
Installing and migrating software.
Updating install utilities.
+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
+-----------------------------------------------------------------------------+
Executing nimadm phase 7.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.

+-----------------------------------------------------------------------------+
Executing nimadm phase 8.
+-----------------------------------------------------------------------------+
Creating client boot image.
bosboot: Boot image is 49152 512 byte blocks.
Writing boot image to client's alternate boot disk hdisk5.

+-----------------------------------------------------------------------------+
Executing nimadm phase 9.
+-----------------------------------------------------------------------------+
Adjusting client file system sizes ...
Adjusting size for /
Adjusting size for /admin
Adjusting size for /home
Adjusting size for /opt
Adjusting size for /tmp
Adjusting size for /usr
Adjusting size for /var
Syncing cache data to client ...
Expanding /alt_inst/tmp client filesystem.
Filesystem size changed to 11796480
Filesystem size changed to 2883584
Filesystem size changed to 6029312
Filesystem size changed to 262144
+-----------------------------------------------------------------------------+
Executing nimadm phase 10.
+-----------------------------------------------------------------------------+
Unmounting client mounts on the NIM master.
forced unmount of /aix45_alt/alt_inst/var
forced unmount of /aix45_alt/alt_inst/var
forced unmount of /aix45_alt/alt_inst/usr
forced unmount of /aix45_alt/alt_inst/usr
forced unmount of /aix45_alt/alt_inst/tmp
forced unmount of /aix45_alt/alt_inst/tmp
forced unmount of /aix45_alt/alt_inst/opt
forced unmount of /aix45_alt/alt_inst/opt
forced unmount of /aix45_alt/alt_inst/home
forced unmount of /aix45_alt/alt_inst/home
forced unmount of /aix45_alt/alt_inst/admin
forced unmount of /aix45_alt/alt_inst/admin
forced unmount of /aix45_alt/alt_inst
forced unmount of /aix45_alt/alt_inst
Removing nimadm cache file systems.
Removing cache file system /aix45_alt/alt_inst
Removing cache file system /aix45_alt/alt_inst/admin
Removing cache file system /aix45_alt/alt_inst/home
Removing cache file system /aix45_alt/alt_inst/opt
Removing cache file system /aix45_alt/alt_inst/tmp
Removing cache file system /aix45_alt/alt_inst/usr
Removing cache file system /aix45_alt/alt_inst/var

+-----------------------------------------------------------------------------+
Executing nimadm phase 11.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 3.
Client alt_disk_install command: alt_disk_copy -j -M 7.1 -P3 -d "hdisk5"
## Phase 3 ###################
Verifying altinst_rootvg...
Modifying ODM on cloned disk.
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk5 blv=hd5

+-----------------------------------------------------------------------------+
Executing nimadm phase 12.
+-----------------------------------------------------------------------------+
Cleaning up alt_disk_migration on the NIM master.
Cleaning up alt_disk_migration on client aix45.





 Thanks for reading the Post

6 comments:

Privacy Policy

  Privacy Policy for UNIX TECH INFO At UNIX TECH INFO, accessible from https://unixworld4admin.blogspot.com/, one of our main priorities is ...