SCSI Enclosure Services (SES)

Functional Redundancy

The original Berkeley paper by Patterson Gibson and Katz described a method for implementing fault tolerance at the device level by utilizing various redundancy schemes. Through the efforts of the industry and the RAID Advisory Board (RAB) this redundancy has been extended into device enclosures by applying similar redundant schemes to critical components such as Cooling Modules and Power Supplies that is known as Functional Redundancy. The SCSI-3 Enclosure Services Command Set (SES) offers a way of sensing device status and with suitable software, a series of alert mechanisms can be sent to administrators. RAID set events and status can be monitored. An example of this includes a device, which is participating in a rebuild operation.

Enclosure Components

Before discussing SES in some detail, it is necessary to discuss the components that make up an enclosure device. Figure 1 shows a device enclosure with N+1 cooling, N+1 Power Supplies and Dual A/C inputs. Devices such as cooling devices will have various attributes. A simple cooling device would have two states – functional and non-functional. A more advanced cooling device would have variable fan speeds. It could respond to different temperature thresholds by increasing the motor speed. Power Supply Units would have voltage threshold limits, for example if the 12-volt line were to vary by +-5% an alert could be sent to the administrator. Devices such as disks will have attributes such as whether the device can be removed or inserted into an enclosure, whether a fault exists and the status of the port bypass circuit (if applicable).

Figure 1 Device Enclosure

A hardware-monitoring device is available which has sensors to report on device status and the environmental characteristics such as temperature.

RAID Controller Organization

In addition, a RAID system provides one or more controllers to perform the RAID functionality. In the case of a dual controller system, the controllers may be configured as Active/Passive where one controller handles the complete workload with the other standing by as a backup. In the case of a failure with the primary controller, the standby will take over. A better method is to have both controllers configured as an Active/Active configuration. In this mode, the workload is split and better utilization occurs. If either controller fails then the surviving member will manage the total I/O demands.

SES via an Enclosure Services Device

The SCSI Enclosure Command Set is used to obtain the status of components within the enclosure and to turn on indicators or set various states within the components. There are two methods of obtaining enclosure information. One method uses an Enclosure Services Device to access environmental information while the other uses an intermediary non-Enclosure Services Device to access the information. The Device appears as a peripheral and is addressed in a similar fashion to other peripheral devices.

Figure 2 shows an enclosure services device which is directly accessed by an Application Client. The Enclosure Services Device responds as a SCSI device and will respond to an INQUIRY command by setting the ENCSERV bit, which indicates that the device can handle information relating to enclosures.

Figure 2 Enclosures Services Device

SES via a non Enclosure Services Device

This method uses a peripheral device such as a disk to transport enclosure data to and from the Application Client. The Enclosure Services Device does not appear on the peripheral bus and cannot be directly accessed. This intermediate device will use the SCSI SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULTS commands to set status or obtain status information within the enclosure. Initially the application will ask the peripheral device if an Enclosure Services Device is actually connected to it. Figure 49 shows how this is implemented.

Figure 3 Access via a non-Enclosure Services Device

SCSI Commands used with Enclosure Services Devices

Table 1 shows the mandatory commands that must be implemented by enclosure services devices.

Table 1 Mandatory Commands for Enclosure Services Device

Command Operation Code

Optional commands are shown in Table 2.

Table 2 Optional Commands for Enclosure Services Device

Command Operation Code
MODE SELECT (10) 55h
RELEASE (6) 17h
RELEASE (10) 57h
RESERVE (6) 16h
RESERVE (10) 56h

Enclosure Services Device Pages

An Enclosure Services Device communicates information by a set of Diagnostic Page Codes. Some of the more relevant pages are now described.

Configuration Page

The Configuration Page (Page Code 01h) is used to return a list of elements that are found in an enclosure. Each of these elements is described by a header, which defines the number of element types that are supported within the enclosure. Each type has an eight bit code which identifies the element being described.. Typical devices found in an enclosure include Power Supplies, Cooling Modules, Temperature Sensors, Door Locks and Audible Alarms. These elements have the byte codes 02h, 03h, 04h, 05h and 06h respectively. There is another field, which denotes the number of elements of a specified type in an enclosure. The Application Client will read this information from the Configuration Page by issuing a RECEIVE DIAGNOSTIC RESULTS Command.

Enclosure Control Page

This page is used by the Application Client to control the elements that were listed when the Configuration Page was read. The client can set bits to denote the following four states for element types:

  • Information
  • Non Critical
  • Critical
  • Unrecoverable

Enclosure Status Page

This page is used to return the status of the elements listed in the Configuration Page. There is an overall status, which lists the status for a particular group of elements and an individual element status field for each instance of a particular device type.

Pages relevant to Storage Arrays

Array Control Page

This page is similar to the Enclosure Control Page but defines information relating to the status of a device when it participates within an Array. Defined indicated states for a device include the following:

  • Hot Spare
  • Device is participating in a critical array
  • Device is a member of an array that has failed
  • Device is participating in a rebuild operation
Array Status Page

This page is similar to the Enclosure Status Page but returns information relating to the status of a device as described in the paragraph relating to the Array Control Page.

Programming Information

This section details how C code could be implemented to read the enclosure configuration:

Read enclosure configuration:

Char cdb[6]    = {(char)SCSI_RCV_DIAG,(char)0x01,(char)SES_PAGE_CONFIGURATION,


/* Send the 6-byte CDB & receive the data in response */

/* Zero all fields */



* Setup the SRB


srb.SRB_Cmd        =    SC_EXEC_SCSI_CMD;

srb.SRB_HaId        =    scsi->adapter;

srb.SRB_Target    =    scsi->scsi;

srb.SRB_Lun        =    scsi->lun;

srb.SRB_CDBLen    =    cdblen;


/* Read */

srb.SRB_BufLen    =    *destlen;

srb.SRB_BufPointer=    dest;

srb.SRB_Flags    =    SRB_DIR_IN | SRB_EVENT_NOTIFY;

srb.SRB_SenseLen    =    SENSE_LEN;

srb.SRB_PostProc    =    ASPICompletionEvent;


ASPIStatus        =    SendASPI32Command( (LPSRB) &srb);

/* Record the types and counts of each element type */

To read the enclosure status page:

char    cdb[6]    =    {(char)SCSI_RCV_DIAG,(char)0x01,(char)SES_PAGE_ENCLOSURE,(char)SES_MAX_XFER_SIZE_MSB,(char)SES_MAX_XFER_SIZE_LSB,(char)0x00};

/* Send the 6-byte CDB & receive the data in response*/

Comments and suggestions for future articles welcome!

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.