Commit 144baf6e authored by Alexandre MERLIN's avatar Alexandre MERLIN

[dev] get the vendor from disk_vendor_model_mapping

parent acdaa9e9
disk_vendor_model_mapping:
Dell:
- Dell Express Flash NVMe PM1725 1.6TB AIC
Dell (Raid):
- PERC 6/i Adapter
- PERC H330 Mini
- PERC H330
- PERC H730 Mini
- PERC H710
Seagate:
- ST9146802SS
- ST600MM0006
- ST600MP0005
- ST600MM0088
- ST1000NX0423
- ST373207LC
- ST373307LC
- ST9250610NS
- ST300MP0005
- ST1000NM0033-9ZM
- ST1000NX0443
- ST4000NM0295
- ST4000NM0265-2DC
- ST2000NX0463
Western Digital:
- WDC WD2502ABYS-1
- WDC WD2003FYYS-1
- WDC WD1003FBYX-1
- WD6001BKHG
- WD6002BKTG
Hitachi:
- HITACHI HUA7250S
- HUS726040ALS210
HP:
- VB0250EAVER
Toshiba:
- PX02SSF020
- PX04SHB020
- PX04SMB040
- PX05SVB048Y
- TOSHIBA MG04ACA4
- MG04SCA40ENY
Intel:
- INTEL SSDSC2BB30
- SSDSC2KG480G7R
Fujitsu:
- MAT3073NC
Samsung:
- MZ7KM240HMHQ0D3
- MZ7KM480HMHQ0D3
......@@ -96,7 +96,7 @@ def generate_reference_api
grid_path.mkpath()
write_json(grid_path.join("#{global_hash['uid']}.json"),
global_hash.reject {|k, v| k == "sites" || k == "network_equipments"})
global_hash.reject {|k, v| k == "sites" || k == "network_equipments" || k == "disk_vendor_model_mapping"})
end
puts "Generating the reference api:\n\n"
......@@ -230,6 +230,14 @@ def generate_reference_api
}
node.delete("status")
# Add vendor info to storage
node["storage_devices"].each do |key, hash|
matching_vendor = global_hash['disk_vendor_model_mapping'].select {|_, v| v.include? hash["model"] }
raise "Model \"#{hash["model"]}\" don't match any vendor in input/grid5000/disks.yaml" if matching_vendor.empty?
raise "Model \"#{hash["model"]}\" specify in multiple vendors: #{matching_vendor.keys} in input/grid5000/disks.yaml" if matching_vendor.length > 1
hash['vendor'] = matching_vendor.keys.first
end
# Type conversion
node["network_adapters"].each { |key, hash| hash["rate"] = hash["rate"].to_i if hash["rate"].is_a?(Float) }
......
......@@ -2,3 +2,4 @@ uid: string
sites: required_hash
network_equipments: optional_hash
vlans: required_hash
disk_vendor_model_mapping: required_hash
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment