Tuesday, September 29, 2015

VMWare ESXi 5.x and 6.x SCSI Sense Decoder in Excel


 This posting is for VMWare vSphere/ESXi administrators using ESXi 5.x and ESXi 6.x. If, like me, you have been wondering about the meaning of the various SCSI error codes that you may observe in the ESXi vmkernel.log file, then this is for you. I'm sure there are other tools out there that can do something similar, and there are some VMWare KB articles which describe how to decode some of the error codes, but frankly it's exceedingly tedious to perform it manually for more than a couple entries. Wouldn't it be nice if you could just copy and paste out one of those entries, such as the ones below and have it converted into "human readable" format? Now you can.

2015-04-04T21:07:30.305Z cpu3:2050)ScsiDeviceIO: 2319: Cmd(0x4124084300) 0x12, CmdSN 0x55 to dev "naa.60000970000335800219533583923245" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0

Dec 6  20:44:24 esx505 vmkernel: 3:11:39:55.071 cpu4:4200)ScsiDeviceIO: 1548: Command 0x2a to device "naa.60000970000348700483133031384245" failed H:0xc D:0x0 P:0x0 Possible sense data: 0x5 0x24 0x0
 
So the first instance decodes as follows:

Host
0
NO error
Device
CHECK CONDITION
Plugin
No error.
Sense Key
ILLEGAL REQUEST
ASC
24
24/00
ASCQ
0


 
The second one decodes like this:

Host
c
VMK_SCSI_HOST_RETRY*
Device
GOOD
Plugin
No error.
Sense Key
ILLEGAL REQUEST
ASC
24
24/00
ASCQ
0


I've cobbled together an Excel document where you can just paste in the text of the SCSI error code from the log entry and it decodes as shown above. It's not particularly elegant - it still requires some polishing but for now, it get's the job done. 

The document contains SCSI lookup tables from the T10 standards, and I am not aware of any restrictions on storing that information in a document such as this, but if there are any, do let me know.

The spreadsheet is available from the following link:

SCSI_Error_Code_Table_ESXi_v3a.xlsx


Edit: I noticed that Florian Grehl has a very nice online version of a decoder as well. Feel free to use whichever one suits you best. I'm certainly interested if you find any different results.