29 May 2012

AIX Clone

Many people will already know how to do this, since there's some (huge) machines you need lots of AIX Virtual Servers, and of course, you'll not make thousands of installs (will you?).




So a clone is the best option, you have two ways to do that:

1) alt_disk_install (recommended and supported)
2) VG Clone (only recommended to clone your vg, not supported, but works if alt_disk_install fails).

First method: alt_disk_install



Verify if you have all needed packages
# lslpp -l |grep bos.alt
Verify if all LVs have a copy in hdisk0
# for i in `lsvg -l rootvg |cut -f1 -d" "|grep -v rootvg|grep -v LV`; do lslv -l $i; done
Broke the mirror (if you have one)
# unmirrorvg rootvg hdisk1
# reducevg rootvg hdisk1
Turn off the Quorum
# chvg -a'y' -Q'n' rootvg
Set the bootlist
# bootlist -m normal -o hdisk0
Recreate the boot image
# bosboot -ad hdisk0
Verify
# lspv
Clone
# alt_disk_install -COB hdisk#
Verify the altinst_rootvg and remove the clone (you don't need to do that, but double check it)
# lspv
# rmdev -Rdl hdisk#
# exportvg altinst_rootvg
Mirror your vg again
# extendvg rootvg hdisk1
# mirrorvg -m rootvg hdisk1
# bosboot -a
# bootlist -m normal hdisk0 hdisk1 

Second method: VG Clone

Broke the mirror (if you have one)
# unmirrorvg rootvg hdisk1
Turn off the Quorum
# chvg -a'y' -Q'n' rootvg
Set the bootlist
# bootlist -m normal -o hdisk0
Recreate the boot image
# bosboot -ad hdisk0
Verify
# lspv
Clone
# extendvg rootvg hdisk#
# mirrorvg -m rootvg hdisk#
# bosboot -a
# bootlist -m normal hdisk0 hdisk#

Remove the second disk from VG, I mean the device (yes, do it)
# rmdev -Rdl hdisk#
Now remove it from vg
# unmirrorvg rootvg hdisk#
# reducevg rootvg hdisk#
Remove physically the disk from the Virtual Server or the machine and redetect the device drivers
# cfgmgr
Recreate the rootvg mirror
# extendvg rootvg hdisk1
# mirrorvg -m rootvg hdisk1
# bosboot -a
# bootlist -m normal hdisk0 hdisk1 

No comments:

Post a Comment