Monday, 27 July 2015

Easy Ways to Trace VSCSI Configuration with AIX

Virtual SCSI (VSCSI) disks are great for sharing physical disks without requiring physical adapters, but mapping the configuration can be painful. I recently came across a couple of tools for tracing and mapping out the VSCSI configuration that have been huge time savers.

Identify VSCSI Adapters Using kdb Command

There's a quick way of checking which Virtual I/O Server (VIOS) Virtual SCSI (VSCSI) adapter is being used for a VSCSI client adapter. You can do it all from the VIO client logical partition in one line:
# echo "cvai" | kdb | grep vscsi
read vscsi_scsi_ptrs OK, ptr = 0x59A03C0
?vscsi0 0x000007 0x0000000000 0x0 vios1->vhost9?
vscsi1 0x000007 0x0000000000 0x0 vios2->vhost9

# echo "cvai" | kdb | grep vscsi read vscsi_scsi_ptrs OK, ptr = 0x59A03C0 vscsi0     0x000007 0x0000000000 0x0 vios1->vhost9 vscsi1 0x000007 0x0000000000 0x0 vios2->vhost9.
As you can see, the command not only shows you the VIOS host names -- in this example, vios1 and vios2 -- it also tells you which vhost number you're using on each VIO server. This is especially helpful when the vhost number on VIOS1 is different from VIOS2's vhost.

If you've ever tried to walk through the procedure to trace virtual disks, you'll quickly see the benefit of this shortcut. To get the information the slow way, you have to run several commands on the VIO client, then some more on the Hardware Management Console (HMC), then log onto the VIOS and run some more commands.

Instead of all of that, the command:
# echo "cvai" | kdb
gives you all you want. Pipe it to “grep vscsi” and you've got the VIOS and the vhost adapter.

vhosts for Dual VIOS

If you're using dual VIOS, sometimes the vhost adapter on VIOS2 doesn't correspond to the vhost adapter number on VIOS2. Not a problem:
# echo "cvai"|kdb|grep vscsi
read vscsi_scsi_ptrs OK, ptr = 0x4240398
vscsi0 0x000007 0x0000000000 0x0 vios1->vhost8
vscsi1 0x000007 0x0000000000 0x0 vios2->vhost5
Here you can see that vscsi0 (on the AIX client) corresponds to vios1's VSCSI server adapter known as vhost8. But vios2's adapter is called vhost5.

Armed with this information, you can log onto the VIOS restricted shell as the userpadmin and list the devices using the lsmap command. You can use lsmap -vadapter to identify a single Virtual SCSI server adapter.

In this example, on vios1, you would list the disks on vhost8. Here's an extract from oneIBM system admin I was working on:
lsmap -vadapter vhost8
SVSA                            Physloc                                                                 Client Partition ID
--------------- ---------------------------------- ------------------
vhost8                        U9119.595.021A34E-V30-C36                        0x00000024
VTD tst_boot_a
Status Available
LUN 0x8100000000000000
Backing device hdisk53
Physloc U5791.001.9920070-P2-C10-T1-W500507680130239F-L32000000000000
And then on vios2, you'd run the lsmap command for vhost5.

Mapping VSCSI Configuration via a Script

If you're looking to map out all the VSCSI disks presented to AIX clients from Storage Area Network (SAN) LUNs, have a read of this blog post written by Brian Smith on IBM developerWorks. It includes a Perl script that presents the output in an HTML page. You can put that page on a web server or view it locally on your PC or laptop. The script takes very little time to install, and you don't need to be a Perl expert to do it.

You can download the script from a link in the blog post I noted above, and it's always best to check the original blog post in case there are updates. There's a disclaimer that you should read, and because the script accesses vital parts of your infrastructure, the author warns that you use it at your own risk.

If, like me, you hesitate to create a new spreadsheet to document your configuration, you'll find utilities such as these are worth looking into. They can make a huge difference to the time and effort it takes you to trace your VSCSI configuration.

No comments:

Post a Comment