AIX Changing ’defined’ or ’missing’ hard disk states to ’Available’ in IBM Smart Analytics System for AIX environment

Technote (troubleshooting)


Problem(Abstract)

Hard disks in 'defined' or 'missing' state should be changed to 'Available' state in IBM Smart Analytics System for AIX environment and disk settings need to be reconfigured.

Resolving the problem

The following steps will not require an outage:


1. Capture current output for all disks.

a. Current disk settings for all disks.

lsdev | grep hdisk | awk '{print $1}' | xargs -n 1 lsattr -OEl  > lsattr_out_pre.txt


b. Current Physical volume (PV) / Volume group (VG) assignments.

lspv > lspv_out_pre.txt

c. Current VG to Logical Volume (LV) /Filesystem assignments.

lsvg -o | xargs lsvg -l   > lsvg_o_out_pre.txt

2. Identify all of the "Missing" or "Defined" hdisks.

lsdev | grep hdisk | egrep -i "missing|defined"

It is a good idea to run the above command to scrutinise the output. Then you can proceed to the next step.

To assign these hdisks to a variable you can do the following:

hdisklist=$(lsdev | grep hdisk | egrep -i "missing|defined" | awk '{print $1}')

To test the list do the following:

for hdisk in ${hdisklist};do echo ${hdisk};done

3. To remove the hdisk definitions from the ODM, do this:

for hdisk in ${hdisklist}
do
echo "Removing ${hdisk}"
rmdev -dl ${hdisk}
done


4. Rerun the lsdev check again to make sure that all the Defined or Missing hdisks are in fact gone.

lsdev | grep hdisk | egrep -i "missing|defined"

5. If there area any 'dac' devices that are Defined or Missing, remove them as well.

daclist=$(lsdev | grep '^dac' | egrep -i 'Missing|Defined' | awk '{print $1}')
 
for dac in ${daclist}
do
echo "Removing ${dac}"
rmdev -dl ${dac}
done

The next steps require an outage. To run the chdev command to change the hdisk parameters it will be necessary to unmount filesystems and varyoff the vgs where they are varied on and mounted.

6. When the system is ready, run hastopdb2. In the 7700 environment this will unmount and varyoff all TSA controlled LVM based filesystems on external storage. The cold storage should be put under HA control to allow for seemless failover.

7. Run the following command to determine hdisk settings for the remaining hdisks: (the printf print the hdisk as part of the attributes line, you must use printf to avoid the line feed). This will pick up the disks we deleted earlier.

lsdev | grep hdisk | grep MPIO | awk '{print $1}' | while read hdisk;do printf "${hdisk}:";lsattr -a queue_depth -a max_transfer -a reserve_policy -a algorithm -OEl ${hdisk} | grep -v queue_depth;done

*** SAMPLE OUTPUT *******
hdisk2:128:0x100000:no_reserve:round_robin
hdisk3:128:0x100000:no_reserve:round_robin
hdisk4:128:0x100000:no_reserve:round_robin
hdisk5:128:0x100000:no_reserve:round_robin
hdisk6:128:0x100000:no_reserve:round_robin
hdisk7:128:0x100000:no_reserve:round_robin
hdisk8:128:0x100000:no_reserve:round_robin
hdisk9:128:0x100000:no_reserve:round_robin
hdisk10:128:0x100000:no_reserve:round_robin
hdisk11:128:0x100000:no_reserve:round_robin
hdisk12:10:0x40000:single_path:fail_over
hdisk13:10:0x40000:single_path:fail_over
hdisk14:10:0x40000:single_path:fail_over


8. Run the above command again, but only pick out those that have incorrect values, this is all one line, since we know the pattern, we can weed out the ones that are already set correctly. The following command only returns the list of hdisks that don't meet the current specs.

lsdev | grep hdisk | grep MPIO | awk '{print $1}' | while read hdisk;do printf "${hdisk}:";lsattr -a queue_depth -a max_transfer -a reserve_policy -a algorithm -OEl ${hdisk} | grep -v queue_depth;done
| grep -v '128:0x100000:no_reserve:round_robin'
*** SAMPLE OUTPUT *******
hdisk12:10:0x40000:single_path:fail_over
hdisk13:10:0x40000:single_path:fail_over
hdisk14:10:0x40000:single_path:fail_over

9. You can create a second disk list ${modlist} for those disks that will be modified:

lsdev | grep hdisk | grep MPIO | awk '{print $1}' | while read hdisk;do printf "${hdisk}:";lsattr -a queue_depth -a max_transfer -a reserve_policy -a algorithm -OEl ${hdisk} | grep -v queue_depth;done
| grep -v '128:0x100000:no_reserve:round_robin' | cut -d: -f 1
**** SAMPLE OUTPUT *****
hdisk12
hdisk13
hdisk14


modlist=$(lsdev | grep hdisk | grep MPIO | awk '{print $1}' | while read hdisk;do printf "${hdisk}:";lsattr -a queue_depth -a max_transfer -a reserve_policy -a algorithm -OEl ${hdisk} | grep -v queue_depth;done
| grep -v '128:0x100000:no_reserve:round_robin' |  cut -d: -f 1)

# echo ${modlist}
*** SAMPLE OUTPUT****
hdisk12 hdisk13 hdisk14


10. Modify the hdisk parameters.

for hdisk in ${modlist}
do
chdev -l ${hdisk} -a queue_depth=128 -a max_transfer=0x100000 -a reserve_policy=no_reserve -a algorithm=round_robin
done

11. After this step is done, restart from step #1. Change the 'pre' to 'post' and compare the output. Look for changes in the PVID columns.

12. Rerun step 9. The output should be blank as all of the MPIO disks should have their ODM parameters updated. Since the devices were made inactive a reboot is not required.

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 FC Performance improvements for IBM AIX FC and FCoE device driver stacks
Viewed 5714 times since Fri, Jan 31, 2020
Writing a Custom PVID
Viewed 2873 times since Fri, Feb 1, 2019
sysdumpdev Command
Viewed 1824 times since Mon, Jul 16, 2018
AIX 6/7 Script to create a file with commands to remove missing and failed paths
Viewed 3354 times since Tue, Jun 14, 2022
Undocumented AIX command lquerypv
Viewed 3586 times since Mon, Jul 16, 2018
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 41345 times since Thu, Jun 21, 2018
AIX lspath Missing path
Viewed 9750 times since Fri, Oct 5, 2018
Getting list users and groups in AIX
Viewed 3527 times since Mon, May 28, 2018
Create volume groups on AIX - Normal Big Scalable
Viewed 6692 times since Thu, Feb 21, 2019
AIX Replacing a failed disk (rootvg)
Viewed 8545 times since Tue, Jul 17, 2018