Array Setup and Networking
1752862 Members
4627 Online
108791 Solutions
New Discussion

Map Nimble volume serial number to volume name under Linux

 
davidbaril127
Advisor

Map Nimble volume serial number to volume name under Linux

The document "Nimble Storage for Red Hat Enterprise Linux 6 & Oracle Linux 6" shows how to get the volume serial number using the Linux "scsi_id" command.  This document also shows the source code to a small ksh script named "vol-info" that uses the Nimble ssh CLI interface to create a table mapping the cryptic volume serial number into the Nimble "volume name".

This volume serial number -to- volume name mapping is very useful for Linux scripting, since the core identifier of the Nimble iscsi volume is the cryptic serial number.

The scsi serial number displayed using the scsi_id command is read from fields on the SCSI vital product data (VPD) pages, typically VPD page 0x83.  There are many other standardized and vendor-specific VPD pages that are used to pass useful information about a SCSI LUN. The Linux command "sg_vpd" can be used to display the contents of these VPD pages.

I understand that Nimble has a very powerful and functional scripting interface using a RESTfull API. and the ssh CLI commands. These interfaces can be used to provide a serial-number to volume-name mapping, as the example Nimble CLI script mentioned above does.  However, these interfaces are more complex to use and require some form of secure authentication.

Some storage vendors make the "volume name" and/or "volume description" available using the optional or vendor-specific fields within the SCSI VPD information pages.  As such, this information can be easily queried from Linux, and provide information in "human-readable" form.

I tried querying all the SCSI VPD pages that the Nimble storage array advertised as being supported, and found nothing that looked like a "volume name" or "volume description".  I did not go searching for hidden VPD pages.

Is there an easy mechanism to retrieve the "volume name" of an attached Nimble iSCSI volume ... from the Linux side?  This will likely eventually become a name alias for Linux dm-multipath.  The target iqn and SCSI serial numbers are easily available.

Thanks for your help.

Dave B

1 REPLY 1
davidbaril127
Advisor

Re: Map Nimble volume serial number to volume name under Linux

With further research I noticed that the iscsi target iqn string generated by the Nimble Storage array includes the Ascii volume-name and can be easily parsed.

The Linux /dev/disk/by-path directory contains symbolic links whose values contain the Nimble controller NIC IP address, the volume-name, and the Linux disk name, just needing some parsing to separate out the fields.  This parsing in vendor-specific to Nimble. Other vendors format their target iqn names differently.

Here is an example of the output of a "ls -l" of the by-path symbolic link in RHEL/CentOS Linux, with the interesting fields highlighted (bold underline)

DISK="sdb"

"ls -l /dev/disk/by-path | grep nimble | grep "/$DISK"

lrwxrwxrwx 1 root root 9 Nov 17 17:58 ip-10.0.0.1:3260-iscsi-iqn.2007-11.com.nimblestorage:gluster-test-v479411925e4e2edd.00000001.19da3f4f-lun-0 -> ../../sdb

# Crack the by-path symbolic link to yield three fields which are highlighted above.

#   TARGET_IP   - signifies the NIC port on the controller

#   VOLUME_NAME - Name of the volume on the Nimble Storage Array

#   DISK        - The Linux disk name, such as "sdb"

The Linux "scsi_id" command provides the volume serial number

/lib/udev/scsi_id --whitelisted /dev/$DISK


Combine the two sources of information, and you have the Linux name, the serial number, the Nimble NIC IP address (indicating the NIC port), and the Nimble volume name.

Here is the script output:of an example script:

./nimble_get_vol_name sdb

Linux disk name      : sdb

Volume Serial #      : 289ca79ba4f1758ca6c9ce9004f3fda19

Nimble NIC IP        : 10.0.0.1

Nimble volume name   : gluster-test

For a multipath device:

./nimble_get_vol_name dm-2

Linux multipath name : dm-2

Child disk paths ...

Linux disk name      : sdb

Volume Serial #      : 289ca79ba4f1758ca6c9ce9004f3fda19

Nimble NIC IP        : 10.0.0.1

Nimble volume name   : gluster-test

Linux disk name      : sdc

Volume Serial #      : 289ca79ba4f1758ca6c9ce9004f3fda19

Nimble NIC IP        : 10.0.1.1

Nimble volume name   : gluster-test

Attached is the example script "nimble_get_vol_name"

The end-of-line characters have been converted to Windows format for easy viewing.

Don't forget to add execute permission to the file "chmod +x nimble_get_vol_name"