Bug 1317261 - Migration of SCAP from Sat 6.1 to Sat 6.2
Migration of SCAP from Sat 6.1 to Sat 6.2
Product: Red Hat Satellite 6
Classification: Red Hat
Component: SCAP Plugin (Show other bugs)
Unspecified Unspecified
urgent Severity urgent (vote)
: GA
: --
Assigned To: Shlomi Zadok
Kedar Bidarkar
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2016-03-13 09:26 EDT by Shlomi Zadok
Modified: 2016-07-27 07:43 EDT (History)
4 users (show)

See Also:
Fixed In Version: rubygem-foreman_openscap-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-27 07:43:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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 14477 None None None 2016-04-22 12:16 EDT

  None (edit)
Description Shlomi Zadok 2016-03-13 09:26:39 EDT
Description of problem:
In 6.1, all the ARF reports were saved as XML in the Foreman database. That caused us a lot of pain (future pain, even...) so during refactoring of foreman_openscap we did two things:
1. Move all OpenSCAP processing to the capsule
2. Save ARF reports as files in the capsule and send a report (similar to Puppet reports) back to Foreman.
This is how it is intended to play in 6.2

The problem: when upgrading from old OpenSCAP to the new one, the migration is taking the XML files from database and recreates them as foreman_openscap reports. Then we drop the tables with the XML files. That may raise an issue with existing users, who will not have the original XML file.

Proposed solution:
5. convert the migration process to an external task (rake task), similar to the existing migration logic and:
a. check if a proxy is already installed and running, then move the reports one at a time (so you can handle failure if someone stopped the process in the middle or something).
b. delete the table only if its empty (maybe even part of the rake task so when its done it can remove the table).
c. have the ability to execute the data migration script manually (very similar to how trends data was converted between 6.1 to 6.2) and then it becomes a documentation section?
Comment 1 Shlomi Zadok 2016-04-05 08:53:12 EDT
Created redmine issue http://projects.theforeman.org/issues/14477 from this bug
Comment 5 Kedar Bidarkar 2016-07-22 10:04:43 EDT
Migration of SCAP from Sat6.1 to Sat6.2 requires 2 steps, for which we need release notes and a bug is raised for it, https://bugzilla.redhat.com/show_bug.cgi?id=1358309

1) Also for the "View full report" and "Download XML in bzip" to be possible, we need to assign "oscap proxy" to the host. So for that to be done for multiple hosts, I did the following:

a) Assign the "oscap-proxy" to host_group.
b) And make sure all the hosts are setup with a "oscap proxy", even for the older hosts and new hosts that would be created.
c) One way which I tried to do is to search for hosts via "content_source" and "os_major" , and unassign and reassign the host-group for the hosts so that the oscap-proxy is set for all the hosts in one go.

2) Ran this command, foreman-rake foreman_openscap:migrate[1]

3) Tested for the following compliance reports, for "View full reports" and "download xml in bzip format" and it works fine.

a) from managed hosts of sat6.1 migrated to sat6.2
b) from unmanaged hosts of sat6.1 migrated to sat6.2
c) from newly provisioned hosts of sat6.2 after upgrade.

VERIFIED with sat62-snap21.1(GA)
Comment 6 Bryan Kearney 2016-07-27 07:43:15 EDT
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.


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