ses2led Control
1, the disk led control background and demand
Each disk in the disk array corresponds to multiple LED lights, which are commonly used to indicate the state and behavior of the disk. For example, when a disk fails to locate, the disk is missing, is online, or is reading and writing, you can control the LED lights for each drive on the enclosure via the Sasenclosre service. The first contact SES2 students may think it is more abstract, it and BMC analogy, the entire enclosure is also composed of embedded CPU (such as arm) and peripheral circuit composed of a separate system, you can complete each driveled, internal fan, power supply settings, temperature monitoring and other functions.
2, the principle and process of disk LED control
In order to unify the design of Sasexpander and enclosure, the industry has put forward unified control interface standard, including GPIO and two kinds of i²c. When the host needs to read or control the state of the enclosure internal device, HOSTCPU sends the command to the Sasexpander as initiator, The Sasexpander then transmits control commands to the controller inside the enclosure as the target through a unified interface specification, enclosure performs the final hardware operation.
Above is the data from the data link layer to see the traffic, for the upper layer of the application layer, all of its protocols and conventions are transparent, users only need to understand the specific Sasexpander supported led type and number, hardware implementation of the LED use and number, under the Linux system can be directly called Sg_ SES command.
Here is an example of what I have recently done for the LED control on Drivebay on a server. In practice I need to control the green light of any drive, which involves two issues: disk positioning and led control.
(1) How to implement disk positioning
You can specify that you control a particular disk by adding the-index parameter to the sg_ses command like Ipmitool. For example,-index=2, is to control the disk starting from the number 0 index=2, the customer can use the above options corresponding to the location of the drive to determine the corresponding relationship between the index and the disk slot, in order to achieve disk positioning.
(2) How to realize control led correct alarm
According to the author's use of the LSISASXX40 Series Expander Manual, SFF-8485 and other specifications and hardware manuals, you can see the actual use of the Drivebay there are two LEDs, the red one is used as status, The green one is used to indicate activity. Where the activityled default mode of operation is as long as the online green is always on, as long as there is read and write is green flashing. We can follow the current control of the activityled, only control the statusled. The sg_ses command helps the document to see that it supports ident, locate, fault, Devoff, insert, remove, and so on. Note that the above different operations may share the same control of the LED, such as the author of this machine, ident/locate will let the red statusled flashing, and falt/missing parameters will only let the red. To do this, the user may need to try all the actions, summarize all the possible statusled states, and then combine the upper business needs to choose the appropriate control method. For example, the author of this system, can be used as follows to use the LED lights on the drivebays:
ledtype |
status–meanning Pairs |
needto be controlled? |
Greenled (Activity LED) |
Blink-read/write ongoing Nogreen–no Read/write Ongoing
|
No |
Redled (Status LED) |
blink–locate/ident red-missing Re D-fault blinkat other frequency-tbd |
Yes |
The following are the relevant reference commands:
Lsscsi-g #确定哪个sg是expander
Sg_ses-ee
sg_ses--index=2--set=ident/dev/sg17
sg_ses--index=2--clear=active/dev/sg17
sg_ses--index=2--set=2:1/dev/sg17
sg_ses--index=2--clear=2:1/dev/sg17
Sg_ses--index=0--clear=2:1/dev/sg17
Sg_ses--index=9--clear=active/dev/sg17
Sg_ses--index=9--set=fault/dev/sg17
Sg_ses--index=8--set=locate/dev/sg17
Sg_ses--index=9--set=missing/dev/sg17
Sg_ses--index=7--set=fault/dev/sg17
Sg_ses--index=7--set=active/dev/sg17
Sg_ses--index=6--set=devoff/dev/sg17
Sg_ses--index=9--set=insert/dev/sg17
Sg_ses--index=9--set=insert/dev/sg17
Sg_ses--index=5--set=remove/dev/sg17
Sg_ses--index=4--set=dnr/dev/sg17
Sg_ses--index=3--set=ident/dev/sg17
All in all, the call to SES2 needs to be combined with specific Sasexpander specifications, board hardware design, SFF-8485 and other specifications and business all possible usercase, using the existing SG_SES/LSSCSI and other tools to carry out systematic consideration and design, To meet customer and business needs in a simple and effective manner.
3. Reference Documents and Links
Https://en.wikipedia.org/wiki/SES-2_Enclosure_Management
Https://en.wikipedia.org/wiki/SGPIO
Http://www.docin.com/p-81485148.html
Http://sg.danny.cz/sg/sg_ses.html
Http://www.alldatasheet.com/datasheet-pdf/pdf/303320/DDK/SAS-RA29-S1AA-FG.html
This article is from the "Store Chef" blog, so be sure to keep this source http://xiamachao.blog.51cto.com/10580956/1839036
SES2 LED Control