====== AIX disk migration ======
Here is a procedure for migrating from old disks to new disks, with AIX Volume Manager only.
AIX is based on a integrated Logical Volume Manager. The OS is installed into a volume group: rootvg (required). Everything for the base OS is included into rootvg, no /boot like Linux.
**Migration must be done online**. Other volume group can exist on a server. Other Volume manager are supported for datas: GPFS, Oracle OCFS, Veritas Volume Manager...
A volume group is composed from 1 to 1016 disks or LUNs. To move datas on new disks, you can use raid 1, or migratepv command which moves the datas online from one disk to another.
Data and OS can be migrated from disks even if it's a different kind of disk (SCSI,SATA,SAS,FC ...), or size. You just need to have enough space to copy all the datas to the new disks.
==== Move a rootvg to new disks (if boot on SAN, or if you expect to change the disk type) ====
For a rootvg volume group, you must use mirroring. On AIX the volume group (VG) contains logical volumes (LV), with or without a mount point (filesystem). Swap and boot logical volumes doen't have a mount point. Mirroring is done per logical volume, and you can have up to 3 copies of an LV per VG.
* First step install the new drivers if needed.\\
Create a folder on the AIX server (Ex: # mkdir /tmp/mpio) and put the drivers into that directory
Install the drivers with:
[eco-aix61@root] /root> smitty installp
--> Install Software\\
In the field "Software Installation" select F4 (or ESC+4 in console), and select the components MPIO (select a minimum, the needed packages will be installed as requisite) with F7 (or ESC+7) and Enter. If needed in the filed "ACCEPT new license agreements?" select yes with TAB key:
Install Software
[Entry Fields]
* INPUT device / directory for software /tmp/mpio
* SOFTWARE to install [_all_latest]
PREVIEW only? (install operation will NOT occur) no
COMMIT software updates? yes
SAVE replaced files? no
AUTOMATICALLY install requisite software? yes
EXTEND file systems if space needed? yes
OVERWRITE same or newer versions? no
VERIFY install and check file sizes? no
Include corresponding LANGUAGE filesets? yes
DETAILED output? no
Process multiple volumes? yes
ACCEPT new license agreements? no
PREVIEW new LICENSE agreements? no
Drivers for IBM DS3k,4k,5k are included in the base operating system. For DS8k and SVC install SDDPCM. For EMC choose in the Powerpath the component MPIO...
* Create and map the new LUNs to the AIX server.\\
* Check for new hardware on the AIX server, with cfgmgr:\\
Before:
[eco-aix61@root] /root> lspv
hdisk0 005a4b0ab1c32955 rootvg active
hdisk1 005a4b1ab2ac8166 tsmvg active
hdisk2 005a2c7af5b4a34a stgvg active
After:
[eco-aix61@root] /root> cfgmgr
[eco-aix61@root] /root> lspv
hdisk0 005a4b0ab1c32955 rootvg active
hdisk1 005a4b1ab2ac8166 tsmvg active
hdisk2 005a2c7af5b4a34a stgvg active
hdisk3 none None
If a driver is missing, the server will say which package to install.\\
* Extend the Volume Group rootvg\\
[eco-aix61@root] /root> extendvg rootvg hdisk3
[eco-aix61@root] /root> lspv
hdisk0 005a4b0ab1c32955 rootvg active
hdisk1 005a4b1ab2ac8166 tsmvg active
hdisk2 005a2c7af5b4a34a stgvg active
hdisk3 005a2c1a818ef5ae rootvg active
* Mirror the Volume Group on the new disks\\
-S option to synchronize in the background
[eco-aix61@root] /root> mirrorvg -S rootvg hdisk3
* Recreate the boot logical volume on all disks that have the boot logical volume (hd5)\\
[eco-aix61@root] /root> lslv -l hd5
hd5:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk0 001:000:000 100% 001:000:000:000:000
hdisk3 001:000:000 100% 001:000:000:000:000
[eco-aix61@root] /root> bosboot -ad hdisk0
[eco-aix61@root] /root> bosboot -ad hdisk3
* Break the copy on old disks\\
Wait first the end of the synchronization before breaking the mirror, AIX won't leave you to break a not synchronized VG
[eco-aix61@root] /root> lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 005a2c1a00004c000000011c3265d620
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1084 (69376 megabytes)
MAX LVs: 256 FREE PPs: 150 (9600 megabytes)
LVs: 20 USED PPs: 934 (59776 megabytes)
OPEN LVs: 15 QUORUM: 1 (Disabled)
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 1 STALE PPs: 436
ACTIVE PVs: 2 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
If the parameter "STALE PPs" has a value 0, then break the mirror on the old disk:
[eco-aix61@root] /root> unmirrorvg rootvg hdisk0
* Recreate the boot logical volume and set the bootlist to be able to boot on new disks\\
[eco-aix61@root] /root> bosboot -ad hdisk3
[eco-aix61@root] /root> bootlist -m normal hdisk3
* Move LV if still exists from old disks to new (for example if you have dump devices which can't be mirrored)\\
[eco-aix61@root] /root> lspv -l hdisk0
hdisk0:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
lg_dumplv 16 16 00..16..00..00..00 N/A
[eco-aix61@root] /root> migratepv hdisk0 hdisk3
* Remove old disks from rootvg\\
[eco-aix61@root] /root> reducevg rootvg hdisk0
* Remove old disks from AIX server\\
[eco-aix61@root] /root> rmdev -dl hdisk0
* Remove the map on old disks
==== Move a data VG to new disks ====
First step install the new drivers if needed.\\
Create and map the new LUNs to the AIX server.\\
Extend the data Volume Group\\
Mirror the Volume Group on the new disks\\
Break the copy on old disks\\
Remove old disks from data VG\\
Remove old disks from AIX server\\
Remove the map on old disks
== ANNEXE ==
List disks available, and their VG:
[eco-aix61@root] /root> lspv
hdisk0 005a4b0ab1c32955 rootvg active
hdisk1 005a4b1ab2ac8166 tsmvg active
hdisk2 005a2c7af5b4a34a stgvg active
hdisk3 005a2c7a614de6f4 wparvg active
List all VG (with -o to list only active VG):
[eco-aix61@root] /root> lsvg
rootvg
tsmvg
stgvg
wparvg
List the content of a VG (if PPs are 2x LPs, then the LV is mirrored:
[eco-aix61@root] /root> lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 8 8 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A
hd4 jfs2 3 3 1 open/syncd /
hd2 jfs2 45 45 1 open/syncd /usr
hd9var jfs2 16 16 1 open/syncd /var
hd3 jfs2 17 17 1 open/syncd /tmp
hd1 jfs2 1 1 1 open/syncd /home
hd10opt jfs2 70 70 1 open/syncd /opt
hd11admin jfs2 2 2 1 open/syncd /admin
lg_dumplv sysdump 16 16 1 open/syncd N/A
rootlv jfs2 3 3 1 open/syncd /root
softlv jfs2 280 280 1 open/syncd /software
fslv00 jfs2 2 2 1 closed/syncd /wpars/wpar1
fslv01 jfs2 1 1 1 closed/syncd /wpars/wpar1/home
fslv02 jfs2 2 2 1 closed/syncd /wpars/wpar1/tmp
fslv03 jfs2 2 2 1 closed/syncd /wpars/wpar1/var
pconsolelv jfs2 3 3 1 open/syncd /pconsole
loglv01 jfslog 1 1 1 open/syncd N/A
lv00 jfs 1 1 1 open/syncd /var/epdm
List characteristics of a VG (size used,total size...)
[eco-aix61@root] /root> lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 005a2c1a00004c000000011c3265d620
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 542 (34688 megabytes)
MAX LVs: 256 FREE PPs: 67 (4288 megabytes)
LVs: 20 USED PPs: 475 (30400 megabytes)
OPEN LVs: 15 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
List physical disks and type:
[eco-aix61@root] /root> lsdev -Cc disk
hdisk0 Available 1S-08-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 1S-08-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk2 Available 1S-08-00-10,0 16 Bit LVD SCSI Disk Drive
hdisk3 Available 1S-08-00-11,0 16 Bit LVD SCSI Disk Drive
List the characterics of a disk, serial number...:
[eco-aix61@root] /root> lscfg -vpl hdisk0
hdisk0 U0.1-P2/Z1-A8 16 Bit LVD SCSI Disk Drive (36400 MB)
Manufacturer................IBM
Machine Type and Model......IC35L036UCDY10-0
FRU Number..................00P3831
ROS Level and ID............53323847
Serial Number...............E3VN67AC
EC Level....................H32224
Part Number.................08K0293
Device Specific.(Z0)........000003029F00013A
Device Specific.(Z1)........07N4972
Device Specific.(Z2)........0068
Device Specific.(Z3)........03119
Device Specific.(Z4)........0001
Device Specific.(Z5)........22
Device Specific.(Z6)........
PLATFORM SPECIFIC
Name: sd
Node: sd
Device Type: block