libstorage / libstoragemgmt

A library for storage management
https://libstorage.github.io/libstoragemgmt-doc/
GNU Lesser General Public License v2.1
83 stars 32 forks source link

Unable to ident using lsmcli #479

Open xxedgexx opened 3 years ago

xxedgexx commented 3 years ago

lsmcli local-disk-ident-led-on --path /dev/sdh NO_SUPPORT(153): Failed to find any SCSI enclosure with given SAS address 5002538b71401ba2

lsmcli ldl Path | SCSI VPD 0x83 | Link Type | Serial Number | Health Status

/dev/sdb | 5000039ab84be73d | SAS | 21N0A00UFWZB | Good /dev/sdc | 5000039ab84b9dcd | SAS | 21M0A0DKFWZB | Good /dev/sdd | 5000039ab84be7e9 | SAS | 21N0A01CFWZB | Good /dev/sde | 5000039ab84be741 | SAS | 21N0A00VFWZB | Good /dev/sdf | 5002538b01247530 | SAS | S5G0NE0R200157 | Good /dev/sdg | 5000039ab84be6cd | SAS | 21N0A00GFWZB | Good /dev/sdh | 5002538b71401ba0 | SAS | S5G0NG0R400306 | Good /dev/sda | 50024e9203c59608 | PATA/SATA | S2M3J90ZB18180 | Good

01:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS3216 PCI-Express Fusion-MPT SAS-3 (rev 01)

tasleson commented 3 years ago

@xxedgexx Sorry for the delayed response. The error is indicating that no SCSI enclosure service were found for the device specified, but it's likely that you don't have any. To check, try running lsscsi -g and see if any devices are listed as an enclosure.

Normally I would suggest investigating a libStorageMgmt plugin for the RAID adapter, but the megaraid plugin does not support LED identification. You may want to give the ledmon tool a try to see if you have success with that as it implements a number of different standards for interacting with LED indicators.

hansbogert commented 2 years ago

I have the exact same thing as in the OP.

@xxedgexx Sorry for the delayed response. The error is indicating that no SCSI enclosure service were found for the device specified, but it's likely that you don't have any. To check, try running lsscsi -g and see if any devices are listed as an enclosure.

Not sure about @xxedgexx, but I only have disks listed, not enclosures

Normally I would suggest investigating a libStorageMgmt plugin for the RAID adapter, but the megaraid plugin does not support LED identification.

Then what would be necessary? Is lsscsi and the underlaying mechanisms needed for this to work plus explicit support in the megaraid plugin? Or would it suffice if this would 'just' be implemented in the megaraid plugin only?

Note, I can get leds blinking using the storcli

tasleson commented 2 years ago

The libStorageMgmt base library has support for SCSI Enclosure Services (SES). This requires hardware for operation which is commonly included with drive bay enclosures and some rack mounted server class hardware drive bays. Any LED identification that would be provided by RAID adapters would be done through the RAID solution firmware/hardware and user space code and can only be provided if exposed by vendor.

In the specific case of megaraid, support would need to be added to the megaraid plugin. Unfortunately we don't have access to hardware which would allow us to develop/test functionality. We don't have resources available to go into the lab to verify operation.

hansbogert commented 2 years ago

@tasleson is it just a matter of implementing

volume_ident_led_on()

as in the hpsa plugin? And signal that it supports Capabilities.VOLUME_LED ?

tasleson commented 2 years ago

@tasleson is it just a matter of implementing

volume_ident_led_on()

as in the hpsa plugin? And signal that it supports Capabilities.VOLUME_LED ?

Correct. It would also need to implement volume_ident_led_off(). Please do note that these API calls turn on/off for 1 or more physical devices as you pass it a volume which is comprised of 1 or more physical devices. Which may not be what you're interested in.

hansbogert commented 2 years ago

You make a good point. What would be the appropriate place to implement in order to turn on the light for, let's say /dev/sda ?

tasleson commented 2 years ago

You make a good point. What would be the appropriate place to implement in order to turn on the light for, let's say /dev/sda ?

If you're using a RAID adapter, /dev/<node name> could possibly be a logical drive comprised of 1 or more physical drives or a single physical drive if running in HBA mode. If running in RAID mode, you can't use a device node to specify a physical device behind the RAID adapter. In both modes we would need to use the plugin to run the required command, e.g. storcli /cx/ex/sx start locate.

Based on this, the only thing that seems to make sense at the moment would be to introduce a new API calls and capability which allows device LED by passing a drive object. Thus a user could retrieve all the drives for a given RAID and then use one of them as a parameter to a call to turn on/off the LED. One issue though is to correlate a disk object and a device node when run in HBA mode, could leverage vpd83.

Am I correct to assume you're running in HBA mode with each of the storage devices visible to the OS?

xxedgexx commented 2 years ago

I’m running in HBA mode.

-jeremy

On Tuesday, Oct 26, 2021 at 1:41 PM, Tony Asleson @. @.)> wrote:

You make a good point. What would be the appropriate place to implement in order to turn on the light for, let's say /dev/sda ?

If you're using a RAID adapter, /dev/ could possibly be a logical drive comprised of 1 or more physical drives or a single physical drive if running in HBA mode. If running in RAID mode, you can't use a device node to specify a physical device behind the RAID adapter. In both modes we would need to use the plugin to run the required command, e.g. storcli /cx/ex/sx start locate.

Based on this, the only thing that seems to make sense at the moment would be to introduce a new API calsl and capability which allows device LED by passing a drive object. Thus a user could retrieve all the drives for a given RAID and then use one of them as a parameter to a call to turn on/off the LED. One issue though is to correlate a disk object and a device node when run in HBA mode, could leverage vpd83.

Am I correct to assume you're running in HBA mode with each of the storage devices visible to the OS?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/libstorage/libstoragemgmt/issues/479#issuecomment-952308563), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ADEA2ILMBXIF4QHNPDTISLLUI4G7BANCNFSM5B5CCUMQ).

k0ste commented 2 years ago

The same with LSI 3008 in HBA mode

# lspci | grep SAS
03:00.0 RAID bus controller: Broadcom / LSI MegaRAID SAS-3 3008 [Fury] (rev 02)
# lsmcli ldflon --path /dev/sdb
NO_SUPPORT(153): Failed to find any SCSI enclosure with given SAS address 500056b3af2058c1