Bug 1268283

Summary: [RFE] host unification: Add script to be run on previous version to detect systems that would need to be deleted on upgrade
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: Content ManagementAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: bbuckingham, cwelton, jcallaha, jsherril, mmccune, omaciel, sghai, swadeley, xdmoon
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12038
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 07:13:01 UTC Type: ---
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: 1315269, 1337938    

Description Justin Sherrill 2015-10-02 12:22:29 UTC
So users will know how to correct data before the upgrade.

Comment 1 Justin Sherrill 2015-10-02 12:22:31 UTC
Created from redmine issue http://projects.theforeman.org/issues/12038

Comment 4 Bryan Kearney 2016-05-03 20:09:46 UTC
Upstream bug component is Content Management

Comment 5 Bryan Kearney 2016-05-26 18:09:58 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12038 has been closed

Comment 6 Stephen Wadeley 2016-07-15 07:01:44 UTC
Hello Justin

Can you tell me the package name?

Will the script be added to an existing package, such as rubygem-katello? If so, what version please.

I need to describe the procedure so need to explain that a specific package and version must be installed.

Thank you

Comment 7 Justin Sherrill 2016-07-18 12:46:45 UTC
Stephen,

The command is:


foreman-rake katello:upgrade_check


This has not been shipped yet (hasn't even been built yet), but will be shipped in ruby193-rubygem-katello-2.2.0.90-1-sat  (or later).  You might suggest that they need the latest, at least .90-1

Comment 8 Stephen Wadeley 2016-07-18 13:56:45 UTC
thank you Justin for comment 7

Comment 10 Og Maciel 2016-07-26 20:27:57 UTC
Tested on RHEL 6:

Package: ruby193-rubygem-katello-2.2.0.90-1.el6_6sat.noarch


foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 1 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.90 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 4
Content hosts to be deleted: 8
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469564448.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.

Comment 11 jcallaha 2016-07-26 20:30:54 UTC
Tested output of the script on two populated RHEL7 machines.
katello-common-2.2.0.19-1.el7sat.noarch

---- Script run without conflicts ----
[root@ibm-x3550m3-06 ~]# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 0 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.90 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.
Upgrading will not affect any of your Content Hosts.


---- Script run with conflicts ----
[root@qe-sat6-upgrade-rhel7 etc]# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 0 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.90 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 6
Content hosts to be deleted: 13
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469558864.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.
This script makes no modifications and can be re-run multiple times for the most up to date results.
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 6
Content hosts to be deleted: 13
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469558869.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.

Comment 13 Og Maciel 2016-07-26 22:13:28 UTC
Satellite 6.1.9 installed on RHEL 6 Server
------------------------------------------

# rpm -q ruby193-rubygem-katello
ruby193-rubygem-katello-2.2.0.92-1.el6_6sat.noarch

# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[FAIL] - There are 1 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.92 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 4
Content hosts to be deleted: 8
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469569343.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.


Satellite 6.1.9 installed on RHEL 7 Server
------------------------------------------

# rpm -q ruby193-rubygem-katello
ruby193-rubygem-katello-2.2.0.92-1.el7sat.noarch

# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 0 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.92 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 10
Content hosts to be deleted: 9
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469569946.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.
This script makes no modifications and can be re-run multiple times for the most up to date results.
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 6
Content hosts to be deleted: 13
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469569952.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.

Comment 14 Og Maciel 2016-07-26 22:42:07 UTC
Comment #13 shows that the output for RHEL 7 shows a summary twice, with different numbers. I expected that only 1 summary would be displayed.

The output for RHEL 6 shows a FAIL due to a running task. I resumed this task and waited until it finished, then re-ran the script:

# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 0 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.92 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 4
Content hosts to be deleted: 8
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469572579.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.

Comment 15 Og Maciel 2016-07-26 23:04:39 UTC
Apparently an order version of a pre-upgrade check was moved to the RHEL 7 machine :/ Once I removed it and re-ran the script I got a valid output.

# foreman-rake katello:upgrade_check
This script makes no modifications and can be re-run multiple times for the most up to date results.
Checking upgradeability...

Checking for running tasks...
[PASS] - There are 0 active tasks.

Checking the current version...
[PASS] - Current version of the Katello Ruby RPM is 2.2.0.92 and needs to greater than or equal to 2.2.0.90

Checking content hosts...
Calculating Host changes on upgrade.  This may take a few minutes.


Summary:
Content hosts to be preserved: 10
Content hosts to be deleted: 9
Details on Content Hosts planned for deletion saved to /tmp/pre-upgrade-1469573885.csv
You may want to manually resolve some of the conflicts and duplicate Content Hosts.
Upon upgrade those found for deletion will be removed permanently.

Comment 17 Og Maciel 2016-07-26 23:05:55 UTC
Verified by QE and DEV

Comment 19 errata-xmlrpc 2016-07-27 07:13:01 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/RHBA-2016:1499