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

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
List AIX File Systems the Easy Way With the lsvgfs Command
Viewed 1998 times since Thu, Sep 20, 2018
AIX oslevel version OS
Viewed 4865 times since Wed, Apr 17, 2019
Epoch & Unix Timestamp Conversion Tools
Viewed 61500 times since Fri, Jun 22, 2018
Using expect to automate mundane tasks
Viewed 1870 times since Mon, Jun 3, 2019
Problems with NFS on an AIX Reboot? Then Go Single
Viewed 7212 times since Wed, May 30, 2018
AIX, Networking Etherchannel failover testing
Viewed 2572 times since Fri, Apr 19, 2019
Working with Virtual media library on VIO servers
Viewed 15136 times since Thu, Feb 21, 2019
Processes and Devices—It’s All About the Children
Viewed 2174 times since Wed, May 30, 2018
What is OS Watcher Utility and How to use it for Database Troubleshooting ?
Viewed 29938 times since Thu, Jun 21, 2018
AIX, Security, System Admin↑ Generating random passwords
Viewed 2975 times since Fri, Apr 19, 2019