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
replacing (hot-swap) failed disk in rootvg
Viewed 9117 times since Thu, Sep 20, 2018
Problems with NFS on an AIX Reboot? Then Go Single
Viewed 7212 times since Wed, May 30, 2018
Installation of the Virtual I/O Server directly from the HMC
Viewed 20462 times since Tue, Jun 4, 2019
Working with Virtual media library on VIO servers
Viewed 15135 times since Thu, Feb 21, 2019
Monitoring Events with AIX Audit
Viewed 4005 times since Wed, May 30, 2018
AIX, Security, System Admin↑ Fix user accounts
Viewed 4696 times since Fri, Apr 19, 2019
Using the AIX splitvg command
Viewed 4204 times since Mon, Jun 3, 2019
Backing up your VIOS configuration with viosbr.
Viewed 11538 times since Mon, May 28, 2018
Managing System Dump Devices sysdumpdev
Viewed 3417 times since Mon, Jul 9, 2018
Mirroring the rootvg Volume Group for AIX
Viewed 3942 times since Mon, May 21, 2018