Red Hat Bugzilla – Bug 1317261
Migration of SCAP from Sat 6.1 to Sat 6.2
Last modified: 2016-07-27 07:43:15 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.
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?
Created redmine issue http://projects.theforeman.org/issues/14477 from this bug
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
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)
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.