Re-Attaching a previously detached storage device

A while ago we were getting rid of some old, now unused datastores on our FC-storage, so we proceeded to unmount and remove the VMFS datastore, and then detach the LUN device through the vSphere client as described in Unpresenting a LUN in ESXi 5.x. On that note, hooray for no more claimrule mongering since ESXi 5.x!
After the whole process, I noticed that on some hosts the pseudo-device LUN 0 of an EVA storage system was also unmounted. There is no detach-option for these controllers, so I have no idea how it happened. Rescans were no good and it didn’t cause any issues, but I’d rather have it accessible again. The only problem was: There is no attach option available for these devices.

So in the end, I knew I had to resort to esxcli to re-attach the device properly.
First, checking out the device details and confirming it is turned off (Status):

# esxcli storage core device list -d naa.50001fe150081230
 naa.50001fe150081230
 Display Name: HP Fibre Channel RAID Ctlr (naa.50001fe150081230)
 Has Settable Display Name: true
 Size: 0
 Device Type: RAID Ctlr
 Multipath Plugin: NMP
 Devfs Path:
 Vendor: HP
 Model: HSV200
 Revision: 6240
 SCSI Level: 5
 Is Pseudo: true
 Status: off
 Is RDM Capable: true
 Is Local: false
 Is Removable: false
 Is SSD: false
 Is Offline: false
 Is Perennially Reserved: false
 Thin Provisioning Status: unknown
 Attached Filters:
 VAAI Status: unknown
 Other UIDs: vml.020c00000050001fe150081230485356323030

After reviewing the available commands in the esxcli storage core namespace, I ran the following 2 commands:

# esxcli storage core device set -d naa.50001fe150081230 --state=on
# esxcli storage core device setconfig -d naa.50001fe150081230 --detached=false

Btw. the latter command actually failed at first without having executed the former one before:
Device configuration failed: Sysinfo error on operation returned status : Not ready. Please see the VMkernel log for detailed error information

Now confirm that the device status is set to on again:

# esxcli storage core device list -d naa.50001fe150081230
 naa.50001fe150081230
 Display Name: HP Fibre Channel RAID Ctlr (naa.50001fe150081230)
 Has Settable Display Name: true
 Size: 0
 Device Type: RAID Ctlr
 Multipath Plugin: NMP
 Devfs Path: /vmfs/devices/genscsi/naa.50001fe150081230
 Vendor: HP
 Model: HSV200
 Revision: 6240
 SCSI Level: 5
 Is Pseudo: true
 Status: on
 Is RDM Capable: true
 Is Local: false
 Is Removable: false
 Is SSD: false
 Is Offline: false
 Is Perennially Reserved: false
 Thin Provisioning Status: unknown
 Attached Filters:
 VAAI Status: unknown
 Other UIDs: vml.020c00000050001fe150081230485356323030

The vmkernel log also indicates that the device was turned on, and in the vSphere Client it is listed as attached again. Done.

2012-10-26T14:06:36.423Z cpu5:89724)ScsiDevice: 1268: Device naa.50001fe150081230  has been turned on administratively.
2012-10-26T14:06:36.549Z cpu7:151813)Vol3: 647: Couldn't read volume header from control: Invalid handle
2012-10-26T14:06:36.549Z cpu7:151813)FSS: 4333: No FS driver claimed device 'control': Not supported
2012-10-26T14:06:36.578Z cpu1:151813)VC: 1449: Device rescan time 64 msec (total number of devices 13)
2012-10-26T14:06:36.578Z cpu1:151813)VC: 1452: Filesystem probe time 46 msec (devices probed 7 of 13)
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s