Migrate Your NIM Master to AIX 7.2 Using the VIOS VML
This article explains, step by step, how to migrate your NIM master from AIX 7.1 to AIX 7.2.
By Chris Gibson06/21/2017
On more than one occasion I’ve written articles and blogs on how to migrate AIX systems to a new version of the AIX operating system. You can find a list these articles (and others) here. Each of the Network Installation Management articles focuses on migrating AIX systems (which are configured as NIM clients). The approach is always the same; use a NIM master to migrate the NIM clients to the next release of AIX. What they don’t discuss is how to migrate your NIM master to a new version of the OS. This is the very first step you should take before you consider migrating your clients. The NIM master should always be at the same or higher AIX level than the level you are migrating to on a client. So, in this latest article, I’ll discuss, step by step, how to migrate your NIM master from AIX 7.1 to AIX 7.2 (the latest release of the AIX OS).
Using the Virtual Media Library (VML) on your Virtual I/O Server (VIOS), you can easily migrate your NIM master to AIX 7.2 (or any new release of AIX for that matter). If you’re not familiar with the VIOS VML, please review the following documents:
How to configure a VIOS Media Repository/Virtual Media Library.
Creating a bootable ISO image from mksysb images and installing it via VIOS file-backed devices.
In the example that follows, we will migrate a NIM master from AIX 7.1 TL4 SP3 to AIX 7.2 TL1 SP1. Then we’ll create the necessary NIM resources required to serve AIX 7.2 to our NIM clients.
The first step requires that you download the latest AIX 7.2 ISO images from the IBM Entitled Software Support (ESS) website.
Once the images have been successfully downloaded, copy them to the VML (/var/vio/VMLibrary ) on one of your VIOS. If you haven’t created the VML yet, do so now (before copying the images), using the mkrep command on the VIOS (refer to the articles referenced above for information on creating a VML).
$ ls -ltr /var/vio/VMLibrary total 31777416 -r--r--r-- 1 root system 3378020352 Jan 18 21:10 AIX_v7.2_DVD_1.iso -r--r--r-- 1 root system 4168876032 Jan 18 21:56 AIX_v7.2_DVD_2.iso $ lsrep Size(mb) Free(mb) Parent Pool Parent Size Parent Free 25497 9979 rootvg 279552 132096 Name File Size Optical Access AIX_v7.2_DVD_1.iso 3222 None ro AIX_v7.2_DVD_2.iso 3976 None ro
With the AIX 7.2 ISO images now in place, we can now create a new virtual optical device and assign it to the NIM master logical partition (LPAR). In this example, the NIM master (nimmast) is hosted by the VIOS named vio1 and is mapped to the (existing) vhost4 adapter (as shown in the kdb output below). The mkvdev –fbo command on the VIOS is used to create the virtual optical device (vtopt4) and it is assigned to vhost4.
[root@nimmast]/ # echo cvai | kdb -script | grep vio vscsi0 0x000007 0x0000000000 0x0 vio1->vhost4 $ hostname vio1 $ mkvdev -fbo -vadapter vhost4 vtopt4 Available $ lsmap -vadapter vhost4 | grep -p vtop VTD vtopt4 Status Available LUN 0x8100000000000000 Backing device Physloc Mirrored N/A
Now we can load the first AIX 7.2 ISO image into the vtopt4 device on the VIOS.
$ loadopt -vtd vtopt4 -disk AIX_v7.2_DVD_1.iso $ lsmap -vadapter vhost4 | grep -p vtop VTD vtopt4 Status Available LUN 0x8100000000000000 Backing device /var/vio/VMLibrary/AIX_v7.2_DVD_1.iso Physloc Mirrored N/A
From the NIM master LPAR, we now find a new cd0 device is available. You can verify that the cdrom device is working by simply mounting the /cdrom file system and viewing the contents of the AIX 7.2 installation media.
[root@nimmast]/ # cfgmgr [root@nimmast]/ # lsdev -Cc cdrom cd0 Available Virtual SCSI Optical Served by VIO Server [root@nimmast]/ # crfs -v cdrfs -p ro –d cd0 -m /cdrom -Ano [root@nimmast]/ # mount /cdrom [root@nimmast]/ # cd /cdrom [root@nimmast]/cdrom # ls -ltr total 84 drwxr-xr-x 3 4000 4000 2048 Oct 10 2016 root drwxr-xr-x 3 4000 4000 2048 Oct 10 2016 ppc -rw-r--r-- 1 4000 4000 901 Oct 10 2016 README.aix drwxr-xr-x 2 4000 4000 2048 Oct 10 2016 7200-01 -rw-r--r-- 1 4000 4000 15189 Oct 10 2016 image.data -rw-r--r-- 1 4000 4000 6442 Oct 10 2016 bosinst.data -rw-r--r-- 1 4000 4000 16 Oct 10 2016 OSLEVEL drwxrwxr-x 4 4000 4000 2048 Oct 10 2016 RPMS drwxr-xr-x 10 4000 4000 2048 Oct 10 2016 usr drwxr-xr-x 4 4000 4000 2048 Oct 10 2016 installp -rw-rw-r-- 1 4000 4000 42 Oct 10 2016 .Version [root@nimmast]/cdrom # cat OSLEVEL OSLEVEL=188.8.131.52
Before you migrate your NIM master to AIX 7.2 you should first review the AIX 7.2 release notes and ensure that you have met all the prerequisites. For example, you should always ensure you have enough free disk space (PPs) in the root volume group. You can check this using the lsvg command (see below). Refer to the release notes for specific space (and other) requirements, before proceeding.
[root@nimmast]/ # lsvg rootvg VOLUME GROUP: rootvg VG IDENTIFIER: 00f603cd00004c000000013342a0f420 VG STATE: active PP SIZE: 32 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 639 (20448 megabytes) MAX LVs: 256 FREE PPs: 58 (1856 megabytes) LVs: 13 USED PPs: 581 (18592 megabytes) OPEN LVs: 12 QUORUM: 2 (Enabled) TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per VG: 32512 MAX PPs per PV: 1016 MAX PVs: 32 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable PV RESTRICTION: none INFINITE RETRY: no DISK BLOCK SIZE: 512 CRITICAL VG: no FS SYNC OPTION: no
This technote from IBM provides some excellent advice in preparing for an AIX migration. I recommend reading it.
Preparing to Migrate in AIX
And, from one of my older articles on the topic, I mention a couple of other things to consider.
- I always take a copy of the /etc/sendmail.cf and /etc/motd files before an AIX migration. These files will be replaced during the migration and you will need to edit them again and add your modifications.
- Commit any applied filesets. You should also consider removing any ifixes that may hinder the migration.
- Prior to a migration, it is always a good idea to run the pre_migration script on the system to catch any issues that may prevent the migration from completing successfully. You can find this script on the AIX 6.1 installation media.
- Run this script, review the output (in /home/pre_migration), and correct any issues that it reports before migrating.
It’s always a good idea to take a backup of your system before you perform an AIX migration. I recommend you take a mksysb of your NIM master to another system (over NFS). I also highly recommend that you create an alternate (clone) disk image of the system before you start. This will allow you to back out from the migration, to the previous release of AIX, very easily. So, if the migration to AIX 7.2 was to fail, you could very quickly, reboot back into AIX 7.1.
You can create a clone of your rootvg using the alt_disk_copy command. In this example, I first ensure that the clone disk (hdisk3) is large enough to cater for a complete copy of my existing rootvg. I then execute the alt_disk_copy command with the –B flag. I used this flag specifically so that the bootlist is not changed, as I don’t want to boot on the cloned disk (it will only be used if the migration were to fail).
[root@nimmast]/ # lspv hdisk0 00f603cd42a0f354 rootvg active hdisk1 00f603cd42eb8514 nimvg active hdisk2 000cd7927edb991e nimvg active hdisk3 none None [root@nimmast]/ # getconf DISK_SIZE /dev/hdisk3 51200 [root@nimmast]/ # alt_disk_copy -Bd hdisk3 Calling mkszfile to create new /image.data file. Checking disk sizes. Creating cloned rootvg volume group and associated logical volumes. Creating logical volume alt_fixelv. Creating logical volume alt_hd6. Creating logical volume alt_hd8. Creating logical volume alt_hd3. Creating logical volume alt_hd1. Creating logical volume alt_hd11admin. Creating logical volume alt_lg_dumplv. Creating logical volume alt_livedump. Creating logical volume alt_bos_hd5. Creating logical volume alt_bos_hd4. Creating logical volume alt_bos_hd2. Creating logical volume alt_bos_hd9var. Creating logical volume alt_bos_hd10opt. Creating /alt_inst/ file system. Creating /alt_inst/admin file system. Creating /alt_inst/fixes 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. Creating /alt_inst/var/adm/ras/livedump 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... Modifying ODM on cloned disk. Building boot image on cloned disk. forced unmount of /alt_inst/var/adm/ras/livedump forced unmount of /alt_inst/var/adm/ras/livedump forced unmount of /alt_inst/var forced unmount of /alt_inst/var forced unmount of /alt_inst/usr forced unmount of /alt_inst/usr forced unmount of /alt_inst/tmp forced unmount of /alt_inst/tmp forced unmount of /alt_inst/opt forced unmount of /alt_inst/opt forced unmount of /alt_inst/home forced unmount of /alt_inst/home forced unmount of /alt_inst/fixes forced unmount of /alt_inst/fixes forced unmount of /alt_inst/admin forced unmount of /alt_inst/admin forced unmount of /alt_inst forced unmount of /alt_inst Changing logical volume names in volume group descriptor area. Fixing LV control blocks... Fixing file system superblocks...
The cloned rootvg is automatically named altinst_rootvg.
[root@nimmast]/ # lspv hdisk0 00f603cd42a0f354 rootvg active hdisk1 00f603cd42eb8514 nimvg active hdisk2 000cd7927edb991e nimvg active hdisk3 00f603cdd683f13f altinst_rootvg
Note: If your NIM master and/or clients use the SDDPCM multi-pathing disk driver (with IBM SVC or other IBM disk), please don’t forget that you’ll need to update the SDDPCM fileset to correct version for AIX 7.2. The devices.sddpcm.71.rte fileset will need to be removed and devices.sddpcm.72.rte installed. IBM support has scripts to assist with this process when performing conventional migrations (i.e. from media and/or the VML) and with NIM/nimadm. You can obtain these scripts by opening a PMR with IBM support. There are several different scripts, depending on the type of migration you are performing. For example, if you are performing a conventional migration (just as we are in this article) then you can request the “Procedures for migrating SDDPCM before AIX Operating Systems migration or Virtual I/O Server migration” scripts (two scripts: migratePCMbeforeOSmigrate.sh and restorelvm.sh). If you are migrating a NIM client, using nimadm, then should request the “Migrate SDDPCM along with the nimadm method of AIX OS migration via NIM for SAN boot or Non-SAN boot client” scripts (four scripts: preSDDPCMOSmigration.sh, postSDDPCMOSmigration.sh, savelvm.sh and restorelvm.sh).
We’re almost ready to start our migration but first we should take a backup of our NIM database, just in case something was to go wrong during the migration (very unlikely, but better to be safe than sorry). Copy the database backup file to another system other than the NIM master, just in case.
[root@nimmast]/ # smit nim_backup_db Backup the NIM Database Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Filename/Device for the Backup [/data/nimmast.nim.db.backup.Jan_27_2017] + COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. a ./etc/objrepos/nim_attr 48 blocks a ./etc/objrepos/nim_attr.vc 80 blocks a ./etc/objrepos/nim_object 8 blocks a ./etc/objrepos/nim_object.vc 16 blocks a ./etc/NIM.level 1 blocks a ./etc/niminfo 1 blocks a ./etc/NIM.primary.cpuid 1 blocks [root@nimmast]/ # ls -ltr /data/nimmast* -rw-r--r-- 1 root system 92160 Jan 27 14:08 nimmast.nim.db.backup.Jan_27_2017
The next step is to reboot the NIM master from the virtual CD device. To achieve this, I first connect to the Hardware Management Console (HMC) and open a console window on the NIM master LPAR. It is from here that I will reboot the LPAR and perform the migration.
hscroot@hmc1:~> source ezh hscroot@hmc1:~> lparconsole nimmast root@nimmast]/ # shutdown –Fr - Select ‘SMS Menu’ (1). 1 = SMS Menu 5 = Default Boot List 8 = Open Firmware Prompt 6 = Stored Boot List Memory Keyboard Network SCSI Speaker
- Select the ‘SCSI CD-ROM’ device. Continue to Boot from this device.
PowerPC Firmware Version AL730_152 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved. ------------------------------------------------------------------------------- Select Device Device Current Device Number Position Name 1. - Interpartition Logical LAN ( loc=U8233.E8B.1003CDP-V6-C10-T1 ) 2. 1 SCSI 49 GB Harddisk, part=2 (AIX 7.1.0) ( loc=U8233.E8B.1003CDP-V6-C24-T1-L8500000000000000 ) 3. - SCSI CD-ROM ( loc=U8233.E8B.1003CDP-V6-C24-T1-L8100000000000000 ) 4. - SCSI 19 GB Harddisk, part=4 (AIX 7.1.0) ( loc=U8233.E8B.1003CDP-V6-C24-T1-L8200000000000000 ) ------------------------------------------------------------------------------- Navigation keys: M = return to Main Menu ESC key = return to previous screen X = eXit System Management Services ------------------------------------------------------------------------------- Type menu item number and press Enter or select Navigation key:3
At the main BOS menu, ensure that Migration is displayed for the ‘Method of Installation’. CAUTION: If you select anything other than Migration, you will overwrite your system either partially or completely! Ensure that correct disk is selected (in this hdisk0). If it is not correct, enter the ‘System Settings’ menu and select the correct target disk. When you’re satisfied that all selections are correct, press ENTER to continue with the migration.
Installation and Settings Either type 0 and press Enter to install with current settings, or type the number of the setting you want to change and press Enter. 1 System Settings: Method of Installation.............Migration Disk Where You Want to Install.....hdisk0 2 Primary Language Environment Settings (AFTER Install): Cultural Convention................English (United States) Language ..........................English (United States) Keyboard ..........................English (United States) Keyboard Type......................Default 3 Security Model.......................Default 4 More Options (Software install options) 5 Select Edition.......................standard >>> 0 Install with the current settings listed above. +----------------------------------------------------- 88 Help ? | WARNING: Base Operating System Installation will 99 Previous Menu | destroy or impair recovery of SOME data on the | destination disk hdisk0. >>> Choice : 0
Press enter to confirm the migration should continue.
Migration Confirmation Either type 0 and press Enter to continue the installation, or type the number of your choice and press Enter. 1 List the saved Base System configuration files which will not be merged into the system. These files are saved in /tmp/bos. 2 List the filesets which will be removed and not replaced. 3 List directories which will have all current contents removed. 4 Reboot without migrating. Acceptance of license agreements is required before using system. You will be prompted to accept after the system reboots. >>> 0 Continue with the migration. 88 Help ? +--------------------------------------------------------------------------- WARNING: Selected files, directories, and filesets (installable options) from the Base System will be removed. Choose 2 or 3 for more information. >>> Choice: 0
The migration process has now started. Several hundred filesets will be installed. This process will take some time to complete.
Filesets processed: 36 of 708 System Installation Time: 3 minutes Tasks Complete: 21% installp: APPLYING software for: infocenter.man.JA_JP.commands 184.108.40.206 ...
You will be prompted to load the second volume of the AIX 7.2 installation media. This can be performed on the VIOS.
installp: APPLYING software for: xlfrte.msg.en_US 220.127.116.11 installp: Please insert volume 2 into device /dev/cd0 and press Enter to continue or enter "q" to quit. ;On the VIOS $ loadopt -f -disk AIX_v7.2_DVD_2.iso -vtd vtopt4
Press enter now and the migration will continue.
installp: APPLYING software for: infocenter.man.ZH_CN.commands 18.104.22.168 . . . . . << Copyright notice for infocenter.man.ZH_CN.commands >> . . . . . . . Licensed Materials - Property of IBM
When the migration has completed successfully, it will automatically reboot the LPAR, after which you will be able to login to the LPAR and verify it is running AIX 7.2.
[root@nimmast]/ # oslevel -s 7200-01-01-1642
To quickly verify the NIM master and its database are intact, after the migration, run the lsnim command to view the NIM configuration. If nothing is returned then something has gone wrong during the migration or you did not perform a Migration Installation.
[root@nimmast]/ # lsnim -l master master: class = machines type = master max_nimesis_threads = 20 if_defined = chrp.64.ent comments = machine which controls the NIM environment validate_cpuid = no ssl_support = yes platform = chrp netboot_kernel = 64 if1 = 10_1_50 nimmast FAFAC3B1FF0B cable_type1 = N/A Cstate = ready for a NIM operation prev_state = ready for a NIM operation Mstate = currently running serves = 53gibbo-p8-mksysb serves = 710lpp_res serves = 750lpar9_mksysb710202-1316 serves = vio1_mksysb serves = 750wpar2-savewpar-image serves = AIX53TL12SP9_P8 serves = AIX71TL3SP3base ...etc... master_port = 1058 registration_port = 1059 Cstate_result = success reserved = yes
At this point, your NIM master has been successfully migrated to AIX 7.2.
In order for your NIM master to support the installation and/or migration of AIX 7.2 on your NIM clients, you first need to configure a new Licensed Program Product (LPP) source and Shared Product Object Tree (SPOT) NIM resource.
We’ll create a new AIX 7.2 TL1 SP1 LPP source on the master. I’ve created an empty file system for the new lpp_source resource.
[root@nimmast]/export/nim/lpp_source/AIX72TL1SP1 # ls -ltr total 0
Mounting the both the AIX 7.2 ISO images on the master allows me to copy the contents of these images into the new LPP source file system. I’ve copied the ISO images to a file system on the NIM master in preparation for the resource creation.
[root@nimmast]/export/mksysb/cg # mkdir /mnt/v1 /mnt/v2 [root@nimmast]/export/mksysb/cg # loopmount -i AIX_v7.2_Base_Install_DVD_1_of_2_TL_7200-01-00_112016.iso -o "-V cdrfs -o ro" -m /mnt/v1 [root@nimmast]/export/mksysb/cg # loopmount -i AIX_v7.2_Base_Install_DVD_2_of_2_TL_7200-01-00_112016.iso -o "-V cdrfs -o ro" -m /mnt/v2 [root@nimmast]/export/mksysb/cg # df -g | grep mnt /dev/loop0 3.15 0.00 100% 1649161 100% /mnt/v1 /dev/loop1 3.88 0.00 100% 2035313 100% /mnt/v2
Using bffcreate I can copy the files into the desired location and create the .toc (table of contents) file.
# smitty bffcreate Copy Software to Hard Disk for Future Installation Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * INPUT device / directory for software /mnt/v1 * SOFTWARE package to copy [all] + * DIRECTORY for storing software package [/export/nim/lpp_source/AIX72TL1SP1] DIRECTORY for temporary storage during copying  EXTEND file systems if space needed? yes + Process multiple volumes? yes + Copy Software to Hard Disk for Future Installation Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * INPUT device / directory for software /mnt/v2 * SOFTWARE package to copy [all] + * DIRECTORY for storing software package [/export/nim/lpp_source/AIX72TL1SP1] DIRECTORY for temporary storage during copying  EXTEND file systems if space needed? yes + Process multiple volumes? yes +
Now I can create the AIX 7.2 lpp_source NIM resource.
[root@nimmast]/ # smit nim_mkres lpp_source = source device for optional product images Define a Resource Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Resource Name [AIX72TL1SP1] * Resource Type lpp_source * Server of Resource [master] + * Location of Resource [/export/nim/lpp_source/AIX72TL1SP1] / ... COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. 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. root@nimmast]/ # lsnim -t lpp_source | grep 72 AIX72TL1SP1 resources lpp_source [root@nimmast]/ # lsnim -l AIX72TL1SP1 AIX72TL1SP1: class = resources type = lpp_source arch = power Rstate = ready for use prev_state = unavailable for use location = /export/nim/lpp_source/AIX72TL1SP1 simages = yes alloc_count = 0 server = master [root@nimmast]/ # nim -o showres AIX72TL1SP1 | grep bos.mp64 bos.mp64 22.214.171.124 I b usr,root bos.mp64 126.96.36.199 S b usr,root [root@nimmast]/ # umount /mnt/v1 [root@nimmast]/ # umount /mnt/v2
The AIX 7.2 SPOT resource is created next.
[root@nimmast]/ # smit nim_mkres Define a Resource Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Resource Name [spotAIX72TL1SP1] * Resource Type spot * Server of Resource [master] + Source of Install Images [AIX72TL1SP1] + * Location of Resource [/export/nim/spot] / 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. ... [root@nimmast]/ # lsnim -t spot | grep 72 spotAIX72TL1SP1 resources spot [root@nimmast]/ # lsnim -l spotAIX72TL1SP1 spotAIX72TL1SP1: class = resources type = spot plat_defined = chrp arch = power bos_license = yes Rstate = ready for use prev_state = verification is being performed location = /export/nim/spot/spotAIX72TL1SP1/usr version = 7 release = 2 mod = 1 oslevel_r = 7200-01 oslevel_s = 7200-01-01-1642 alloc_count = 0 server = master if_supported = chrp.64 ent Rstate_result = success [root@nimmast]/ # nim -o showres spotAIX72TL1SP1 | grep bos.mp64 bos.mp64 188.8.131.52 A F Base Operating System 64-bit
If you’ve followed all the steps above, your NIM master has been migrated successfully to AIX 7.2 and it is ready to serve AIX 7.2 NIM resources to all your existing NIM clients. You can now start planning for the migration of your AIX systems (NIM clients) to AIX 7.2 using the NIM Alternate Disk Migration tool (nimadm).
Chris Gibson is an AIX and PowerVM specialist. He's an IBM Champion for Power Systems, IBM CATE and a technical editor.
See more by Chris Gibson