Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1384146 - [RFE] Discovery should not create an entry if the mac/serialnumber already exists as managed
[RFE] Discovery should not create an entry if the mac/serialnumber already ex...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Plugin (Show other bugs)
6.2.2
All Linux
medium Severity high (vote)
: GA
: Unused
Assigned To: Lukas Zapletal
Radovan Drazny
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-12 12:22 EDT by Josh Foots
Modified: 2018-02-21 07:35 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 07:35:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 16890 None None None 2017-04-21 10:06 EDT
Red Hat Product Errata RHSA-2018:0336 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 17:43:42 EST

  None (edit)
Description Josh Foots 2016-10-12 12:22:10 EDT
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 08:14:52 EDT
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 09:37:02 EST
This bug will be part of Satellite NEXT (stable is 6.2 at the moment).
Comment 7 pm-sat@redhat.com 2017-04-22 02:18:47 EDT
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 16:29:54 EDT
1439850
Comment 10 Radovan Drazny 2017-10-18 09:09:01 EDT
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 07:35:52 EST
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.