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: Script to check if all paths are consistent and available
Viewed 3362 times since Tue, Jun 12, 2018
AIX Power replacing (hot-swap) failed disk in rootvg
Viewed 3747 times since Tue, Apr 16, 2019
AIX www web Links
Viewed 3396 times since Fri, Apr 19, 2019
Using splitvg in AIX to make a copy of a volume group
Viewed 8862 times since Mon, Jun 3, 2019
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 46588 times since Fri, Aug 21, 2020
System Admin Mirrorvg without locking the volume group
Viewed 3181 times since Mon, May 21, 2018
replacing (hot-swap) failed disk in rootvg
Viewed 9266 times since Thu, Sep 20, 2018
IBM AIX commands you should not leave home without
Viewed 7235 times since Mon, Jun 11, 2018
SSH Essentials: Working with SSH Servers, Clients, and Keys
Viewed 4484 times since Wed, Jun 27, 2018
AIX- Procedure to replace rootvg harddisk
Viewed 4650 times since Tue, Apr 16, 2019