Converting disk back to Ready state from Non-Raid or Foreign on a Dell RAID controller (BASH)

If you're unable to create a new vdisk on Dell raid, and are getting something like the following

omconfig storage controller action=createvdisk controller=0 raid=r0 pdisks=0:1:25 size=max
The virtual disk cannot be created on the physical disks you selected. 
Possible reasons include: Insufficient disk space, available disks are not initialized, incorrect number of 
disks selected, unsupported RAID level selection, unsupported mix of SAS and SATA type disks, 
unsupported mix of SSD and HDD type disks, unsupported mix of 512Bytes a 4KBytes sector size disks, 
unsupported mix of PI capable and incapable type disks, controller restrictions or 
unsupported configuration

Then one possibility is that your replacement disk isn't in the "Online" state, and instead is showing as either "Foreign" or "Non-Raid"

omreport storage pdisk controller=0 |grep -E '^ID|State' | grep -A1 "0:1:25"
ID : 0:1:25
State : Non-RAID

omreport storage pdisk controller=0 |grep -E '^ID|State' | grep -A1 "0:1:24"
ID : 0:1:24
State : Foreign

These states have the following meanings

  • Non-Raid - The disk has previously been configured to be a non-RAID disk by a dell controller
  • Foreign - The disk has previously been part of a RAID array, but not one recognised by the controller (likely a disk repurposed from some other machine)

This documentation details how to revert both statuses back to "Ready" so the disk can be added to an array

Details

  • Language: BASH

Snippet

# Convert disk from Non-RAID to Ready state
omconfig storage pdisk action=convertnonraidtoraid controller=[id] pdisk=[disk address]

# Clear Foreign configs
omconfig storage controller action=clearforeignconfig controller=id

Usage Example

# Convert disk 0:1:25 from Non-RAID to Ready state
omconfig storage pdisk action=convertnonraidtoraid controller=0 pdisk=0:1:25

# Clear Foreign configs from all foreign disks on controller 0
omconfig storage controller action=clearforeignconfig controller=0