SAN Migrations

Assume the your diskgroup name is “lin” and volume name is lvol0(Mirrored) and /dev/sdb & /dev/sdc coming  from same storage.

[root@hans-karri ~]# pvs -a -o +devices
PV VG Fmt Attr PSize PFree Devices
/dev/sda2 vg_hans-karri lvm2 a- 19.51g 0 /dev/sda2(0)
/dev/sda2 vg_hans-karri lvm2 a- 19.51g 0 /dev/sda2(4234)
/dev/sdb lin lvm2 a- 508.00m 508.00m
/dev/sdc lin lvm2 a- 508.00m 508.00m
/dev/sdd lin lvm2 a- 508.00m 508.00m
/dev/sde lvm2 a- 512.00m 512.00m
[root@hans-karri ~]# vgs
VG #PV #LV #SN Attr VSize VFree
lin 3 0 0 wz--n- 1.49g 1.49g
vg_hans-karri 1 2 0 wz--n- 19.51g 0

Assume lvol0 is mirrored and this volume used sdb & sdc from old SAN box.

[root@hans-karri ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
lvol0 lin mwi-a- 52.00m 100.00 lvol0_mimage_0(0),lvol0_mimage_1(0)
[lvol0_mimage_0] lin iwi-ao 52.00m /dev/sdb(0)
[lvol0_mimage_1] lin iwi-ao 52.00m /dev/sdc(0)
lv_root vg_hans-karri -wi-ao 16.54g /dev/sda2(0)
lv_swap vg_hans-karri -wi-ao 2.97g /dev/sda2(4234)

Here I am removing one lun which is coming from old storage as removing /dev/sdb. Assume Device:/dev/sdd from new storage.

[root@hans-karri ~]# lvconvert -m0 --mirrorlog core /dev/lin/lvol0 /dev/sdb

Logical volume lvol0 converted.

[root@hans-karri ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
lvol0 lin -wi-a- 52.00m /dev/sdc(0)
lv_root vg_hans-karri -wi-ao 16.54g /dev/sda2(0)
lv_swap vg_hans-karri -wi-ao 2.97g /dev/sda2(4234)

Here i am mirroring volume with new LUN which is coming from new SAN.

[root@hans-karri ~]# lvconvert -m1 --mirrorlog core /dev/lin/lvol0 /dev/sdd
lin/lvol0: Converted: 100.0%

[root@hans-karri ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
lvol0 lin mwi-a- 52.00m 100.00 lvol0_mimage_0(0),lvol0_mimage_1(0)
[lvol0_mimage_0] lin iwi-ao 52.00m /dev/sdc(0)----------------------------> Now we can remove this one.
[lvol0_mimage_1] lin iwi-ao 52.00m /dev/sdd(0)
lv_root vg_hans-karri -wi-ao 16.54g /dev/sda2(0)
lv_swap vg_hans-karri -wi-ao 2.97g /dev/sda2(4234)

Now we can remove the LUN which is coming from old SAN as removing /dev/sdc.

[root@hans-karri ~]# lvconvert -m0 --mirrorlog core /dev/lin/lvol0 /dev/sdc

Logical volume lvol0 converted.

[root@hans-karri ~]# lvs -a -o +devices
LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices
lvol0 lin -wi-a- 52.00m /dev/sdd(0)
lv_root vg_hans-karri -wi-ao 16.54g /dev/sda2(0)
lv_swap vg_hans-karri -wi-ao 2.97g /dev/sda2(4234)

Now your volume is completely migrated to new SAN.You may think this some what lengthy process but very safe. Repeat the same for other volumes.