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 Not all filesets for 6100-07_AIX_ML were found
Viewed 3036 times since Tue, Jul 17, 2018
How to install filesets/software in aix?
Viewed 6011 times since Mon, Jul 8, 2019
Script HW/SW AIX
Viewed 9173 times since Mon, Jun 4, 2018
AIX, Red Hat, Security, System Admin↑ System-wide separated shell history files for each user and session
Viewed 2287 times since Fri, Apr 19, 2019
https://www.ibm.com/developerworks/learn/aix/index.html
Viewed 11277 times since Wed, May 30, 2018
LVM: Display basic information about Physical Volumes, Volume Groups and Logical Volumes
Viewed 2976 times since Sun, Jun 3, 2018
Technology level update on AIX using smit_update and alt_disk_install method
Viewed 5828 times since Sun, Jun 30, 2019
Configure log file for cron daemon on AIX
Viewed 10646 times since Thu, Feb 21, 2019
AIX: Script to get Total Disk Size
Viewed 3798 times since Tue, Jun 12, 2018
Part 1, Network overview - Monitoring the hardware
Viewed 5379 times since Mon, Jun 4, 2018