Operating System - HP-UX
1822741 Members
3966 Online
109645 Solutions
New Discussion юеВ

SAN Migration LVM Mirroring...

 
SOLVED
Go to solution
jmckinzie
Super Advisor

SAN Migration LVM Mirroring...

Ok,

I have a host that has two HBA cards...one, connected to the old storage area network and on connected to the new.

I want to create a mirror that is strict, between the two to move the data over.

Upon completion of the mirror, I want the users to actually be using the new SAN data vice using the old SAN data although, the old will stil lbe attached.

I have attached a copy on my ioscan to help.

11 REPLIES 11
IT_2007
Honored Contributor
Solution

Re: SAN Migration LVM Mirroring...

You need to have these things in place if you want to mirror SAN data

1. Same LUN size preferred - old and new
2. Good Bandwidth between two SANs

Don't know why you want to do mirror. If your logical volumes on SAN data is huge then it is not advisable since it will take many hours to complete and you can't run in parallel mirroring for multiple logical volumes.

If you still prefer then do same as vg00 mirroring. But you won't be able to mirror raw logical volumes.
jmckinzie
Super Advisor

Re: SAN Migration LVM Mirroring...

We have the SAme LUN size and we cann copy 100GB per hour accross the path so, we look good there.

I am unsure where to start...
I need to create the strict mirror but, don't I have to create the pv and vg first?

Please help...
Kevin Wright
Honored Contributor

Re: SAN Migration LVM Mirroring...

certainly. ioscan, insf, pvcreate, vgextend, lvextend -m 1 lvol

Rita C Workman
Honored Contributor

Re: SAN Migration LVM Mirroring...

You may find the following thread helpful :

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51818

Kindest regards,
Rita
IT_2007
Honored Contributor

Re: SAN Migration LVM Mirroring...

yes you need to do the following things.

1. ioscan -fn;insf -e
2. Identify new LUN's with device name.
3. pvcreate /dev/rdsk/cXXtYYdZZ
4. vgextend /dev/vgAA
5. lvextend -m 1 /dev/vgAA/lvol1

You have to run only one lvextend command per logical volume and need to wait till it gets completed.
sathish kannan
Valued Contributor

Re: SAN Migration LVM Mirroring...

Jody,

Since you are running an EMC Array, have you consioder using SRDF to replicate the data to the second Symm.

Regards
Sathish
Don't Think too much
Ninad_1
Honored Contributor

Re: SAN Migration LVM Mirroring...

Hi,

Here are few different suggestions you can follow

Create a file /etc/lvmpvg if it does not already exist, else use the existing file and add entries for the VGs you want to mirror the LVs of using strict allocation policy for PVs. do a man lvmpvg to see the format of the file or sample is provided below

VG /dev/vg00
PVG VG00P
/dev/dsk/c100t8d0
/dev/dsk/c100t9d0
PVG VG00M
/dev/dsk/c101t8d0
/dev/dsk/c101t9d0

Now similar to above file add entry for say vg01 you may be having with 2 disks currently in the existing SAN.

VG /dev/vg01
PVG VG01P
/dev/dsk/c100t8d0
/dev/dsk/c100t9d0

Now after making the disks in new SAN visible to this server and doing ioscan and insf -e as people have mentioned, do a vgextend -g VG01M /dev/vg01 /dev/... ...

Thus adding the disks to vg01 and creating a PVG called VG01M (for mirror), thus all the disks will be added under this PVG group.
Now do a lvextend -m 1 /dev/vg01/lvol1 VG01M
this will create mirror of the lvol1 into disks in PVG VG01M thus on the new SAN.

Later you can reduce the mirror
lvreduce -m 0 olddisk1 olddisk2
give the disk names from old SAN.


Regards,
Ninad
KapilRaj
Honored Contributor

Re: SAN Migration LVM Mirroring...

If I have list of old disks in /tmp/old_disks in "disk VG" format. And new SAN disks in /tmp/list/new_disks in "disk" format, I would ..

count=1
for old_disk in `cat /tmp/old_disks|cut -f1 -d " "`
do
new_disk=`head -${count} /tmp/new_disks|tail -1`
vg_name=`grep -w ${old_disk} /tmp/old_disks|cut -f2 -d " "`
vgextend ${vg_name} ${newdisk}
pvmove ${old_disk} ${new_disk}
[ $? -eq 0 ] && vgreduce ${vg_name} ${old_disk}
count=`echo "${count} + 1"|bc `
done

Note: Not a tested version .. syntax errors may be there.. Logic looks correct.
Nothing is impossible
Tim Nelson
Honored Contributor

Re: SAN Migration LVM Mirroring...

Did the exact same thing to migrate from on array to another.

add the new storage, configure vgs, mirror the lvols, reduce the old, move/rezone the old path to the new.

Works great, fast, error free.

Depending on the number of lvols I wrote scripts to speed up and reduce error.

Best of luck.

Sp4admin
Trusted Contributor

Re: SAN Migration LVM Mirroring...

Hi Jody,
Look like you have a lot of replies to your question. You can use a "for in I loop" to creste the mirrord.

#for lvol in lvol1 lvol2 ...lvol8 (soecify any LV syou need mirrot)
> do
>lvextend -m 1 /dev/vg00/$lvol /dev/dsk/c#t#d#
>done


sp,
jmckinzie
Super Advisor

Re: SAN Migration LVM Mirroring...

I used a variety of methods here to figure out the solution.