Bug 1356714
Summary: | After upgrade, all of my hosts are duplicated one with shortname, one with fqdn | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | rakesh kumar <rakumar> | ||||||||||
Component: | Hosts | Assignee: | satellite6-bugs <satellite6-bugs> | ||||||||||
Status: | CLOSED ERRATA | QA Contact: | jcallaha | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | high | ||||||||||||
Version: | 6.2.0 | CC: | aperotti, bbuckingham, bkearney, brubisch, chrobert, chrpearce, cwelton, dcaplan, dgross, egolov, ehelms, fcami, inecas, jcallaha, jentrena, jsherril, luke2235, mmccune, nitthoma, pdwyer, pmoravec, rraghuwa, sbeal, sthirugn, tspeetje, xdmoon, zhunting | ||||||||||
Target Milestone: | Unspecified | Keywords: | PrioBumpGSS, PrioBumpPM, PrioBumpQA, Reopened, Triaged | ||||||||||
Target Release: | Unused | ||||||||||||
Hardware: | x86_64 | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | rubygem-katello-3.0.0.80 foreman-1.11.0.54-1,katello-installer-base-3.0.0.69-1 | Doc Type: | If docs needed, set a value | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | |||||||||||||
: | 1380473 1405538 (view as bug list) | Environment: | |||||||||||
Last Closed: | 2017-01-26 15:55:05 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: | 1380473, 1385841, 1394349, 1399395, 1405538 | ||||||||||||
Attachments: |
|
Description
rakesh kumar
2016-07-14 20:20:56 UTC
@jsherrill seems like related to https://bugzilla.redhat.com/show_bug.cgi?id=1362592, should we tread this as one BZ and close a dupe? Ivan, Yeah I agree these are duplicates. Closing https://bugzilla.redhat.com/show_bug.cgi?id=1362592 -Justin *** Bug 1362592 has been marked as a duplicate of this bug. *** Opened subscription-manager bugs for long term support: https://bugzilla.redhat.com/show_bug.cgi?id=1367128 https://bugzilla.redhat.com/show_bug.cgi?id=1367126 Temporary workaround for new registrations: run the following on a client prior to registration: if [ -d /etc/rhsm/facts/ ]; then echo "{\"network.hostname\":\"`hostname -f`\"}" > /etc/rhsm/facts/katello.facts fi We are in the process of coming up with a more permanent work around as well as a script to 'unify' systems that are duplicated after upgrade Created attachment 1193310 [details]
unify_hosts.rake
Attaching our script for unifying the hosts duplicated after upgrade: Place in 'unify_hosts.rake' in /usr/share/foreman/lib/tasks/ and run: # foreman-rake unify_hosts NOTE: IT IS HIGHLY RECOMMENDED THE CUSTOMER HAVE A FULL DB BACKUP With the testing we have done on 1 customer's db, it seemed to have unified 98% of the duplicate hosts. The only times it did not was when it seemed the fqdn host had been re-registered (likely the customer doing it manually). Those associated shortname hosts will need to be cleaned up manually. Upstream bug assigned to jsherril Upstream bug component is Infrastructure Upstream bug assigned to jsherril Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16270 has been resolved. *** Bug 1375706 has been marked as a duplicate of this bug. *** Is this target milestone correct? I thought 6.2.2 is out. Christian: We are shipping an errata in between 6.2.2 and 6.2.3 to include this and a few other fixes that are landing outside our normally scheduled 6.2.Z 30-day release cycle. Created attachment 1205982 [details]
hosts page
The purpose of this BZ is to only handle the situation where a user has found themselves in after upgrading and having all hosts duplicated. As part of this we are shipping a rake task that can be run (basically the same task as attached to this bug). I have cloned this bz to a new bug to handle new registrations (https://bugzilla.redhat.com/show_bug.cgi?id=1380473), and it is also targeting a 6.2.z release. In the meantime as has been stated, you can simply run this: if [ -d /etc/rhsm/facts/ ]; then echo "{\"network.hostname\":\"`hostname -f`\"}" > /etc/rhsm/facts/katello.facts fi prior to registration to resolve the issue for new registrations. This can be added to a bootstrap script, kickstart file, or puppet module. Please do let us know if this workaround is not sufficient until 1380473 can be released. Verified in Satellite 6.2.2 Snap 1. After duplicating the hosts as outlined in the setup steps (see attached image). I ran the unify_hosts job and the two entries were successfully combined (see unified image). [root@rhsm-qe-1 ~]# foreman-rake katello:unify_hosts Skipping virt-who-supermicro-2027gr-tr2-1.gsslab.rdu2.redhat.com-1 due to blank primary interface mac Skipping virt-who-inorbit.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Skipping virt-who-bulgaria.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Skipping virt-who-nightwing.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Unifying mgmt4.rhq.lab.eng.bos.redhat.com with mgmt4 Created attachment 1205991 [details]
duplicate
Created attachment 1205992 [details]
combined
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/RHBA-2016:1993 Negative. This issue is still happening in Satellite 6.2.4. Case #01713467 Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16270 has been resolved. (In reply to sthirugn from comment #38) > Negative. This issue is still happening in Satellite 6.2.4. This BZ provides the unify_hosts.rake script that removes already existing duplicates. The script is provided by this errata and works, therefore CLOSED ERRATA is imho correct. The prevention of new duplicates is not covered by this bug. (In reply to Julio Entrena Perez from comment #42) > (In reply to sthirugn from comment #38) > > Negative. This issue is still happening in Satellite 6.2.4. > > This BZ provides the unify_hosts.rake script that removes already existing > duplicates. > The script is provided by this errata and works, therefore CLOSED ERRATA is > imho correct. > > The prevention of new duplicates is not covered by this bug. I agree that this bug creates a workaround. But I am looking for a fix to prevent this in the first place. I am ok if this issue needs to be tracked in this bug or a new bug - regardless a fix is needed soon. We could pretty easily add this as a post step in the upgrade process. I think that is safer than trying to modify the existing migrations as that migration is extremely fragile and has been working really well. This script has been tested really well so far. So my vote would be to just run this as a post script in the installer upgrade. Technically this already went into out in 6.2.2. What suresh is suggesting is to run the script automatically upon upgrade. I'll open a PR for that now PR Opened here: https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello-installer/merge_requests/76 There is some concern because this will get run for all current users. Given that the default behavior is to use mac addresses for the unification, its unlikely to cause a problem but it is a concern. IHAC reporting that running "foreman-rake katello:unify_hosts" results in all host entries being unified (expected) but then these hosts don't show any subscriptions or installed products. Running "subscription-manager refresh" in the hosts results in "Couldn't find consumer": [root@hostname ~]# subscription-manager refresh Couldn't find consumer 'bd9a911d-6fd2-4ce5-a9d1-f36652a54a8d' They have workarounded that by explicitly creating file /etc/rhsm/facts/katello.facts with the correct network.hostname entry which prevents the duplicates. I assume that running the script on a satellite with no duplicates would be a no op? Verified in Satellite 6.2.7 Snap 1. The unify hosts task is now included at the end of the upgrade. Upgrade Step: unify_hosts (this may take a while) ... Skipping virt-who-supermicro-2027gr-tr2-1.gsslab.rdu2.redhat.com-1 due to blank primary interface mac Skipping virt-who-bulgaria.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Skipping virt-who-inorbit.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Skipping virt-who-ironforge.satellite.lab.eng.rdu2.redhat.com-1 due to blank primary interface mac Skipping virt-who-nightwing.hq.gsslab.rdu.redhat.com-1 due to blank primary interface mac Skipping virt-who-dhcp-8-101-249.satellite.lab.eng.rdu2.redhat.com-1 due to blank primary interface mac Unifying test with test.short.hostname.com Upgrade completed! This was delivered in satellite 6.2.7 (https://access.redhat.com/errata/RHBA-2017:0197) foreman-rake katello:unify_hosts will attempt to shutdown and delete virtual machines if they are not dissociated from the satellite server prior to running the script. If you have a compute node attached this can be dangerous. I've been using --name with the fqdn for new host registrations to avoid duplicate enteries. |