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

RFE: Add ability to control LEDs of drives behind RAID adapters #522

Open tasleson opened 1 year ago

tasleson commented 1 year ago

Some raid adapters, like those that use the storcli (megaraid) management utility have the ability to control identification LEDs.

eg.

storcli /cx/ex/sx start locate
storcli /cx/ex/sx stop locate

The library API could be extended to add support for this by adding something like:

def disk_ident_led_on(self, disk, flags=FLAG_RSVD)
def disk_ident_led_off(self, disk, flags=FLAG_RSVD)
int LSM_DLL_EXPORT lsm_disk_ident_led_on(lsm_connect *conn,
                                           lsm_disk *disk, lsm_flag flags);
int LSM_DLL_EXPORT lsm_disk_ident_led_off(lsm_connect *conn,
                                           lsm_disk *disk, lsm_flag flags);

Adding this would resolve: https://github.com/libstorage/libstoragemgmt/issues/479

napaster commented 1 year ago

Faced similar. We have in stock 5e:00.0 Serial Attached SCSI controller: Broadcom / LSI SAS3216 PCI-Express Fusion-MPT SAS-3 (rev 01) We are trying to make the baskets blink on it with the following command: lsmcli local-disk-ident-led-on --path /dev/sda in response we get this NO_SUPPORT(153): Failed to find any SCSI enclosure with given SAS address 30016360026ef024

at the same time command: storcli /c0/s14 start locate

works great:

CLI Version=007.2405.0000.0000 Sep 28, 2022
Operating system = Linux 4.18.0-448.el8.x86_64
Controller = 0
status=success
Description = Start Drive Locate Succeeded
storcli version:
StorCli SAS Customization Utility Ver 007.2405.0000.0000 Sep 28, 2022
    (c)Copyright 2022, Broadcom Inc. All Rights Reserved.
lsmcli --version
/bin/lsmcli 1.9.6
BenoitKnecht commented 11 months ago

@napaster Have you tried exposing the enclosure to the OS? In my case I was using perccli, but the same commands should work with storcli:

# perccli /c0 set backplane expose=on

You can check if it's already exposed with

# perccli /c0 show backplane | grep ^Expose
Expose Backplane ON

Now you should see the enclosure in the output of lsscsi:

# lsscsi | grep enclosu
[0:0:64:0]   enclosu DP       BP_EXP           1.61  -

And lsmcli shouldn't return that error anymore.