Testing Surprise Removal of NVMe Devices
By: Stephen Hynes | Sept. 16, 2019 | SANBlaze
When testing your drives, you can make it more convenient to test “surprise removal” without actually having to physically remove the drive. With SANBlaze you can do this remotely, right from your keyboard, without ever walking into the server room.
In other words, we can kill the power to any drive through the software. The following command removes power from the drive (surprise removal):
sb_i2c -d 6 -f POWER_ -w 1
Notice that the LED for Pwr on Drive 6 is off (not lit).
Simulate that the Drive is Physically Gone
This command removes the PRESENT signal (as if the drive is now physically not there) in the SANBlaze-RM and RM4:
sb_i2c -d 6 -f IOX_DIS_PRSNT0_L -w 0
Notice that the background color behind slot number 6 is now white not yellow, indicating there is no present signal. According to the software, the drive is “physically” gone.
Bringing the Drive Back
Now, to bring the drive back, you can enable present:
sb_i2c -d 6 -f IOX_DIS_PRSNT0_L -w 1
This command (assuming there is an actual drive in slot 6) will hot plug "button" the drive (graceful removal/replacement):
sb_i2c -d 6 -b
The drive is now back. Note the color changes to GREEN indicating Present and Link, and Pwr LED is Green indicating the drive has power.
You can also glitch PERST using -w 3 which does a quick on/off, like this:
sb_i2c -d 6 -f IOX_PORT0_PERST_L -w 3
INFO: System 1 SBExpress-RM4 SN=930A9050002 Rev=R03 i2c=/dev/i2c-4 AtlasPort=/dev/ttyACM0 MI_i2c=/dev/i2c-5 VLUN_Port=0
Feature IOX_PORT0_PERST_L value=3, oneshot action
INFO: 06L[0x62] 0x06[01:00] IOX_PORT0_PERST_L Def=0x01 Cur=0x00
INFO: 06L[0x62] 0x06[01:00] IOX_PORT0_PERST_L Def=0x01 Cur=0x01
Or -w 0 will hold the device in reset and -w 1 will release reset. As you can see, SANBlaze makes it easy to emulate physical circumstances through the software so that you can easily negative test a variety of scenarios that could happen in the real world with your drives.