Operating System - HP-UX
1843290 Members
3494 Online
110214 Solutions
New Discussion

How can I tell if Alternate Link in vg is active?

 
ABC Unix
Frequent Advisor

How can I tell if Alternate Link in vg is active?

vgdisplay -v shows a path and an Alternate Path for each PV in the vg. If (someone else) has issued a pvchange -a n /dev/dsk/c?t?d? against the alternate path, disconnecting that path from being used, vgdisplay -v still shows the Alternate Path in its output. As I am doing a live SAN Migration, I would like to confirm all Alternate Paths are active before disconnecting the HBA. Is there a command I can use to determine this?
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: How can I tell if Alternate Link in vg is active?

Hi Linelle:

LVM (prior to 11.31) only uses a primary link (path) for I/O. Any secondary (or alternate) paths (pvlinks) are for use only when the primary fails.

Thus to verify the viability of an alternate link, you can 'pvchange -s' to immediately begin using the alternate link. This does not survive a reboot. That is, the original primary link resumes its status.

You could also demote the primary (with 'vgreduce') thus promoting the secondary to primary status. Of course, in this case, be sure to add ('vgextend') in the demoted primary link (which adds _it_ as a secondary.

It is the order of the paths in '/etc/lvmtab' that determines who is the "alpha" or primary. The first path of a device group is the primary; all others secondary.

Regards!

...JRF...

Re: How can I tell if Alternate Link in vg is active?

Linelle,

Doesn't

pvdisplay /dev/dsk/c?t?d?

show the path is "unavailable" after you run "pvchange -a n ..."

HTH

Duncan

I am an HPE Employee
Accept or Kudo
ABC Unix
Frequent Advisor

Re: How can I tell if Alternate Link in vg is active?

Let me clarify a bit. I don't want to force a switch to the alternate path. I have between 30 and 200 LUNS per server, and they are manually load balanced between 2 hbas. But before I migrate the HBA to a new switch (same fabric) I want to verify that if the process of swapping the cable and the HBA logging in to the new switch takes longer than the pvtimeout (30 seconds), that there will be a valid alternate path for the failover. IOSCAN tells me that the LUNS are seen on both paths. Both vgdisplay -v and pvdisplay both show the alternate links properly configured, even if the alternate path has been disabled with the pvchange -a n /dev/dsk/c?t?d?. I have found that issuing a vgchange -a y will recover the path, but I don't know if this is the best action to take. From the vgchange man page..." If the -a y or -a e option is executed on a currently active volume group, without the -x option, vgchange attempts to include any physical volumes that were previously listed as missing. This is useful if a physical volume has come back online."

Is there a command syntax to display what might be missing rather than issuing a vgchange -a y to each VG?

ux08# pvchange -a n /dev/dsk/c32t0d2
Warning: Detaching a physical volume reduces the availability of data
within the logical volumes residing on that disk.
Prior to detaching a physical volume or the last available path to it,
verify that there are alternate copies of the data
available on other disks in the volume group.
If necessary, use pvchange(1M) to reverse this operation.
Physical volume "/dev/dsk/c32t0d2" has been successfully changed.



ux08# pvdisplay /dev/dsk/c32t0d2
Device file path "/dev/dsk/c32t0d2" is an alternate path
to the Physical Volume. Using Primary Link "/dev/dsk/c30t0d2".
--- Physical volumes ---
PV Name /dev/dsk/c30t0d2
PV Name /dev/dsk/c32t0d2 Alternate Link
VG Name /dev/vg3411
PV Status available
Allocatable yes
VGDA 2
Cur LV 1
PE Size (Mbytes) 16
Total PE 3244
Free PE 0
Allocated PE 3244
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On

/ROOT_HOME
ux08# vgdisplay -v /dev/vg3411
--- Volume groups ---
VG Name /dev/vg3411
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 128
Cur PV 1
Act PV 1
Max PE per PV 10841
VGDA 2
PE Size (Mbytes) 16
Total PE 3244
Alloc PE 3244
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg3411/lvol1
LV Status available/syncd
LV Size (Mbytes) 51904
Current LE 3244
Allocated PE 3244
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c30t0d2
PV Name /dev/dsk/c32t0d2 Alternate Link
PV Status available
Total PE 3244
Free PE 0
Autoswitch On
Proactive Polling On


From syslog:


Jul 27 09:51:48 ux08 vmunix: LVM: VG 64 0x020000: Flushing the deferred attach list.
Jul 27 09:51:48 ux08 vmunix: LVM: VG 64 0x020000: PVLink 31 0x200200 Detached.
Jul 27 09:51:48 ux08 LVM[5901]: pvchange -a n /dev/dsk/c32t0d2


Jul 27 09:54:16 ux08 vmunix: LVM: VG 64 0x020000: PVLink 31 0x200200 Recovered.
Jul 27 09:54:16 ux08 LVM[6396]: vgchange -a y /dev/vg3411