Commit f23718f6 authored by MICHON Nicolas's avatar MICHON Nicolas
Browse files

[dev] Added net adapters mappings file for predictable/legacy and added...

[dev] Added net adapters mappings file for predictable/legacy and added support in postprocessing.rb
parent 9db139a4
---
chetemi:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
chifflet:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
dahu:
enp24s0f0: eth0
enp24s0f1: eth1
econome:
eno1: eth2
eno2: eth3
enp3s0f0: eth0
enp3s0f1: eth1
ecotype:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
granduc:
eno1: eth0
eno2: eth1
enp13s0f0: eth2
enp13s0f1: eth3
graoully:
eno1: eth0
eno2: eth1
eno3: eth4
eno4: eth5
enp129s0f0: eth2
enp129s0f1: eth3
graphene:
enp3s0: eth0
enp4s0: eth1
enp5s0: eth2
graphique:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
graphite:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
grele:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
griffon:
enp15s0f0: eth0
enp15s0f1: eth1
grimani:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
grimoire:
eno1: eth0
eno2: eth1
eno3: eth4
eno4: eth5
enp129s0f0: eth2
enp129s0f1: eth3
grisou:
eno1: eth0
eno2: eth1
eno3: eth4
eno4: eth5
enp129s0f0: eth2
enp129s0f1: eth3
enp3s0f0: eth2
enp3s0f1: eth3
grvingt:
enp24s0f0: eth0
enp24s0f1: eth1
hercule:
eno1: eth2
eno2: eth3
enp130s0f0: eth0
enp130s0f1: eth1
nova:
eno1: eth2
eno2: eth3
eno3: eth4
eno4: eth5
enp5s0f0: eth0
enp5s0f1: eth1
orion:
eno1: eth2
eno2: eth3
eno3: eth4
eno4: eth5
enp68s0f0: eth0
enp68s0f1: eth1
paranoia:
eno1: eth2
eno2: eth3
enp3s0f0: eth0
enp3s0f1: eth1
parapide:
enp4s0f0: eth0
enp4s0f1: eth1
parapluie:
enp3s0f0: eth2
enp3s0f1: eth3
enp4s0f0: eth0
enp4s0f1: eth1
parasilo:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
paravance:
eno1: eth0
eno2: eth1
eno3: eth2
eno4: eth3
petitprince:
eno1: eth0
eno2: eth1
sagittaire:
enp2s2f0: eth0
enp2s2f1: eth1
suno:
eno1: eth0
eno2: eth1
taurus:
eno1: eth2
eno2: eth3
eno3: eth4
eno4: eth5
enp68s0f0: eth0
enp68s0f1: eth1
uvb:
eno1: eth0
eno2: eth1
yeti:
eno113: eth0
eno114: eth1
eno115: eth2
eno116: eth3
#Manual entries for nodes which mapping is different from cluster default
granduc-12:
enp13s0f0: eth3
enp13s0f1: eth2
granduc-16:
enp13s0f0: eth3
enp13s0f1: eth2
......@@ -18,6 +18,13 @@ end
puts 'Postprocessing of output/. Copying files into ../../input/'
net_adapter_names_mapping = YAML::load_file("net_names_mapping.yaml")
if (net_adapter_names_mapping == false)
puts "failed to load net adapters mappings 'net_names_mapping.yaml'"
exit 1
end
list_of_yaml_files = Dir['output/*.y*ml'].sort_by { |x| -x.count('/') }
list_of_yaml_files.each { |filename|
begin
......@@ -32,14 +39,30 @@ list_of_yaml_files.each { |filename|
next
end
puts "Post-processing node uid = #{node_uid}"
hash["storage_devices"] = hash["storage_devices"].sort_by_array(["sda", "sdb", "sdc", "sdd", "sde"])
hash["storage_devices"].each {|k, v| v.delete("device") }
hash['network_adapters'].each { |net_adapter_name, net_adapter|
remaped_net_names = []
hash['network_adapters'].each { |net_name, net_adapter|
net_adapter.delete("enabled")
net_adapter.delete("mounted")
net_adapter.delete("mountable")
net_adapter.delete("rate") if net_adapter["rate"] == 0
if (net_adapter_names_mapping[node_uid] && net_adapter_names_mapping[node_uid][net_name])
#Priority of node-specific mapping instead of default cluster mapping
remaped_net_names << [net_name, net_adapter_names_mapping[node_uid][net_name]]
elsif (net_adapter_names_mapping[cluster_uid] && net_adapter_names_mapping[cluster_uid][net_name])
remaped_net_names << [net_name, net_adapter_names_mapping[cluster_uid][net_name]]
end
}
# Changing net_adapter key from predictable name to legacy name
remaped_net_names.each { |arr|
hash['network_adapters'][arr[1]] = hash['network_adapters'][arr[0]]
hash['network_adapters'].delete(arr[0])
}
hash["network_adapters"] = hash["network_adapters"].sort_by_array(["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth6", "ib0", "ib1", "ib2", "ib3", "bmc"])
......@@ -59,6 +82,6 @@ list_of_yaml_files.each { |filename|
}
rescue Exception => e
puts "#{node_uid} - #{e.class}: #{e.message}"
puts "#{node_uid} - #{e.class}: #{e.message}\nError: #{e.backtrace}"
end
}
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