Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating chdev command

Status
Not open for further replies.

bernie01

MIS
Mar 18, 2003
10
0
0
AU
We need to run a chdev command every time we add a new hdisk:

chdev -l hdiskn -a queue_depth=8 -a rw_timeout=60

I believe that it may be possible to automate this via smitty/ODM so that cfgmgr runs this automatically when it finds a new hdisk? Can anyone explain how to get started on this?
Thanks, Bernie.
AIX 4.3.3 and AIX 5L
 
The predefined attributes class (PdAt) contains the default settings.

I would recommend that you do not make changes to this because any changes you make here can be overwritten by system upgrades/patches, so you would have to keep remembering to check and reapply the change.

If you do decide to do this then you will need to know the uniquetype value of the disks. ie, for my ESS F20 disks the following returns the default queue_depth value:
odmget -q 'uniquetype=disk/fcp/2105F20 and attribute=queue_depth' PdAt

To get a list of all the predefined queue_depth values use:
odmget -q 'attribute=queue_depth' PdAt

As an example if I wanted to change the default queue_depth on these disks:

1) Save the existing PdAt file before making any changes.
2) Get the current default value stanza and place in a flat file:
odmget -q 'uniquetype=disk/fcp/2105F20 and attribute=queue_depth' PdAt > /tmp/qaz
This will return the file /tmp/qaz containing:

PdAt:
uniquetype = "disk/fcp/2105F20"
attribute = "queue_depth"
deflt = "20"
values = "1-256,1"
width = ""
type = "R"
generic = "UD"
rep = "nr"
nls_index = 30

3) Edit this file to change the deflt field to the required value.
4) Update the ODM with the amended stanza:
odmchange -o PdAt -q 'uniquetype=disk/fcp/2105F20 and attribute=queue_depth' /tmp/qaz

Things to remember when changing the ODM:
Always ensure you have backups before starting.
Always plan carefully, do not try to wing it.
Be as specific as possible with the search criteria.
Do not try to edit ODM files directly they are not flat files, always use the odm commands and intermediate flat files containing the required stanzas.
Keep a log of the actions you take in case you need to back out.
Don't do it unless you know what you are doing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top