1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5269: get network PCI in FSCK (#892)

(cherry picked from commit dad1dc8eb719948305822b0171fc32a276819a30)
This commit is contained in:
Alejandro Huertas Herrero 2021-03-01 10:32:33 +01:00 committed by Ruben S. Montero
parent 6930839e87
commit d8e7464dc4
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -44,10 +44,19 @@ module OneDBFsck
# DATA: VNets used by this VM
nics = vm_doc.root.xpath("TEMPLATE/NIC")
# Nic Alias used by this VM
vm_doc.root.xpath("TEMPLATE/NIC_ALIAS").each do |nic|
nics << nic
end
# NIC PCI used by this VM
vm_doc.root.xpath('TEMPLATE/PCI').each do |nic|
next unless nic.xpath('NETWORK_ID')
nics << nic
end
nics.each do |nic|
net_id = nil
nic.xpath("NETWORK_ID").each do |nid|
@ -59,6 +68,7 @@ module OneDBFsck
log_error("VM #{row[:oid]} is using VNet #{net_id}, "<<
"but it does not exist", false)
else
mac = nic.at_xpath("MAC").nil? ? nil : nic.at_xpath("MAC").text
ar_id_e = nic.at_xpath('AR_ID')