Operating System - HP-UX
1753962 Members
7401 Online
108811 Solutions
New Discussion юеВ

Re: Replicating VG configuration between two nodes

 
SOLVED
Go to solution
Scott Ransted
Occasional Contributor

Replicating VG configuration between two nodes

I have a two node ServiceGuard cluster that I created a VG on node A
with primary/alternate links and a specific order that I want the disks:

c8t0d0 Path A
c8t0d1 Path A
c9t0d2 Path B
c9t0d3 Path B
c8t0d4 Path A
c8t0d5 Path A
c9t0d6 Path B
c9t0d7 Path B

Everything is perfect on node A. When I vgexport/vgimport the VG onto
node B, it changes the all of the disks to path A (with path B as alt).

I would like to get the exact balance that I have on node A on node B, but
when I do a pvchange -s /dev/dsk/cxxxx it keeps dropping that disk to the
bottom of the vgdisplay output. So, I can get 4 paths on path A, and 4
disks on path B, but not in the order that they were originally setup.

The specific commands that I'm using are:

node A; vgexport -p -s -m /tmp/vgxx.map /dev/vgxx (copy over to node B)
node B; vgimport -s -m /tmp/vgxx.map /dev/vgxx

Is there any way to precisely replicate the VG configuration from node A to
node B ??
7 REPLIES 7
Devesh Pant_1
Esteemed Contributor

Re: Replicating VG configuration between two nodes

Scott,
by "it keeps dropping that disk to the
bottom of the vgdisplay output. So, I can get 4 paths on path A, and 4
disks on path B, but not in the order that they were originally setup"
I hope you mean the disks become alternate links

Could you post the output of vgdisplay -v vgname

thanks
DP
Sudeesh
Respected Contributor

Re: Replicating VG configuration between two nodes

Hi Scott,
I am not aware of any command to achive it during vgimport. pvchange can do this with -s option but not permenant through a VG activation/deactivation. If you want to make a particular path primary permanently across VG activation/deactivation(including system rebbot) you have to change the order in which the paths are listed in /etc/lvmtab. The first path listed will come as primary.

Sudeesh

The most predictable thing in life is its unpredictability
Sudeesh
Respected Contributor

Re: Replicating VG configuration between two nodes

If your current lvmtab is

vg00
/dev/dsk/c0t6d0
vg01
/dev/dsk/c1t1d0
/dev/dsk/c2t1d0
vg02
/dev/dsk/c1t3d0
/dev/dsk/c2t3d0

and if c2 is alternate path, in this case c1 will be primary always. Do the following to make c2 as the primary for vg02.

#vgreduce vg02 /dev/dsk/c1t3d0
#vgextend vg02 /dev/dsk/c1t3d0

lvmtab entry for vg02 should look

vg02
/dev/dsk/c2t3d0
/dev/dsk/c1t3d0


Sudeesh
vgreduce
The most predictable thing in life is its unpredictability
melvyn burnard
Honored Contributor
Solution

Re: Replicating VG configuration between two nodes

The reason it does this is because when specifying th e-s (shared) option and using teh mapfile, it scans the interfaces in the order it finds them, and adds the correct pv's from that interface, then moves to the next interface etc.

he one way to get them in the correct order is to import the VG while specifying each PV in th eorder you wish to have them added.
Read the man page you will see it is in the syntax of:
vgimport {other options} vgname pv_path pv_path .....


Failing that, if the vg is already imported, simply reduce the VG by the one pv, then vgextend it again
man vgreduce and vgextend
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
vinod_25
Valued Contributor

Re: Replicating VG configuration between two nodes

hi scott

check this....doc which has the procedure for changing instance numbers of controllers... before setting up an mc sg cluster...

good luck

Vinod K
Thayanidhi
Honored Contributor

Re: Replicating VG configuration between two nodes

Hi,
As long as all the pv paths are in vgdisplay (either current or alternate) why you are worried? It doesn't matter.
This is the feature of LVM to switch to the better path.
If you don't want his to happen you could do by pvchange command (see mana page).

pvchange -S n will disable the autoswitching of the PV. Repeat this command for all PV paths.
Then do a pvchange -s which path you want it to be primary path.
Unless you do "-S n" -s won't keep the Pv path stable, it may switch back as you mentioned.
There is difference between alternate path and auto switching.
When autoswitching is off (-S n) PV path will change to alternate only incase the current path is inaccesible.
When autoswitching is on (-S y) PV path will change to alternate at any time for performance reasons and also if the current path is inaccesible.

Regds
TT
I use this switches (-S, -s) for testing the all the PV paths to a VG instead pulling the cables.



Attitude (not aptitude) determines altitude.
Scott Ransted
Occasional Contributor

Re: Replicating VG configuration between two nodes

Melvyn's suggestion worked for me. I did the following and got the correct order that I wanted.

node A; vgexport -p -s -m /tmp/vgxx.map /dev/vgxx (copy over to node B)

node B; vgimport -m /tmp/vgxx.map -f /tmp/vgxx.input /dev/vgxx

the /tmp/vgxx.input file has the specific order that I want the devices in.

Thanks, to all!