find_md_arrays(disk)
disk[:disks].each do |disk|
- if disk[:vendor] =~ /^CVPR/ && disk[:model] == "INTEL"
+ if disk[:vendor] =~ /^(BTWA|CVPR|PHDV)/ && disk[:model] == "INTEL"
disk[:model] = disk[:serial_number]
disk[:serial_number] = disk[:vendor]
disk[:vendor] = "INTEL"
controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0")
elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:3:0/*:3:0:0/scsi_generic/sg*").first
controller[:device] = "/dev/#{File.basename(device)}"
- elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:0/scsi_generic/sg*").first
+ elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:*/scsi_generic/sg*").first
controller[:device] = "/dev/#{File.basename(device)}"
end
end
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
- when "Spun Up" then disk[:spun_down] = false
- when "Spun down" then disk[:spun_down] = true
+ when "Failed" then disk[:status] = "failed"
+ when "Spun Up" then disk[:state] = "spun_up"
+ when "Spun down" then disk[:state] = "spun_down"
end
end
elsif disk && line =~ /^(\S.*\S)\s*:\s+(\S.*)$/
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
+ when "Failed" then disk[:status] = "failed"
when "Spun Up" then disk[:state] = "spun_up"
when "Spun down" then disk[:state] = "spun_down"
end
array[:disks].map! do |location|
disk = disks.find { |disk| disk[:location] == location }
+ controller_number = controller[:number] - 1
device_number = disk[:device_number]
- device = Dir.glob("#{host}/device/target*:1:#{device_number}/*:1:#{device_number}:0/scsi_generic/*").first
disk[:device] = "/dev/#{File.basename(device)}"
+ disk[:smart_device] = "aacraid,#{controller_number},0,#{device_number}"
disk[:arrays] << array[:id]
disk[:id]