1834457 Members
2996 Online
110067 Solutions
New Discussion

Re: PV Alternate path

 
Jose Vidal
Advisor

PV Alternate path

When creating an alternate path to a PV, is there any difference between the following methods?

1) vgextend vg10 /dev/dsk/c5t4d0

or

2) vgimport -m mapfile -s -v vg10

assuming c4t4d0 and c5t4d0 are alternate paths to the same disk and vg10 currently has c4t4d0 as it's primary path, will the above methods achieve the same results?
9 REPLIES 9
Kofi ARTHIABAH
Honored Contributor

Re: PV Alternate path

Only the first method will work. The second would fail because because it would try and read the lvm information from the map file and impose it on vg10... which will fail since vg10 is already defined on the system.

your only bet is:

vgextend vg10 /dev/dsk/c5t4d0

man on vgextend and vgimport identifies the difference.
nothing wrong with me that a few lines of code cannot fix!
rajsri
Frequent Advisor

Re: PV Alternate path

As u said 1'st step would create alternatelink successfully ,but not second one .

raj
Denver Osborn
Honored Contributor

Re: PV Alternate path

The second method should work. that's assuming you meant vgexport it first then run vgimport -s -v -m map.file /dev/vg_name, this should also add the pvlink. Although it's much easier to just to do the vgextend to add the pv link, unless you had a large number of pv's in the vg and were looking for a shortcut - then the vgexport/vgimport might save some time.
Jose Vidal
Advisor

Re: PV Alternate path

I've already tried method #2 and it worked, I just wanted to know if the end result was identical, from the point of view of having an alternate path to a disk.
And yes, I did do a vexport -s first.

The reason I asked, is because I wanted to test the automatic switch to the alternate path, by disabling the primary path (removed controller cable), but it didn't switch.
And yes, "autoswitch" is on, and the cable was out for longer than the "IO timeout".

Thomas Yake
Occasional Advisor

Re: PV Alternate path

I set up a little script to generate my commands after going in to STM and verifying the serialnumbers of my Model 30 arrays:

#!/bin/ksh


INDEX=1
NUMBA=0
while [ $INDEX -le 9 ] ;
do
VG="vg0$INDEX"
banner " "
banner $VG
vgdisplay -v $VG > $VG.vgdv
for PV in `cat $VG.vgdv | grep "PV Name" | awk '{print $3}' `
do
ALT=`echo $PV | sed "s/c7t/c6t/" `
echo "vgextend $VG $ALT"
## NUMBA=`echo $PV | cut -c 15`
NUMBA=$(( $NUMBA + 1 ))
ODD=$(( $NUMBA % 2 ))
if [ $ODD -eq 1 ] ; then
echo " #### $ALT will become the primary link ### "
echo "vgreduce $VG $PV"
echo "vgrextend $VG $PV"
else
echo " #### $PV will remain the primary link ### "


fi

echo ""
done
INDEX=$((INDEX+1))
done
Sanjay_6
Honored Contributor

Re: PV Alternate path

Hi Jose,

The first method will work. That is the process to add an alternate path to the disk. The second method is used while exporting and importing completer vg information between systems or changing the vg name from old to new.

say the old vg name is vg_old and the new name you want to be is vg_new, then you export the old vg "vg_old" and create the new group file for vg_new and import the vg_old map file to vg_new.

Hope this helps.

Regds
Darrell Allen
Honored Contributor

Re: PV Alternate path

Hi Jose,

If you vgexport then vgimport using the -s arg, you will get a primary and an alternate link. I believe you will find that the system may or may not set the primary link to the one you want nor to the one it formerly was.

I'm really not sure how the system picks the primary path but I do know that's not acceptable for me. I need to specify the primary path in order to do "poor man's" load balancing.

Hence, I always use the vgextend method.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Brian M Rawlings
Honored Contributor

Re: PV Alternate path

The second method will not reliably pick the same primary path. From the 'vgimport' man page:
=============================
The following warnings should only apply to the -s option when importing devices such as (NIKE) or disks with alternate path:
Since the -s option causes a search on the system for each disks with the same vg_id. When vgimport reconstruct the newly imported volume group entry in /etc/lvmtab file, the order of disks could be different than it was before. And the following will happen:

The designated primary and alternate link might not be the same as it was configured before.
Alternate links will be added to the importing volume group even if they might not be configured in the volume group initially.

If the original primary path of a disks become an alternate path after the newly imported volume group entry is created in /etc/lvmtab, the order can be easily reverted by using vgreduce to remove the primary path and then use vgextend to add the path back again.
=============================

This should be the only difference between the two procedures, both would work, but only by using 'vgextend' could you control the allocation of primary and secondary links.

Since controlling this is a very desirable thing, to create at least a poor man's load balancing across the I/O channels, I would recommend using vgextend in all cases for this function.

Best Regards,

--bmr
We must indeed all hang together, or, most assuredly, we shall all hang separately. (Benjamin Franklin)
Darrell Allen
Honored Contributor

Re: PV Alternate path

Nice add-on Brian! I appreciate your added info, especially with the excerpt from the man page.

And Brian, welcome to the forums. With replies like that, you'll be "royal" before you know it (and I see you're already well on the way after just 1 week's participation).

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)