Monday, February 9, 2009

easyddr: a wrapper for scsimgr to help you manage your DDR

The DDR (device data repository) which I spoke about a few months ago is an interesting feature of the new HP-UX mass storage stack which lets you set attributes on-the-fly for storage devices matching a specific scope. Any new device which is presented to the system gets its custom attributes assigned dynamically.

While this is a nice feature, there are not thousands of use cases I can think of here. The stock DDR that comes with HP-UX seems to be populated with entries for tape devices, so my guess is that a lot of usefulness is related to tape drives (but I couldn't say, as our Data Protector infrastructure runs on Windows). But with disks, one case that is worth mentioning is that the SCSI queue depth can be fine-tuned for specific devices, enhancing performance.

While the DDR is useful, it's not really easy to use: it depends on fixed-length, whitespace-padded strings and it's hard to dispatch modifications to a bunch of servers at the same time. So I wrote a small script named which eases its use somewhat.


1. Create a configuration file

The configuration file contains pairs matching wildcards and attributes. For example:

# Sample configuration file
/HSV:max_q_depth=32 esd_secs=60
/IR Volume:max_q_depth=8

This means that:

  1. All HSV (EVA) devices, no matter the controller version, will be set with a SCSI queue depth of 32 and an I/O timeout of 60 seconds.

  2. All IR Volumes (MPT) devices will be set with a SCSI max queue depth of 8

2. Run easyddr with your configuration file

Run easyddr:
# /usr/local/etc/easyddr.cfg

It first reads the configuration file to see if any devices on your system matches your widcards. Then, if there is no DDR entry for a device, it adds it to the DDR without needing you to cut-and-paste it. The last step it takes is to set your attributes, then save them. The script always runs in preview mode by default. If everything seems okay and you want to apply the settings, re-run it with the "-apply" option:

# /usr/local/etc/easyddr.cfg -apply

Caveat: there is no way to delete entries using easyddr once they are added. If you make a mistake, you'll need to run scsimgr ddr_del to remove them.

In my case, I install easyddr and the config file in my Golden Depot, and make it a baseline script that needs to be run when the server is initially installed. No more need to use the scsimgr command. Have fun!

Download easyddr here

No comments: