Wednesday, 6 June 2012

NIMADM


Migrating to the latest release of AIX may seem like a daunting task, but with the use of IBM's Alternate Disk Migration, staying up-to-date with the latest AIX releases is virtually painless. With ADM you will create a copy of your existing rootvg and apply all the updates to the new copy, all while the system and applications are up and running! The only downtime to the application and its users will be during the system reboot to boot off the new disk.
Some of the benefits to using ADM on your next AIX 5L to 6.1 migration are:
-Reduced downtime for the clients
-Customization through NIM
-Quick recovery from migration failure
In order to use ADM, this document assumes you already have an operational NIM server in your environment. ADM takes advantage of NIM by using its resources to perform the entire migration remotely. There are a few pre-requisites that must be executed on the client before the operation begins, but aside from that, all work will be done from the NIM server. So let's begin.
The following server names will be used in this guide:
nimserv - NIM Master lpar
tstserv - AIX 5L client lpar
Client Side Prerequisites
Target Disk
rootvg on SAN
For the migration we will need a blank disk to make a copy of rootvg. If your lpar boots off the SAN, you can create a new disk equal or greater to your existing rootvg disks for this step.
rootvg on mirrored local scsi
Otherwise, if you have a mirrored rootvg on local scsi, we can temporarily break the mirror and use one of the disks. To do this, first identify what disks make up your rootvg.
On tstserv, run:
#lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk1 active 546 351 109..08..16..109..109
hdisk0 active 546 383 109..40..16..109..109
Now lets break the mirror and take hdisk1 out of the volume group:
#unmirrorvg -c 1 rootvg hdisk1
#reducevg rootvg hdisk1
We will now use '''hdisk1''' as our target disk for the remainder of this guide.
Enable rshd
To allow the NIM master to do its job, rshd must be temporarily enabled on the client. Don't worry this will be disabled after the migration.
As root, execute the following commands on tstserv as root:
# chsubserver -a -v shell -p tcp6 -r inetd
# refresh -s inetd
# cd /
# mv .rhosts .rhosts.old
# echo + > .rhosts
# chmod 600 .rhosts
To test rsh connectivity, run the following on nimserv:
# rsh tstserv whoami
root
Disable TCB
One of the requirements of ADM, is to have either Trusted Computing Base(TCB) disabled or use disk caching on the client. For this example we will be disabling TCB on the client lpar.
So, run the following as root on tstserv:
#odmget -q attribute=TCB_STATE PdAt | sed 's/tcb_enabled/tcb_disabled/' | odmchange -o PdAt -q attribute=TCB_STATE
That's it for the client side pre-req's, now onto the NIM server.
NIM Server Setup
Create lpp resource
In order to create an lpp_source in the NIM environment, we will need the AIX install media. The latest releases for AIX can be found at IBM Entitled Software Support in an ISO format. Once, you've downloaded the media you will need to put the extracted ISO onto the NIM server. One way of doing this is to extact the ISO on your local machine and sftp the contents to a directory on the NIM server. 7-Zip is a free application for Windows that will can extract .ISO files along with other popular conpressed/container formats.
After the ISO has been extracted, the resulting folder should be transfered(FTP/SFTP/SCP/etc) to a common area on the NIM Server. In this example, the contents have been copied to nimserv at /export/lpp_source/AIX61_TL6_Full.
root@nimserv:/export/lpp_source/AIX61_TL6_Full
#ls -l
total 8
drwxr-xr-x 8 root system 4096 Oct 13 09:47 Disc1
drwxr-xr-x 4 root system 256 Oct 13 10:47 Disc2
root@nimserv:/export/lpp_source/AIX61_TL6_Full
#ls Disc1
.Version README.aix image.data root
6100-06 RPMS installp usr
OSLEVEL bosinst.data ppc
Notice there are two discs for the full install. We will only be creating an lpp_source of the first disc. The second disc contains additional language packs and is not required for the migration, but is good to have just in case you require them someday. Now that you have the install media down on the NIM server, you will need to create a NIM lpp_source resource of the media. To do this run the following command on nimserv as root:
#nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/AIX61_TL6_Full/Disc1 AIX61_TL6_Full_lpp
You now have a new NIM lpp_source resource called AIX61_TL6_Full_lpp, now we have to create the spot.
Create spot resource
Now, with your newly created lpp_source we will create the spot. Run the following on nimserv as root:
nim -o define -t spot -a source=AIX61_TL6_Full_lpp -a server=master -a location=/export/spot/AIX61_TL6_Full_spot AIX61_TL6_Full_spot
Check spot for bos.alt_disk_install.rte
Once the spot has been created, it's a good idea to check to make sure the bos.alt_disk_install.rte package was copied into the spot during its creation. Run the following to check your spot:
root@dbnim:/export/spot
# nim -o showres 'AIX61_TL6_Full_spot' | grep "bos.alt_disk_install.rte"
bos.alt_disk_install.rte 6.1.6.0 C F Alternate Disk Installation
If you do not see the Alternate Disk Installation fileset you will need to install it manually into your spot from the lpp_source. To do this run the following:
nim -o cust -a lpp_source=AIX61_TL6_Full_lpp -a filesets=bos.alt_disk_install AIX61_TL6_Full_spot
Launch ADM
You should now be ready to run the Migration. To kick it off run the following:
# nimadm -c tstserv -s AIX61_TL6_Full_spot -l AIX61_TL6_Full_lpp -d hdisk1 -Y
If you want to run the job in the background, you could do something like:
# at now
nimadm -c tstserv -s AIX61_TL6_Full_spot -l AIX61_TL6_Full_lpp -d hdisk1 -Y 1>/tmp/tstserv_mig.log 2>/tmp/tstserv_mig.err
-d
Now you can monitor the logs, and play a game of disc golf. This step will take 3-4 hours depending on your I/O and network constraints.
The installation runs in 12 phases, and once you see the 12th phase is complete you are ready to reboot your client system. The procedure automatically sets the boolist of the system to the new AIX 6.1 disk, so at an agreed time, you can issue the following command to reboot your new AIX 6.1 machine. On tstserv run the following:
# shutdown -Fr now
Client Cleanup
Once tstserv is back online, there are a few steps to clean up the installation. First off you'll want to check if the migration was successful. To see the current AIX level, run:
# oslevel -s
6100-06-01-1043
A note for Kerberos users
If you're using Kerberos to authenticate your users, you'll have to update the /usr/lib/security/methods.cfg file to work in AIX 6.1. Add the following lines to /usr/lib/security/methods.cfg:
KRB5A:
program = /usr/lib/security/KRB5A
program_64 = /usr/lib/security/KRB5A_64
options = authonly,tgt_verify=no,kadmind=no,is_kadmind_compat=no
KRB5Afiles:
options = db=BUILTIN,auth=KRB5A
Disable rshd
Next, we'll want to disable rshd. Run the following as root:
# chsubserver -d -v shell -p tcp6 -r inetd
# refresh –s inetd
# cd /
# mv .rhosts.old .rhosts
Mirror rootvg
Lastly, assuming everything went well, and all the applications are running correctly, we'll want to destroy the old AIX 5L disk(old_rootvg), and use that disk to mirror the AIX 6.1 rootvg.
# lspv | grep old_rootvg
hdisk0 0000140c06ea6b32 old_rootvg
# alt_rootvg_op -X old_rootvg
# extendvg –f rootvg hdisk0
# mirrorvg rootvg hdisk0
# bosboot -a -d /dev/hdisk0
# bosboot -a -d /dev/hdisk1
# bootlist -m normal hdisk0 hdisk1
# bootlist -m normal -o
hdisk0 blv=hd5
hdisk1 blv=hd5
Back Out Plan
Otherwise if there is a problem and you need to boot off the old AIX 5L disk you can do the following:
# lspv | grep old_rootvg
hdisk0 0000140c06ea6b32 old_rootvg
# bootlist -m normal hdisk0
# bootlist -m normal –o
hdisk0 blv=hd5
# shutdown –Fr now
 * Source Article from : Internet