Bug 1528193
Summary: | subscription-manager register facts create duplicate interface with wrong mac for bond | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> |
Component: | Provisioning | Assignee: | satellite6-bugs <satellite6-bugs> |
Status: | CLOSED ERRATA | QA Contact: | Roman Plevka <rplevka> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.2.12 | CC: | bbuckingham, bcourt, bkearney, egolov, fgrosjea, inecas, mjia, nitthoma, ofalk, shane.r.layton |
Target Milestone: | 6.7.0 | Keywords: | Patch, Reopened, Triaged |
Target Release: | Unused | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | tfm-rubygem-katello-3.14.0-0.4.rc2 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-14 13:22:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832 |
Description
Peter Vreman
2017-12-21 09:02:42 UTC
Start situation: - Host is correctly added and has puppet facts correctly parsed Failures: - subscription-manager does nto create interface ens4f1 - subscription-manager creates a duplicate ens7f1 interface with incorrect MAC address Input facts: ----------------------------------------------------------------- vrempet@li-lc-1681 ~ $ sudo facter -p | grep -E '(interfaces|mac)' interfaces => bond0,bond0_107,ens4f0,ens4f1,ens7f0,ens7f1,lo macaddress => 1c:98:ec:61:83:30 macaddress_bond0 => 1c:98:ec:61:83:30 macaddress_bond0_107 => 1c:98:ec:61:83:30 macaddress_ens4f0 => 1c:98:ec:61:83:28 macaddress_ens4f1 => 1C:98:EC:61:83:30 macaddress_ens7f0 => 1c:98:ec:61:24:28 macaddress_ens7f1 => 1C:98:EC:61:24:30 vrempet@li-lc-1681 ~ $ sudo subscription-manager facts | grep -E 'net.interface.(bond|ens)' net.interface.bond0.107.ipv4_address: 10.92.14.169 net.interface.bond0.107.ipv4_address_list: 10.92.14.169 net.interface.bond0.107.ipv4_broadcast: 10.92.14.255 net.interface.bond0.107.ipv4_broadcast_list: 10.92.14.255 net.interface.bond0.107.ipv4_netmask: 24 net.interface.bond0.107.ipv4_netmask_list: 24 net.interface.bond0.107.mac_address: 1C:98:EC:61:83:30 net.interface.bond0.mac_address: 1C:98:EC:61:83:30 net.interface.ens4f0.mac_address: 1C:98:EC:61:83:28 net.interface.ens4f1.mac_address: 1C:98:EC:61:83:30 net.interface.ens4f1.permanent_mac_address: 1C:98:EC:61:83:30 net.interface.ens7f0.mac_address: 1C:98:EC:61:24:28 net.interface.ens7f1.mac_address: 1C:98:EC:61:83:30 net.interface.ens7f1.permanent_mac_address: 1C:98:EC:61:24:30 ... ----------------------------------------------------------------- ----------------------------------------------------------------- [crash/LI] root@li-lc-1017:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hosts/207/interfaces | jq . | grep -E '(identifier|mac)' "identifier": "bond0", "mac": "1c:98:ec:61:83:30", "identifier": "ens4f0", "mac": "1c:98:ec:61:83:28", "identifier": "ens7f0", "mac": "1c:98:ec:61:24:28", "identifier": "ens7f1", "mac": "1c:98:ec:61:24:30", "identifier": "bond0.202", "mac": "1c:98:ec:61:83:30", "identifier": "bond0.402", "mac": "1c:98:ec:61:83:30", "identifier": "bond0.107", "mac": "1c:98:ec:61:83:30", ////////////////////// Client ////////////////////// vrempet@li-lc-1681 ~ $ sudo subscription-manager clean All local data removed vrempet@li-lc-1681 ~ $ sudo subscription-manager register --org=`sudo facter -p foreman_organization` --name=`hostname -f` --activationkey=`sudo facter -p foreman_activationkey` --force The system has been registered with ID: 5ef4483a-0da9-4599-b63f-7177fd51c7a3 ... Product Name: Red Hat Enterprise Linux Server Status: Subscribed ////////////////////// [crash/LI] root@li-lc-1017:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/api/v2/hosts/207/interfaces | jq . | grep -E '(identifier|mac)' "identifier": "ens7f1", <--------------- DUPLICATE 'ens7f1' "mac": "1c:98:ec:61:83:30", <--------------- INCORRECT MAC from Bond0 instead of PermanentMAC "identifier": "bond0", "mac": "1c:98:ec:61:83:30", "identifier": "ens4f0", "mac": "1c:98:ec:61:83:28", "identifier": "ens7f0", "mac": "1c:98:ec:61:24:28", "identifier": "ens7f1", <----- This was created correctly with Puppet before "mac": "1c:98:ec:61:24:30", "identifier": "bond0.202", "mac": "1c:98:ec:61:83:30", "identifier": "bond0.402", "mac": "1c:98:ec:61:83:30", "identifier": "bond0.107", "mac": "1c:98:ec:61:83:30", <--------------- MISSING 'ens4f1' (overridden by the incorrect ens7f1) ----------------------------------------------------------------- Patch for the rhsm fact parser to prefer permanent_mac_address if it exists: [crash/LI] root@li-lc-1017:/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.157/app# diff -u ./models/katello/rhsm_fact_parser.rb.171220-1 ./models/katello/rhsm_fact_parser.rb --- ./models/katello/rhsm_fact_parser.rb.171220-1 2017-10-10 09:31:26.000000000 +0000 +++ ./models/katello/rhsm_fact_parser.rb 2017-12-20 20:02:33.695692075 +0000 @@ -20,9 +20,15 @@ end def get_facts_for_interface(interface) + # if slave then permanent_mac_address contains the physical mac + if facts.has_key?("net.interface.#{interface}.permanent_mac_address") + mackey="net.interface.#{interface}.permanent_mac_address" + else + mackey="net.interface.#{interface}.mac_address" + end { 'link' => true, - 'macaddress' => facts["net.interface.#{interface}.mac_address"], + 'macaddress' => facts[mackey], 'ipaddress' => facts["net.interface.#{interface}.ipv4_address"] } end Before Patch: ------------------- vrempet@li-lc-1681 ~ $ sudo subscription-manager register --org=`sudo facter -p foreman_organization` --name=`hostname -f` --activationkey=`sudo facter -p foreman_activationkey` --force The system has been registered with ID: 4b5a644d-2678-41cf-840e-6c6f3fadcd44 Product Name: Red Hat Enterprise Linux Server Status: Subscribed [crash/LI] root@li-lc-1017:~# sudo -u hoici hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml host interface list --host=li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- ID | IDENTIFIER | TYPE | MAC ADDRESS | IP ADDRESS | DNS NAME -----|------------|--------------------------------|-------------------|--------------|------------------------- 1114 | ens7f1 | interface | 1c:98:ec:61:83:30 | | 1115 | ens4f0 | interface | 1c:98:ec:61:83:28 | | 1116 | ens7f1 | interface | 1c:98:ec:61:24:30 | | 1117 | ens7f0 | interface | 1c:98:ec:61:24:28 | | 980 | bond0 | bond | 1c:98:ec:61:83:30 | | 981 | bond0.107 | interface (primary, provision) | 1c:98:ec:61:83:30 | 10.92.14.169 | li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- vrempet@li-lc-1681 ~ $ sudo subscription-manager register --org=`sudo facter -p foreman_organization` --name=`hostname -f` --activationkey=`sudo facter -p foreman_activationkey` --force The system with UUID 4b5a644d-2678-41cf-840e-6c6f3fadcd44 has been unregistered Validation failed: Interfaces some interfaces are invalid ------------------- After Patch: ------------------- [crash/LI] root@li-lc-1017:~# service foreman-tasks restart Redirecting to /bin/systemctl restart foreman-tasks.service vrempet@li-lc-1681 ~ $ sudo subscription-manager register --org=`sudo facter -p foreman_organization` --name=`hostname -f` --activationkey=`sudo facter -p foreman_activationkey` --force The system with UUID 78579c65-19ce-4593-a444-18d5f9518228 has been unregistered The system has been registered with ID: 7694f421-719f-42df-82f4-62ea69a2e87b Product Name: Red Hat Enterprise Linux Server Status: Subscribed [crash/LI] root@li-lc-1017:~# sudo -u hoici hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml host interface list --host=li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- ID | IDENTIFIER | TYPE | MAC ADDRESS | IP ADDRESS | DNS NAME -----|------------|--------------------------------|-------------------|--------------|------------------------- 1115 | ens4f0 | interface | 1c:98:ec:61:83:28 | | 1116 | ens7f1 | interface | 1c:98:ec:61:24:30 | | 1117 | ens7f0 | interface | 1c:98:ec:61:24:28 | | 1118 | ens4f1 | interface | 1c:98:ec:61:83:30 | | 980 | bond0 | bond | 1c:98:ec:61:83:30 | | 981 | bond0.107 | interface (primary, provision) | 1c:98:ec:61:83:30 | 10.92.14.169 | li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- [crash/LI] root@li-lc-1017:~# vrempet@li-lc-1681 ~ $ sudo subscription-manager register --org=`sudo facter -p foreman_organization` --name=`hostname -f` --activationkey=`sudo facter -p foreman_activationkey` --force The system with UUID 7694f421-719f-42df-82f4-62ea69a2e87b has been unregistered The system has been registered with ID: d9eafe49-5dd1-4bbf-ba6e-f0c3a07d4e0a Product Name: Red Hat Enterprise Linux Server Status: Subscribed [crash/LI] root@li-lc-1017:~# sudo -u hoici hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml host interface list --host=li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- ID | IDENTIFIER | TYPE | MAC ADDRESS | IP ADDRESS | DNS NAME -----|------------|--------------------------------|-------------------|--------------|------------------------- 1115 | ens4f0 | interface | 1c:98:ec:61:83:28 | | 1116 | ens7f1 | interface | 1c:98:ec:61:24:30 | | 1117 | ens7f0 | interface | 1c:98:ec:61:24:28 | | 1118 | ens4f1 | interface | 1c:98:ec:61:83:30 | | 980 | bond0 | bond | 1c:98:ec:61:83:30 | | 981 | bond0.107 | interface (primary, provision) | 1c:98:ec:61:83:30 | 10.92.14.169 | li-lc-1681.hag.hilti.com -----|------------|--------------------------------|-------------------|--------------|------------------------- [crash/LI] root@li-lc-1017:~# ------------------- Patch for 6.3Beta --- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.25/app/models/katello/rhsm_fact_parser.rb.171221-1 2017-11-02 13:34:02.000000000 +0000 +++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.25/app/models/katello/rhsm_fact_parser.rb 2017-12-21 09:40:16.809615920 +0000 @@ -21,9 +21,15 @@ end def get_facts_for_interface(interface) + # if slave then permanent_mac_address contains the physical mac + if facts.has_key?("net.interface.#{interface}.permanent_mac_address") + mackey="net.interface.#{interface}.permanent_mac_address" + else + mackey="net.interface.#{interface}.mac_address" + end { 'link' => true, - 'macaddress' => facts["net.interface.#{interface}.mac_address"], + 'macaddress' => facts[mackey], 'ipaddress' => get_rhsm_ip(interface) } end Created redmine issue https://projects.theforeman.org/issues/28036 from this bug Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you. Why is this closed. The customer even provides a small isolated patch that is proven to work in a customer environment for 2+ years. Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28036 has been resolved. Peter, Apologies for the delay and miscommunication. I had this bugzilla on my team's sprint and we've resolved it in the upstream for inclusion in future Satellite release. Thanks! *** Bug 1743432 has been marked as a duplicate of this bug. *** 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-2020:1454 |