Bug 1384146 - [RFE] Discovery should not create an entry if the mac/serialnumber already exists as managed
Summary: [RFE] Discovery should not create an entry if the mac/serialnumber already ex...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.2.2
Hardware: All
OS: Linux
medium
high
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Radovan Drazny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-12 16:22 UTC by Josh Foots
Modified: 2019-08-12 14:53 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 12:35:52 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16890 0 Low Closed Prevent host discovery for existing MAC/IP addresses 2020-04-02 10:01:20 UTC
Red Hat Product Errata RHSA-2018:0336 0 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 22:43:42 UTC

Description Josh Foots 2016-10-12 16:22:10 UTC
Description of problem:

Discovery image should not create an entry in the discovered hosts table if the mac/serialnumber already exists in the hosts table.

Comment 1 Lukas Zapletal 2016-10-21 12:14:52 UTC
Josh, can you describe the motivation in more detail? You can encounter two MAC addresses in one deployment, I don't see a reason why to prevent from that. If the host will be provisioned in a different subnet, than this constraint could be problem.

Not sure about serial number, not all servers provide those.

Comment 6 Lukas Zapletal 2017-02-24 14:37:02 UTC
This bug will be part of Satellite NEXT (stable is 6.2 at the moment).

Comment 7 pm-sat@redhat.com 2017-04-22 06:18:47 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16890 has been resolved.

Comment 9 pm-sat@redhat.com 2017-06-01 20:29:54 UTC
1439850

Comment 10 Radovan Drazny 2017-10-18 13:09:01 UTC
Verified on Satellite 6.3 Snap 20. 

Using the foreman-discovery-image-3.1.1-22, doing PXEless discovery:

1. Have some previously registered (content) host
2. Boot a virtual system using the foreman-discovery image, go through the discovery process, and check the Hosts->Discovered hosts table. The system that was just discovered should be present.
3. Just to be sure, modify the virtual system HW (add some memory or virtual HDD), and try to re-run the discovery procedure. The discovered system should be updated, not duplicated.
4. Remove the discovered host.
5. Edit previously registered host, and change its MAC address to MAC address of the virtual system. 
6. Try to re-run the discovery process on the virtual system. Instead of the success message, the process will loop back to the start of the IP address configuration wizard. There is the following message in /var/log/foreman/production.log:

Host discovery failed, facts: {"lib"=>"/usr/share/fdi/facts:/opt/extension/facts", "virtual"=>"kvm", "is_virtual"=>true, "architecture"=>"x86_64", "hardwaremodel"=>"x86_64", "os"=>{"name"=>"RedHat"
, "family"=>"RedHat", "release"=>{"major"=>"7", "minor"=>"3", "full"=>"7.3"}}, "network_ens9"=>"192.168.122.0", "network_lo"=>"127.0.0.0", "hardwareisa"=>"x86_64", "physicalprocessorcount"=>1, "netmask"=>"255.255.255.0", "memorysize"=>"
992.57 MB", "memorysize_mb"=>"992.57", "ps"=>"ps -ef", "fqdn"=>"fdi", "uniqueid"=>"a8c07b7a", "dhcp_servers"=>{"system"=>"192.168.122.1", "ens9"=>"192.168.122.1"}, "hostname"=>"fdi", "macaddress"=>"52:54:00:b4:c4:03", "bios_vendor"=>"Se
aBIOS", "bios_version"=>"1.10.2-1.fc26", "bios_release_date"=>"04/01/2014", "manufacturer"=>"QEMU", "productname"=>"Standard PC (i440FX + PIIX, 1996)", "serialnumber"=>"Not Specified", "uuid"=>"9C322EB1-C718-4816-98C2-11C81247857A", "ty
pe"=>"Other", "selinux"=>false, "interfaces"=>"ens9,lo", "ipaddress_ens9"=>"192.168.122.123", "macaddress_ens9"=>"52:54:00:b4:c4:03", "netmask_ens9"=>"255.255.255.0", "mtu_ens9"=>1500, "ipaddress_lo"=>"127.0.0.1", "netmask_lo"=>"255.0.0
.0", "mtu_lo"=>65536, "gid"=>"root", "id"=>"root", "ipaddress"=>"192.168.122.123", "processors"=>{"models"=>["Intel Core Processor (Haswell, no TSX)"], "count"=>1, "physicalcount"=>1}, "processor0"=>"Intel Core Processor (Haswell, no TS
X)", "processorcount"=>1, "facterversion"=>"2.4.6", "blockdevice_sr0_size"=>218103808, "blockdevice_sr0_vendor"=>"QEMU", "blockdevice_sr0_model"=>"QEMU DVD-ROM", "blockdevice_vda_size"=>3221225472, "blockdevice_vda_vendor"=>"0x1af4", "b
lockdevices"=>"sr0,vda", "discovery_version"=>"3.1.1", "discovery_release"=>"20170323.1", "discovery_bootif"=>"52:54:00:b4:c4:03", "discovery_bootip"=>"192.168.122.123", "speed_ens9"=>"100", "duplex_ens9"=>"full", "port_ens9"=>"MII", "a
uto_negotiation_ens9"=>"true", "wol_ens9"=>false, "link_ens9"=>"true", "link_lo"=>"true", "discovery_kexec"=>"kexec-tools 2.0.7 released 05 September 2016\n", "discovery_ip_cidr"=>"192.168.122.123/24", "discovery_ip"=>"192.168.122.123",
 "discovery_netmask"=>"255.255.255.0", "discovery_gateway"=>"192.168.122.1", "discovery_dns"=>"192.168.122.1", ""=>""}

7. Change the MAC address of the previously registered host to the original value.
8. Re-run the discovery process on the virtual system. It will be successful this time.

VERIFIED

Comment 13 errata-xmlrpc 2018-02-21 12:35:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.