Sasutils
Serial Attached SCSI (SAS) Linux utilities and Python library
Install / Use
/learn @stanford-rc/SasutilsREADME
sasutils is a set of command-line tools and a Python library to ease the administration of Serial Attached SCSI (SAS) storage networks.
.. image:: https://img.shields.io/pypi/v/sasutils.svg :target: https://pypi.python.org/pypi/sasutils/
.. image:: https://img.shields.io/pypi/pyversions/sasutils.svg :target: https://pypi.python.org/pypi/sasutils/ :alt: Supported Python Versions
.. image:: https://img.shields.io/pypi/l/sasutils.svg :target: https://pypi.python.org/pypi/sasutils/ :alt: License
sasutils command-line tools
- sas_counters
- sas_devices
- sas_discover
- ses_report
Also, a few "zeroconf" udev scripts for use in udev rules that create friendly device aliases using SES-2 subenclosure nicknames.
- sas_mpath_snic_alias
- sas_sd_snic_alias
- sas_st_snic_alias
.. note::
While **sasutils** gets most of the system data from sysfs (/sys), `sg_ses` (available in sg3_utils or sg3-utils)
and `smp_discover` (available in smp_utils or smp-utils) are required for some SES features to work.
.. warning::
**sasutils** is known to be broken with the new SAS 24Gb/s Broadcom driver mpi3mr. This driver is currently not
creating sas objects (sas_host, etc.) in sysfs, which are used by sasutils. Suggestions are welcome.
sas_counters
sas_counters reports SAS/SES/SD I/O and phy error counters and provides SAS topology information in an output suitable for Carbon/Graphite.
This command also supports SES-2 nicknames as seen in the example below (io1-sassw1 is the nickname of a SAS switch and io1-jbod1-0 is the nickname of a JBOD SIM).
.. code-block::
$ sas_counters
...
oak-io1-s1.SAS9300-8e.0x500605b00ab01234.Switch184.io1-sassw1.JB4602_SIM_0.io1-jbod1-0.bays.41.ST8000NM0075.0x5000c50084c79876.ioerr_cnt 2 1487457378
oak-io1-s1.SAS9300-8e.0x500605b00ab01234.Switch184.io1-sassw1.JB4602_SIM_0.io1-jbod1-0.bays.41.ST8000NM0075.0x5000c50084c79876.iodone_cnt 7154904 1487457378
oak-io1-s1.SAS9300-8e.0x500605b00ab01234.Switch184.io1-sassw1.JB4602_SIM_0.io1-jbod1-0.bays.41.ST8000NM0075.0x5000c50084c79876.iorequest_cnt 7154906 1487457378
...
oak-io1-s1.SAS9300-8e.0x500605b00ab05678.Switch184.io1-sassw2.phys.15.invalid_dword_count 5 1487457378
oak-io1-s1.SAS9300-8e.0x500605b00ab05678.Switch184.io1-sassw2.phys.15.loss_of_dword_sync_count 1 1487457378
oak-io1-s1.SAS9300-8e.0x500605b00ab05678.Switch184.io1-sassw2.phys.15.phy_reset_problem_count 0 1487457378
oak-io1-s1.SAS9300-8e.0x500605b00ab05678.Switch184.io1-sassw2.phys.15.running_disparity_error_count 1 1487457378
...
sas_discover
Display SAS topology. By default, sas_discover tries to fold common devices (like disks). Use -v, -vv or -vvv and --addr to display more details.
Below is an example with a large topology with multiple SAS HBAs, SAS switches and SAS JBODs.
.. code-block::
$ sas_discover -v
oak-io8-s2
|--host1 HBA 9500-16e
| `--8x--expander-1:0 ASTEK
| |--1x--end_device-1:0:0
| | `--enclosure io8-sassw2 ASTEK
| |--4x--expander-1:1 HGST
| | |--1x--end_device-1:1:0
| | | `--enclosure io8-jbod1 HGST
| | |--10x--expander-1:9 HGST
| | | `-- 50 x end_device -- disk
| | `--10x--expander-1:10 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:2 HGST
| | |--1x--end_device-1:2:0
| | | `--enclosure io8-jbod2 HGST
| | |--10x--expander-1:11 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:12 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:3 HGST
| | |--1x--end_device-1:3:0
| | | `--enclosure io8-jbod3 HGST
| | |--10x--expander-1:13 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:14 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:4 HGST
| | |--1x--end_device-1:4:0
| | | `--enclosure io8-jbod4 HGST
| | |--10x--expander-1:15 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:16 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:5 HGST
| | |--1x--end_device-1:5:0
| | | `--enclosure io8-jbod5 HGST
| | |--10x--expander-1:17 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:18 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:6 HGST
| | |--1x--end_device-1:6:0
| | | `--enclosure io8-jbod6 HGST
| | |--10x--expander-1:19 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:20 HGST
| | `-- 51 x end_device -- disk
| |--4x--expander-1:7 HGST
| | |--1x--end_device-1:7:0
| | | `--enclosure io8-jbod7 HGST
| | |--10x--expander-1:21 HGST
| | | `-- 51 x end_device -- disk
| | `--10x--expander-1:22 HGST
| | `-- 51 x end_device -- disk
| `--4x--expander-1:8 HGST
| |--1x--end_device-1:8:0
| | `--enclosure io8-jbod8 HGST
| |--10x--expander-1:23 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-1:24 HGST
| `-- 51 x end_device -- disk
`--host10 HBA 9500-16e
`--8x--expander-10:0 ASTEK
|--1x--end_device-10:0:0
| `--enclosure io8-sassw1 ASTEK
|--4x--expander-10:1 HGST
| |--1x--end_device-10:1:0
| | `--enclosure io8-jbod1 HGST
| |--10x--expander-10:9 HGST
| | `-- 50 x end_device -- disk
| `--10x--expander-10:10 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:2 HGST
| |--1x--end_device-10:2:0
| | `--enclosure io8-jbod2 HGST
| |--10x--expander-10:11 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:12 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:3 HGST
| |--1x--end_device-10:3:0
| | `--enclosure io8-jbod3 HGST
| |--10x--expander-10:13 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:14 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:4 HGST
| |--1x--end_device-10:4:0
| | `--enclosure io8-jbod4 HGST
| |--10x--expander-10:15 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:16 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:5 HGST
| |--1x--end_device-10:5:0
| | `--enclosure io8-jbod5 HGST
| |--10x--expander-10:17 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:18 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:6 HGST
| |--1x--end_device-10:6:0
| | `--enclosure io8-jbod6 HGST
| |--10x--expander-10:19 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:20 HGST
| `-- 51 x end_device -- disk
|--4x--expander-10:7 HGST
| |--1x--end_device-10:7:0
| | `--enclosure io8-jbod7 HGST
| |--10x--expander-10:21 HGST
| | `-- 51 x end_device -- disk
| `--10x--expander-10:22 HGST
| `-- 51 x end_device -- disk
`--4x--expander-10:8 HGST
|--1x--end_device-10:8:0
| `--enclosure io8-jbod8 HGST
|--10x--expander-10:23 HGST
| `-- 51 x end_device -- disk
`--10x--expander-10:24 HGST
`-- 51 x end_device -- disk
Use sas_discover --counters to display the number of SCSI commands issued (req), completed or rejected (done) and the ones that completed with an error (error).
.. image:: https://raw.githubusercontent.com/stanford-rc/sasutils/master/doc/examples/sas_discover_counters_tape.svg
sas_devices
Zeroconf tool that scans SAS devices and resolves associated enclosures. Useful to quickly check cabling and hardware setup.
When used with -v, sas_devices will also display all disk devices with serial numbers.
The following example shows a proper detection of a 60-disk JBOD with 2 SIMs/IOMs (an "enclosure g
