Operating System - OpenVMS
1756714 Members
2499 Online
108852 Solutions
New Discussion юеВ

Re: How to integrate diskblock command into a script

 
andy hua
Occasional Advisor

How to integrate diskblock command into a script

Hi, I want to use diskblock to test IO on disks. If there is only one single disk, I can just input command under DISKBLOCK>, like:test /iosize=2 /queue=10 /readpercent=100 /duration=10 /sequential /compare, but now I want to test IO on four disks, so it maybe a good idea to integrate the command into a script and do it concurrently. I have tried several ways, but always failed. So can anyone give me some suggestions? Thanks in advance.
8 REPLIES 8
Steven Schweda
Honored Contributor

Re: How to integrate diskblock command into a script

> I have tried several ways, but always
> failed.

Perhaps you did something wrong. What did
you do? How did it fail?
Hein van den Heuvel
Honored Contributor

Re: How to integrate diskblock command into a script

>> I want to use diskblock to test IO on disks

There is no OpenVMS standard tool 'diskblock'.
May/must we assume this it the OpenVMS Freeware tool called Diskblock?
Which version (5.8?)

I don't know the tool but I know the guy who wrote it is a solid VMS specialist. So I'm guessing here that you do not have to go 'into' the tool but can just give it a command line.

If so, just $SPAWN/NOWAIT/OUT=... DISKBLOCK TEST ... device

Or submit the same batch job several times with a parameter for the disk to test and define a logical name for that disk just before running the command

Or create several temp commandd files on the fly and spawn or submit those.

>> so it maybe a good idea to integrate the command into a script and do it concurrently

That may be a great idea to a thoroughly bad idea depending on what you want to measure. The disk or the controller?

>> I have tried several ways, but always failed. So can anyone give me some suggestions?

Here is anovel idea.... how about you explain to us:
a) what you tried
b) why you think it failed.

Was there an error message?
Did it not do what you expected?
How did you come to that conclusion?

We are all superbly smart here, but we are only amateur mind readers.

Cheers,
Hein.
andy hua
Occasional Advisor

Re: How to integrate diskblock command into a script

Sorry just write the post in a hurry, so haven't explained it clearly.
As Heuvel mentioned, DISKBLOCK is OpenVMS Freeware tool. I use the "test" function to create the IO to disks.
$DISKBLOCK
DISKBLOCK>test /iosize=2 /queue=10 /readpercent=100 /duration=3600*48 /random /compare

This could be fine if I just test one disk, but if I want to test more than one disk, for example 10 disks, it is not a good idea to run it separately.
I have tried to define a symbol as following:
TEST :== $DISKBLOCK test /iosize=2 /queue=10 /readpercent=100 /duration=3600*48 /random /compare
But when I issue $TEST on the command line, the DISKBLOCK> shows up, but the command won't run.
I am new to OpenVMS,can't figure out
good ways to in a short time,but the task is a bit urgent. So I wonder if anyone can give me some suggestions to get my goal.
Thanks for Heuvel and Cheweda's comments.



Steven Schweda
Honored Contributor

Re: How to integrate diskblock command into a script

Why not something like this in a 2-line
command procedure?:

$ diskblock
test /iosize=2 /queue=10 /readpercent=100 /duration=3600*48 /random /compare

> I am new to OpenVMS, [...]

How much don't you know? (It's hard to be
helpful with no knowledge of the audience.)

It appears that DISKBLOCK is not expecting
options on its command line. It reads them
from the user at SYS$INPUT (or SYS$COMMAND,
depending).

Of course, I don't use the program, so I'm
just guessing.
Hein van den Heuvel
Honored Contributor

Re: How to integrate diskblock command into a script

I just installed the program and indeed it does not seem to be ready for a one liner.
This appears to make sense as according to its help you need to 'select' a device first and such.

So here is the general, untested, approach

$close/nolog x
$disks = "x:,y:,z:"
$i = 0
$loop:
$disk = f$element(i,",",disks)
$if disk.eqs."" then goto done:
$i = i + 1
$open/write x disk_'i'.tmp
$write x "select " + disk
$write x "test ..."
$close x
$spawn /nowait/inpu=disk_'i'.tmp/out=disk_'i'.log run diskblock
$goto loop
$done:
$! Figure out to wait for all to complete...


Actually the waiting is slightly tricky.

So it would be better to SUBMIT instead of spawn and then use SYNC

Or... you can just run one at a time
with a similar loop:


$close/nolog x
$disks = "x:,y:,z:"
$i = 0
$loop:
$disk = f$element(i,",",disks)
$if disk.eqs."" then goto done:
$i = i + 1
$open/write x disk_'i'.tmp
$write x "select " + disk
$write x "test ..."
$close x
$define/user sys$input disk_'i'.tmp
$define/user sys$output disk_'i'.log
$run diskblock
$goto loop
$done:


Cheers,
Hein.




andy hua
Occasional Advisor

Re: How to integrate diskblock command into a script

Thanks Hein van. I have tried the sequential one, and after little modificaiton, it works fine.
Aaron Sakovich
Super Advisor

Re: How to integrate diskblock command into a script

If you still want a one-liner, try this (I don't have diskblock installed, so I can't test it with it, but use this syntax with many other programs, esp. VMSmail):

$ test :== "pipe write sys$output ""test /iosize=2 /queue=10 /readpercent=100 /duration=3600*48 /random /compare"" | diskblock"

andy hua
Occasional Advisor

Re: How to integrate diskblock command into a script

Problem solved