1833875 Members
2201 Online
110063 Solutions
New Discussion

Re: pvlinks

 
Thomas Osborne
New Member

pvlinks

We have a HP9000 N-Class on 11.0 connected to an EMC Clariion 4700. The HP sees controller 1 with 4 devices and controller 2 with 4 devices (Each controller is seeing the same 4 devices). We have designated 2 devices on controller 1 as primary and the other 2 devices as primary on controller 2. Question is - How do we tell the O/S that the undesignated devices are the alternate paths to the designated devices?
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: pvlinks

Hi Thomas:

Use 'vgextend' to add the PV (alternate) links.

The example in the man page states this rather well:

/begin_quote/

Add a PV link to one of the physical volumes in the volume group. Where /dev/dsk/c0t4d0 and /dev/dsk/c1t4d0 refer to the same physical
volume (referenced via different controllers), and the volume group already contains /dev/dsk/c0t4d0. /dev/dsk/c0t4d0 remains the primary link (in use)and /dev/dsk/c1t4d0 becomes an alternate link.

# vgextend /dev/vg03 /dev/dsk/c1t4d0

/end_quote/

You can swap primary and alternate links by doing a 'vgreduce' of the the secondary link followed by a 'vgextend' of the original primary link. In this fashion, the secondary link becomes the (only) primary link, and then the 'vgextend' adds a secondary path that once was the primary.

Remember that pv-links (alternate paths) do *not* load balance in LVM configurations. Should the primary link fail, LVM switches access to the secondary to maintain a path to the physical volume.

Regards!

...JRF...
linuxfan
Honored Contributor

Re: pvlinks

Hi Thomas,


Let's say that your volume group (VG - /dev/vgshared) contains the c0t0d1 (primary) and c1t1d1(alternate) disks.
vgdisplay -v /dev/vgshared |grep "PV Name"
(shows)
PV Name /dev/dsk/c0t0d1
PV Name /dev/dsk/c1t1d1 Alternate Link

You would vgreduce c0t0d1 out

vgreduce /dev/vgshared /dev/dsk/c0t0d1

and allow its pvlink (alternate link) to become the primary mirror link.

Now vgdisplay -v /dev/vgshared |grep "PV Name"
(....)
PV Name /dev/dsk/c1t1d1


You would then vgextend c0t0d1 back in as the alternate link to the mirror.
vgextend /dev/vgshared /dev/dsk/c0t0d1

Now vgdisplay -v /dev/vgshared |grep "PV Name"
(...)
PV Name /dev/dsk/c1t1d1
PV Name /dev/dsk/c0t0d1 Alternate Link

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sanjay_6
Honored Contributor

Re: pvlinks

I think you just want to add the alternate link to the already existing primary path. Here is what i think you have to do.

for eg. your vg is /dev/vgshared
primary link is c0t0d1
say alt link is c1t1d1

you already see the pv path in vgdisplay -v /dev/vgshared
just do
vgextend /dev/vgshared /dev/dsk/c1t1d0
vgdisplay -v /dev/vgshared

This will show you the alternate link in the PV names. Remember don't do pvcreate on the alternate link.

Hope this helps.

Thanks
Sanjay
Sridhar Bhaskarla
Honored Contributor

Re: pvlinks

While the above procedure will set the paths permanent, you can try pvchange command to manually set the paths. However, it will fall back to the original if the channel fails or if the system restarts.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Tim D Fulford
Honored Contributor

Re: pvlinks

The guys above are have given the answer. I think a little explaination is in order though.

You do not need to specify if a disk is on an alternate path, LVM knows this! There is some reserved areas in the disk where LVM writes a some ID's. You create this area when you do pvcreate. If LVM sees two disk devices with the same ID's (say disk & volume group ID). It assumes they are the same disk and the second is an alternate link.

Taking this question the other way 'round this is why you do not need to pvcreate the alternate path disks as they have already been created when you pvcreate the original. In fact doing a pvcreate -f will DESTROY the original (if any data exists on it)!

Tim
-