When nimadm Alone Won’t Do, mksysb Can Help
By using a combination of nimadm, alt_disk_mksysb and SSH, we were able to successfully migrate our DMZ system to the latest AIX version.
By Chris Gibson03/14/2013
I was recently asked to provide a method for migrating from AIX version 6.1 to 7.1. Several NIM masters managed the AIX environment.
“Easy,” I said. “Use nimadm!” That’s my standard answer to this type of question. But this time NIM Alternate Disk Migration (nimadm) alone wasn’t going to cut it, because the AIX system wasn’t a NIM client. It was isolated from the rest of the network inside a demilitarized zone (DMZ). Firewall rules prevented almost all traffic to and from the server in the internal network. However, SSH traffic was allowed. We could SSH to the server from the internal network and (more importantly) from our NIM master. This gave me an idea:
- Take an mksysb backup of the DMZ AIX LPAR to a local filesystem.
- Copy the 6.1 mksysb file to the NIM master using Secure Copy Protocol (SCP).
- Use nimadm to migrate the mksysb image from AIX 6.1 to 7.1.
- Copy the 7.1 mksysb file back to a local filesystem on the AIX DMZ system using SCP.
- Use alt_disk_mksysb to populate a spare disk on the system with the upgraded 7.1 mksysb image.
- Reboot the AIX DMZ system on the cloned disk.
- Celebrate another successful AIX 7.1 migration!
The AIX system to be migrated was running AIX 6.1 TL7 SP5. There were two storage area network (SAN) disks attached to this system—one for rootvg (hdisk0) and a spare for the cloned copy of rootvg (hdisk1).
aixdmz1# oslevel -s 6100-07-05-1228 aixdmz1# lsdev -Cc disk hdisk0 Available 20-T1-01 Hitachi MPIO Disk VSP (Fibre) hdisk1 Available 20-T1-01 Hitachi MPIO Disk VSP (Fibre) aixdmz1# lspv hdisk0 00c342c6389e7ba6 rootvg active hdisk1 00c342c667865ad0 None
We discovered a very important piece of information in the alt_disk_mksysb command man page:
“The version release maintenance or technology level of mksysb that you are installing must match the level of the bos.alt_disk_install.boot_images fileset. For example, if the oslevel on the source system (the system where the mksysb was created) returns 22.214.171.124, the bos.alt_disk_install.boot_images fileset must be at 5.3.0.X, where X is the highest available fix level.”
So prior to starting this process, we installed the AIX 7.1 bos.alt_disk_install.boot_images fileset on the system to be migrated. If this fileset isn’t installed, the following error message will be returned by the alt_disk_mksysb command.
/usr/bin/lslpp: Fileset bos.alt_disk_install.boot_images not installed. 0505-143 alt_disk_install: Unable to match mksysb level 7.1.0 with any available boot images. Please correct this problem and re-execute phase 3 or run "alt_disk_install -X" to clean up.
If the level of the fileset does match the level of the mksysb to be installed, then the following message should be reported:
0505-143 alt_disk_install: Unable to match mksysb level 7.1.0 with any available boot images. Please correct this problem and re-execute phase 3 or run "alt_disk_install -X" to clean up.
We also installed the AIX 7.1 bos.alt_disk_install.rte fileset for good measure, as we had encountered migration issues in the past with back-level alt_disk filesets.
aixdmz1# lslpp -l bos.alt_disk_install.boot_images Fileset Level State Description ---------------------------------------------------------------------------- Path: /usr/lib/objrepos bos.alt_disk_install.boot_images 126.96.36.199 COMMITTED Alternate Disk Installation Disk Boot Images aixdmz1# lslpp -l bos.alt_disk_install.rte Fileset Level State Description ---------------------------------------------------------------------------- Path: /usr/lib/objrepos bos.alt_disk_install.rte 188.8.131.52 COMMITTED Alternate Disk Installation Runtime
Next we created a new mksysb image of the system to a local filesystem.
aixdmz1# mksysb -i /datafs/aixdmz1-61mksysb
The mksysb image was “scp-ed” (copied via SSH) to the NIM master.
nimmast# scp –p aixdmz1:/datafs/aixdmz1-61mksysb /export/images
A new NIM mksysb resource was created for the AIX 6.1 mksysb image.
nimmast# lsnim -t mksysb | grep dmz aixdmz1_61_mksysb resources mksysb
To migrate the mksysb image we called the nimadm utility. The NIM master was running AIX 7.1 TL2 SP1.
nimmast# nimadm -i aixdmz1-image-data -T aixdmz1_61_mksysb -O /export/images/aixdmz1-71mksysb -s spotaix710201 -l lpp_sourceaix710201 -j nimadmvg -Y -N aixdmz1-71mksysb
The flags indicate the following to the nimadm command:
- -T specifies the existing AIX 6.1 NIM mksysb resource.
- -O specifies the output location for the migrated mksysb resource.
- -s indicates the AIX 7.1 NIM SPOT resource for the migration.
- -l indicates the AIX 7.1 NIM lpp_source resource for the migration.
- -j identifies the volume group that will be used on the NIM master to create file systems.
- -Y Agrees to required software license agreements for software to be installed.
- -N specifies the name of the new AIX 7.1 NIM mksysb resource to be created after migration.
- -i Specifies the image_data NIM resource. This resource is used by the alt_disk_install command.
Note that we specified the –i flag to the nimadm operation. This specifies a custom image.data file for use during the migration. We needed to include this flag in order to work around the issue identified in APAR IV36510 ("Running NIMADM with caching might fail with error fshop_make: 0506-278 Big File file systems must have fragsize == 4096. Use a customize image.data with NIMADM and use fragsize of 4096.")
Once the migration completed, I found a new 7.1 mksysb file in /export/images (as expected). The file was named aixdmz1-71mksysb, and a new NIM mksysb resource was now available.
nimmast# ls -l /export/images/aixdmz1-71mksysb -rw-r--r-- 1 root system 2143129600 Feb 14 14:24 /export/images/aixdmz1-71mksysb nimmast# lsnim -t mksysb | grep dmz aixdmz1_61_mksysb resources mksysb aixdmz1-71mksysb resources mksysb nimmast# lsnim -l aixdmz1-71mksysb aixdmz1-71mksysb: class = resources type = mksysb comments = Created by nimadm on Thu Feb 14 14:25:00 EETDT 2013 Rstate = ready for use prev_state = unavailable for use location = /export/images/aixdmz1-71mksysb version = 7 release = 1 mod = 0 oslevel_r = 7100-02 alloc_count = 0 server = master creation_date = Thu Feb 14 14:25:02 2013
The 7.1 mksysb file was then copied back to the AIX host to a local filesystem using scp.
nimmast# scp -p aixdmz1-71mksysb aixdmz1nim:/datafs/
The alt_disk_mksysb command was called next, to populate the spare disk with the contents of the 7.1 mksysb image.
aixdmz1# alt_disk_mksysb -m /datafs/aixdmz1-71mksysb -d hdisk1 -k Restoring /image.data from mksysb image. Checking disk sizes. Creating cloned rootvg volume group and associated logical volumes. Creating logical volume alt_hd5. etc… Restoring mksysb image to alternate disk(s). Linking to 64bit kernel. Changing logical volume names in volume group descriptor area. Fixing LV control blocks... forced unmount of /alt_inst/var/tsm/log etc… Fixing file system superblocks... Bootlist is set to the boot disk: hdisk1 blv=hd5
The flags indicate the following to the alt_disk_mksysb command:
- -m is the path name to the mksysb image file.
- -k specifies that mksysb devices be kept (formally, the ALT_KEEP_MDEV variable). This forces alt_disk_mksysb to retain user-defined device configuration.
- -d targets disk(s) where the alternate rootvg is created.
The boot list was automatically changed (by nimadm) to point to the cloned rootvg disk (hdisk1). All that’s left to do is reboot the system.
aixdmz1# bootlist -m normal -o hdisk1 blv=hd5 pathid=0 hdisk1 blv=hd5 pathid=1 aixdmz1# lspv hdisk0 00c342c6389e7ba6 rootvg active hdisk1 00c342c667865ad0 altinst_rootvg aixdmz1# shutdown –Fr
Upon rebooting the LPAR, we ran the oslevel command to confirm the system was now running AIX 7.1.
aixdmz1# oslevel -s 7100-02-01-1245
By using a combination of nimadm, alt_disk_mksysb and SSH, we’re able to migrate our DMZ system to the latest version of AIX. Admittedly we needed to perform several steps to achieve this goal, however, it satisfied the imposed security requirements and resulted in a successful outcome.
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