Using the AIX command alt_disk_copy in a fixlet

(imported topic written by SystemAdmin)

I’m working on a fixlet that will perform a alt_disk_copy of AIX to a new disk and apply a new TL/SP level of AIX. It prompts for the target disk and performes the disk copy,patching and post work on the target disk, all while the system continues to run. My questions are with the use of the special chroot commad to get a shell to the woke up target disk to perform some work on that disk, then put it back to sleep.

Also, because of prompting for an hdiskXX, this fixlet can only be performed on a single entpoint at a time due to the target hdiskXX. I can think of ways around this, but that’s another customization I will need to do. The main reason for this post is the TEM interaction with the “alt_rootvg_op and chroot” commands

Here’s the fixlet so far…

action parameter query “hdisk” with description “Enter hdiskXX to use for alternate rootvg”

// Prepare updatessh script to run on altinst_rootvg

createfile until __EOF

#!/bin/sh

sysdumpdev -t fw-assisted

/usr/bin/rmitab xmdaily

rm /usr/bin/perl

/usr/bin/ln -s …/…/opt/SNIperl/bin/perl5.12.3 /usr/bin/perl

chdev -l sys0 -a maxuproc=16384

__EOF

move __createfile /var/tmp/updates.sh

wait chmod +x /var/tmp/updates.sh

// Mount NIM CBCibmadmin for lpp_source_6_1_TL07_SP04

wait sh -c “/usr/sbin/mount cbcibmadmin:/export/nim/lpp_source/lpp_source_6_1_TL07_SP04 /mnt”

delete /var/adm/ras/install_all_updates.log

// Install the update

wait sh -c “/usr/sbin/alt_disk_copy -d {parameter “hdisk” of action} -b update_all -I acgXY -l /mnt/installp/ppc”

// Wake up the disk for other operations

wait sh -c "alt_rootvg_op -W -d {parameter “hdisk” of action}

// Perform some updates to new disk

wait sh -c “chroot /alt_inst /usr/bin/ksh; /var/tmp/updates.sh; exit”

// put to sleep

wait sh -c “alt_rootvg_op -S altinst_rootvg”

// Unmount NFS mount to NIM server

wait sh -c “umount -f /mnt”