Operating System - OpenVMS
1834925 Members
2420 Online
110071 Solutions
New Discussion

Detecting devices in Mount Verify Timeout from DCL

 
SOLVED
Go to solution
Robert_Boyd
Respected Contributor

Detecting devices in Mount Verify Timeout from DCL

I would like to enhance some DCL procedures to detect that certain disks have landed in mount verify timeout when a cluster node is rebooting.

I'm not sure where this information is available. There doesn't seem to be an item code for F$GETDVI that will return T/F for this condition.

It would also be nice to have an item code for determining that a device has entered mount verification.

Is there a bit/field in the device dependent characteristics that has this info?

I dug around in the I/O manual some but it's not jumping out at me. Where should I be looking? I'm sure that it's in the system data structures in the volume control block. I just want to know how to get it from DCL without having to search the output of the SHOW DEVICE command.

Thanks for any feedback,

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
11 REPLIES 11
Hein van den Heuvel
Honored Contributor
Solution

Re: Detecting devices in Mount Verify Timeout from DCL

When searching the system service ref manual for "Mount verification" it is found under $GETDVI as:

UCB$V_MNTVERIP : Mount verification is in progress.

This is under DVI$_STS for which the bits are indicated to be defined in $UCBDEF.


$ pipe libr /extr=$ucbdef/out=sys$output sys$library:lib.mlb | search sys$pipe MNTVER
$EQU UCB$M_MNTVERIP <^X4000>
$EQU UCB$V_MNTVERIP 14

$ sts = f$getdvi("sys$disk","sts")
$ show symb sts
STS = 134350864 Hex = 08020810

So you can use STS.AND.%x4000 or extract bit # 14


Cheers,
Hein.


Robert_Boyd
Respected Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

Whoohoo! Thanks Hein!

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

This still leaves the question of detecting a mount verify TIMEOUT ... so far I'm not finding the right combination of search parameters to pop up where that status can be gotten.
Master you were right about 1 thing -- the negotiations were SHORT!
John Gillings
Honored Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

Robert,

There is a $GETDVI item MOUNTVER_ELIGIBLE. If that's false there's no point in looking any further.

$GETDVI item STS returns the status longword. I think you can determine the complete MV status from bits UCB$V_MNTVERIP, UCB$V_MNTVERPND, UCB$V_TIMOUT and UCB$V_WRONGVOL (there are a few other obscure bits releated to MV which may also be of interest, see SSRM under $GETDVI for more details).

If all else fails, since SHOW DEVICE can display the state, it must be in there somewhere! Maybe get your hands on the source listings for SHOW to see how it's done?
A crucible of informative mistakes
John Gillings
Honored Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

one day I'll get in front of Hein when we collide ;-)
A crucible of informative mistakes
Robert Brooks_1
Honored Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

What $ SHOW DEVICE indicates as "mount verify timeout" is a collection of states, all of which must be true for a device to be considered timed out of mount verification

1) device is mounted
2) device not in mount verification
3) ucb$v_valid bit is clear

Note that virtually all disks will return
TRUE for the MOUNTVER_ELIGIBLE item code.

Among the few that will return FALSE are
devices mounted /NOMOUNTVERIFY and foreign-mounted devices. Of course, an unmounted device will return FALSE, but that's not a particularly interesting case.


-- Rob
Robert_Boyd
Respected Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

One update on this: on V8.3 Alpha I tested putting a disk into mvtimeout -- and MOUNTVER_ELIGIBLE went from T to F after it went into the timeout condition.

This kinda throws a wrench in the discussion so far.

And what DOES this flag really stand for? Is it actually the bit that tells when MVTIMEOUT has occurred?
Master you were right about 1 thing -- the negotiations were SHORT!
Volker Halle
Honored Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

Robert,

DVI$_MOUNTVER_ELIGIBLE reflects the status of the vcb$v_mountver bit in the VCB (Volume Control Block) of a mounted disk.

from [SYS]MOUNTVER

'the MOUNTVER bit is cleared when mount verification aborts, whether due to a timeout or due to execution of a DISMOUNT /ABORT command.'

Volker.
Robert_Boyd
Respected Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

Here's the 1st fragment of code I wrote:

$ pipe show device 'device_name' | search sys$pipe mntverifytimeout ; -
x = f$message($status,"IDENT").nes."%NOMATCHES" ; -
define/job/nolog 'device_name'_mvtimeout &x
$ mvtest = f$trnlnm(device_name+"_mvtimeout","LNM$JOB")

I rewrote my subroutine to check for device available and ready to mount using the research everyone contributed:

$!
$! Poll: subroutine to poll to see if a particular drive comes online
$! Parameters
$! p1 device name
$! p2 label
$! p3 poll count
$! p4 symbol to return status
$! p5 extra mount qualifiers
$!
$POLL: subroutine
$ set noon
$ device = p1
$ device_name = f$element(0,":",device)
$ volume_label == f$element(1,":",device)
$ wait_interval = p2
$ if wait_interval .eqs. "" then $ wait_interval = "0:0:1.0"
$ poll_cnt = 'p3'
$ if poll_cnt .eqs."" then $ poll_cnt = 60
$ status_sym = p4
$ mount_quals = p5
$ 'status_sym' == 0
$!
$ poll_begin = f$time()
$POLL_LOOP:
$ if poll_cnt .lt. 'p3'
$ then
$ if poll_cnt .eq. 'p3'-1
$ then
$ say "***"
$ say "* Waiting for Device ",device_name," ( ",volume_label," ) "
$ say "* ",f$time()
$ say "***"
$ endif
$ endif
$ if poll_cnt.gt.0
$ then! keep trying
$ poll_cnt = poll_cnt - 1
$ IF F$GETDVI(device_name,"EXISTS")
$ THEN ! device exists
$ if .not. f$GETDVI(device_name,"MNT")
$ then
$ if .not. ( f$getdvi(device_name,"HOST_AVAIL") .or. -
f$getdvi(device_name,"ALT_HOST_AVAIL") )
$ then ! neither primary nor secondary host is available
$ wait 'wait_interval'
$ goto POLL_LOOP ! wait and retry
$ endif ! no host available
$ if volume_label .eqs. ""
$ then ! try to get the label from the drive
$ mount/override 'device_name':
$ volume_label = f$getdvi(device_name,"volnam")
$ dismount 'device_name':
$ endif ! get the label from the drive
$ if poll_cnt.lt. 'p3'-1
$ then ! show how long we waited
$ wait_time = f$delta_time(poll_begin,f$time())
$ say "***"
$ say "* Waited ",wait_time," for ",device_name," to come online."
$ say "* ",f$time()
$ say "***"
$ endif! show how long we waited
$ MOUNT/SYSTEM/NOASSIST 'device_name': 'volume_label''mount_quals'
$ else ! the device is mounted, test for mvtimeout
$
$ show device 'device_name'
$ mvtimeout = .not.f$getdvi(device_name,"MOUNTVER_ELIGIBLE")
$ if mvtimeout
$ then ! mount verification timed out -- dismount it to reset
$ say "***"
$ say "* Device ",device_name," timed out mount verification, dismounting "
$ say "***"
$ dismount/abort/override=check 'device_name'
$ goto POLL_LOOP ! retry the mount
$ endif! mount verification timed out
$!
$ endif
$ 'status_sym' == $status
$ ELSE ! device doesn't exist yet -- wait for it to show up
$ WAIT 'wait_interval'
$ GOTO POLL_LOOP
$ ENDIF
$ else ! give up -- the device never became available -- move on to the next one
$ say "***"
$ say "* Device ",device_name," ( ",volume_label," ) is not available -- continuing "
$ say "* ",f$time()
$ say "***"
$ endif! keep trying/give up
$!
$POLL_END:
$endsubroutine
Master you were right about 1 thing -- the negotiations were SHORT!
Jim_McKinney
Honored Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

Here's some alternative DCL for determining if disk 'p1' is in mount verification:

$! $ pipe lib/extr=$ucbdef/out=sys$output: sys$share:lib.mlb | -
$! _$ sear sys$pipe m_valid,m_mnt
$! $EQU UCB$M_VALID <^X800>
$! $EQU UCB$M_MNTVERIP <^X4000>
$! $ pipe lib/extr=$devdef/out=sys$output: sys$share:starlet.mlb | -
$! _$ sear sys$pipe m_mnt
$! $EQU DEV$M_MNT <^X80000>
$
$ devchar = f$getdvi(p1,"devchar")
$ sts = f$getdvi(p1,"sts")
$ mounted = ((devchar .and. %x80000) .ne. 0)
$ valid = ((sts .and. %x800) .ne. 0)
$ mntvfy_in_progress = ((sts .and. %x4000) .ne. 0)
$ if mounted .and. (.not. mntvfy_in_progress) .and. (.not. valid) then -
write sys$output "Disk ''p1' status is MntVerifyTimeout"
$

Robert_Boyd
Respected Contributor

Re: Detecting devices in Mount Verify Timeout from DCL

These masks can also be easily found by

$ search sys$share:*.req ucb$m_valid,ucb$m_mnt,dev$m_mnt

A slightly more complete version of the same code:

$! $ pipe lib/extr=$ucbdef/out=sys$output: sys$share:lib.mlb | -
$! _$ sear sys$pipe m_valid,m_mnt
$! $EQU UCB$M_VALID <^X800>
$! $EQU UCB$M_MNTVERIP <^X4000>
$! $ pipe lib/extr=$devdef/out=sys$output: sys$share:starlet.mlb | -
$! _$ sear sys$pipe m_mnt
$! $EQU DEV$M_MNT <^X80000>
$!
$ devchar = f$getdvi(p1,"devchar")
$ sts = f$getdvi(p1,"sts")
$ mounted = ((devchar .and. %x80000) .ne. 0)
$ valid = ((sts .and. %x800) .ne. 0)
$ mvtimeout = .not.f$getdvi(p1,"MOUNTVER_ELIGIBLE")
$ mntvfy_in_progress = ((sts .and. %x4000) .ne. 0)
$ show symbol/local/all
$ if mounted .and. mntvfy_in_progress then -
write sys$Output "Disk ",p1," status is MntVerifyInProgress"
$!
$ if mounted .and. (.not. mntvfy_in_progress) .and. (.not. valid) .and. (mvtimeout) then -
write sys$output "Disk ''p1' status is MntVerifyTimeout"
$!
Master you were right about 1 thing -- the negotiations were SHORT!