Project

General

Profile

Actions

Bug #21479

open

Multiple discovered hosts with same MAC address

Added by Lukas Zapletal over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Discovery plugin
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

We don't have an unique index on DB level, just in Rails level and a second NIC with same MAC can sneak in. The relevant code in core is:

validate :mac_uniqueness, :if => Proc.new { |nic| nic.managed? && nic.host && nic.host.managed? && !nic.host.compute? && !nic.virtual? && nic.mac.present? }

which will not trigger for Discovery at all (host is not managed). In discovery we try to search for existing host and if not found, we will create new discovered host. This does not work correctly, we have turned off validator for some reason:

host.save(:validate => false) if host.new_record?

So the validation for uniqueness won't hit.

No data to display

Actions

Also available in: Atom PDF