Recently I discovered a new switch to lspv
command -u. It seems to
be available since AIX7 TL1 and AIX6 TL7. Thanks for this switch IBM; I like it
very much.
A physical volume (hdisk) to an LPAR can be provided in several
ways:
- without VIOS
- local physical disk connected to a physical disk SCSI/SAS controller owned by the LPAR
- SAN disk connected to a physical FC controller
- with VIOS
- SAN disk connected to a virtual FC controller
- a physical disk mapped through a virtual scsi
- SAN disk mapped through a virtual scsi
- logical volume on VIOS mapped through a virtual scsi
If you need to know where a specific disk comes
from without looking into your documentation (which, indeed, is up to date and
precise) or loging in to VIOSes etc, lspv
-u helps significantly.
The command switch displays unique id of disks (UDID) and does
the same job as the code I was using before, but in a more handy way.
lsdev -Cc disk -F name | while read hdisk; do
echo ${hdisk},$(odmget -q "name=${hdisk} and attribute=unique_id" CuAt|grep value|cut -d '"' -f2)
done
echo ${hdisk},$(odmget -q "name=${hdisk} and attribute=unique_id" CuAt|grep value|cut -d '"' -f2)
done
UDID is build up using a certain logic. I haven't seen the code,
but some of the interesting parts are easy to spot:
- unique_id attribute of an SAS attached hdisk is 2A1135000C500337924AB0BST9146852SS03IBMsas. This ID contains WWNN of the SAS controller (00C500337924AB), disk vendor (IBM), connection type (sas), and also disk model ST9146852SS, which is 146,8GB SAS.
- unique ID of a logical volume is VGID.sequence_number. For example ID of a third logical volume in a specific VG is 00cc572600004c00000001325d0ab9bd.3.
A few examples of lspv
-u outputs with comments on UDID:
- Locally attached SAS
disk
hdisk0 00cc57264df9dc6b rootvg active 2A1135000C500238633030BST9146852SS03IBMsas - virtual disk connected via virtual
scsi,
backed by SAS disk.
hdisk28 00cc572646f271f9 none 3F2A2A1135000C500337924AB0BST9146852SS03IBMsas05VDASD03AIXvscsi - virtual disk connected via virtual
scsi,
backed by logical volume. Logical volume ID can by identified
by a period.
hdisk0 00cc57265d4534bd rootvg active 372200cc572600004c00000001325d0ab9bd.205VDASD03AIXvscsi - SAN disk attached via
physical or virtual FC. The disk comes from a DS8100 disk array
identified as 75BBXM1. Volume ID of the disk in DS8100 is 180D.
hdisk39 00cc5726aaa9e19e testvg active 200B75BBXM1180D07210790003IBMfcp - virtual disk connected via virtual
scsi,
backed by SAN disk. The disk comes from a DS8300 disk array
identified as 75YY981. Volume ID of the disk in DS8300 is 0501.
hdisk2 00cc57260b6d4ca6 rootvg active 3520200B75YY981050107210790003IBMfcp05VDASD03AIXvscsi
I trimmed the output slightly to fit on screen
better. In fact lspv -u show one more column on right with a long string of unknown purpose.
Since disk unique id is in ODM, it can help you
solve an issue, when you unmap a disk from a system on either VIOS or a storage
by mistake and you want to put it back asap; lspv
-u helps you to identify the disk, unless you
perform rmdev -dl on
that disk.
Didn't find your lspv -u output in the examples above? Leave a
comment!