Setting new device attributes with chdef

While building a new LPAR recently I stumbled across the chdef command.  This command modifies the default value of a predefined attribute of the specified device type in the ODM (PdDv).  For devices that are already configured and of the same class, subclass, and type, this command does not change the active devices attributes, instead it modifies the ODM attributes so these will be changed the next time you reboot the LPAR or rmdev and cfgmgr the device.  The chdef command is a bit like using the chdev -P flag, except it changes the predefined values and the values currently configured for every device that matches the same class, subclass and type.

Let us take a look at the settings on a newly built LPAR and then make some changes with chdef.

 

Checking the default build settings for vscsi1.

lsattr -El vscsi1

rw_timeout      0              Virtual SCSI Read/Write Command Timeout True

vscsi_err_recov delayed_fail   N/A                                     True

vscsi_path_to   0              Virtual SCSI Path Timeout               True

 

Checking the default build settings for vscsi2.

lsattr -El vscsi2

rw_timeout      0              Virtual SCSI Read/Write Command Timeout True

vscsi_err_recov delayed_fail   N/A                                     True

vscsi_path_to   0              Virtual SCSI Path Timeout               True

 

Check the defaut build settings for hdisk0 (rootvg).

lsattr -El hdisk0

PCM             PCM/friend/vscsi             Path Control Module        False

algorithm       fail_over                    Algorithm                  True

hcheck_cmd      test_unit_rdy                Health Check Command       True+

hcheck_interval 0                            Health Check Interval      True+

hcheck_mode     nonactive                    Health Check Mode          True+

max_transfer    0x40000                      Maximum TRANSFER Size      True

pvid            0012345678900000000000000000 Physical volume identifier False

queue_depth     3                            Queue DEPTH                True

reserve_policy  no_reserve                   Reserve Policy             True+

 

 

Find the Class, Subclass and Type values for vscsi adapters.

lsdev -H -F "name class subclass type" | grep -e ^name -e vscsi

name     class     subclass   type

hdisk0   disk      vscsi      vdisk

vscsi1   adapter   vdevice    IBM,v-scsi

vscsi2   adapter   vdevice    IBM,v-scsi

 

Find the Class, Subclass and Type values for hdisks.

lsdev -H -F "name class subclass type" | grep -e ^name -e hdisk

name     class     subclass   type

hdisk0   disk      vscsi      vdisk

 

Change the ODM settings for the vSCSI adapters.

Set the rw_timeout, vscsi_err_recov and vscsi_path_to options.

chdef -a rw_timeout=120 -c adapter -s vdevice -t IBM,v-scsi

chdef -a vscsi_err_recov=fast_fail -c adapter -s vdevice -t IBM,v-scsi

chdef -a vscsi_path_to=30 -c adapter -s vdevice -t IBM,v-scsi

 

Verify the settings have changed in the ODM.

lsattr -El vscsi1

rw_timeout       120         Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  fast_fail   N/A                                       True

vscsi_path_to    30          Virtual SCSI Path Timeout                 True

 

lsattr -El vscsi2

rw_timeout       120         Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  fast_fail   N/A                                       True

vscsi_path_to    30          Virtual SCSI Path Timeout                 True

 

Verify the running adapter has not changed.

lsattr -Pl vscsi1

rw_timeout       0            Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  delayed_fail N/A                                       True

vscsi_path_to    0 Virtual    SCSI Path Timeout                         True

 

lsattr -El vscsi2

rw_timeout       0            Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  delayed_fail N/A                                       True

vscsi_path_to    0            Virtual SCSI Path Timeout                 True

 

Change the ODM settings for the vSCSI disks.

chdef -a hcheck_interval=120 -c disk -s vscsi -t vdisk

chdef -a hcheck_mode=nonactive -c disk -s vscsi -t vdisk

chdef -a queue_depth=16 -c disk -s vscsi -t vdisk

 

Verify the settings have changed in the ODM.

lsattr -El hdisk0

PCM              PCM/friend/vscsi               Path Control Module        False

algorithm        fail_over                      Algorithm                  True

hcheck_cmd       test_unit_rdy                  Health Check Command       True+

hcheck_interval  120                            Health Check Interval      True+

hcheck_mode      nonactive                      Health Check Mode          True+

max_transfer     0x40000                        Maximum TRANSFER Size      True

pvid             0012345678900000000000000000   Physical volume identifier False

queue_depth      16                             Queue DEPTH                True

reserve_policy   no_reserve                     Reserve Policy             True+

 

Verify the running hdisk has not changed.

lsattr -Pl hdisk0

PCM              PCM/friend/vscsi               Path Control Module        False

algorithm        fail_over                      Algorithm                  True

hcheck_cmd       test_unit_rdy                  Health Check Command       True+

hcheck_interval  0                              Health Check Interval      True+

hcheck_mode      nonactive                      Health Check Mode          True+

max_transfer     0x40000                        Maximum TRANSFER Size      True

pvid             0012345678900000000000000000   Physical volume identifier False

queue_depth      3                              Queue DEPTH                True

reserve_policy   no_reserve                     Reserve Policy             True+

 

To list all the default settings that have been changed with chdef.

I added the header line in for clarity.

chdef

Attribute         New Default  AIX Default    Device Type

dyntrk            yes          yes            driver/vionpiv/efscsi

fc_err_recov      fast_fail    fast_fail      driver/vionpiv/efscsi

hcheck_cmd        inquiry      test_unit_rdy  PCM/friend/vscsi

hcheck_interval   120          0              PCM/friend/vscsi

hcheck_mode       nonactive    nonactive      PCM/friend/vscsi

rw_timeout        120          0              adapter/vdevice/IBM,v-scsi

vscsi_err_recov   fast_fail    delayed_fail   adapter/vdevice/IBM,v-scsi

vscsi_path_to     30           0              adapter/vdevice/IBM,v-scsi

 

Adding a New vSCSI Device

Before the adding of the new device.

lsdev -Cc adapter | grep vscsi

vscsi1 Available Virtual SCSI Client Adapter

vscsi2 Available Virtual SCSI Client Adapter

 

From the HMC, I used DLPAR to add another vSCSI device.

cfgmgr

lsdev -Cc adapter | grep vscsi

vscsi0 Available Virtual SCSI Client Adapter

vscsi1 Available Virtual SCSI Client Adapter

vscsi2 Available Virtual SCSI Client Adapter

 

Confirm the new device has the updated settings in the ODM.

lsattr -El vscsi0

rw_timeout       120         Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  fast_fail   N/A                                       True

vscsi_path_to    30          Virtual SCSI Path Timeout                 True

 

Confirm the new device has the updated settings for the running device.

lsattr -Pl vscsi0

rw_timeout       120         Virtual SCSI Read/Write Command Timeout   True

vscsi_err_recov  fast_fail   N/A                                       True

vscsi_path_to    30          Virtual SCSI Path Timeout                 True

 

 

There are a couple of options to implement the changes on the running devices.

Option 1 - To schedule an LPAR reboot.

Option 2 - Follow my blog post here, How to make changes to vscsi adapters without a reboot.

 

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
AIX Cloning a rootvg using alternate disk installation
Viewed 11247 times since Sun, Jun 30, 2019
How to Easily Generate AIX Systems Management Reports
Viewed 2790 times since Wed, May 30, 2018
AIX - How to extend JFS filesystem
Viewed 17365 times since Fri, Jun 8, 2018
Topics: AIX, Networking, System Admin
Viewed 11320 times since Fri, Apr 19, 2019
AIX: Script to get Total Disk Size
Viewed 3433 times since Tue, Jun 12, 2018
DISK OPERATION ERROR in AIX
Viewed 13640 times since Thu, Feb 21, 2019
Installing a Interim Fix (APAR IV16587)
Viewed 2731 times since Tue, Jul 17, 2018
Kerberos authentication configuration for AIX servers
Viewed 10601 times since Mon, Jun 25, 2018
A tcpdump Tutorial and Primer with Examples
Viewed 4681 times since Sun, Jun 17, 2018
vfcpmap on VIO Server
Viewed 9252 times since Tue, Jun 4, 2019