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)

This commit is contained in:
Alejandro Huertas Herrero 2021-03-01 10:32:33 +01:00 committed by GitHub
parent 4a35ca7c71
commit dad1dc8eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,10 +54,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|
@ -69,6 +78,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')