-
Notifications
You must be signed in to change notification settings - Fork 581
[foreman] Add collection of hammer output #3994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
@pmoravec here's the first pass at what we talked about on IRC. Right now it just collects subscriptions, lifecycle-environments, locations, and optionally content views for each org. Can definitely add or reduce that list here before merging. Was thinking about capsules (I believe upstream foreman simply calls them |
This commit adds collection of `hammer` output for various components within Foreman/Satellite. These are first listed and then individually collected for any entries listed. Signed-off-by: Jake Hunsaker <[email protected]>
6e36c30
to
7bd4f0c
Compare
@pmoravec I don't have easy access to a Debian box with Foreman 3.7 where the CI is failing. It seems like the output for hammer may be a different format given the error from the logs? It's failing to find
How does 3.7 map to current Satellite 6.16 (which is where I did my testing for this)? |
Foreman 3.7 should have the same hammer output, at least on Satellite 6.14 on RHEL8 - let me check it on an Ubuntu system. This PR can be tricky to assess what detailed info is worth to collect or not. Since hammer commands can take a while (esp. when some service is timeouting (so worth lowering the cmd timeout even more?)) - we can use direct postgres commands for some stuff, but that is not a stable solution over releases that alter foreman's ERD.. Also some collected data can be too seldomly used and this is hard to assess. On a first draft, the "verbosity level" sounds good to me, let me think more about it (and ask internally for more broader feedback). |
While this looks intriguing but can end-up causing more problems than we can think of right away. p1. Right now we might be implementing couple of hammer commands for couple of objects. In future, Tech_support Engineers can keep on asking to include more and more hammer commands for different things justifying their needs and uses for case investigation. And that will continue to make sos more and more bulky whenever executed on a satellite system p2. Hammer depends on API. The API response time for each customer's satellite is not same. Pretty good number of users can have slower API response rates than expected. Which means, the more number of hammer commands we use, the slower the sosreport generation would be. In a scenario where the sos is only needed for basic OS level stuff and logs, That extended time spent on generating the sos to collect hammer-based data, cannot be appreciated as we are extending the investigation duration here. p3. If at all this is implemented, then execution of p4. DB queries are much faster to use, instead of relying on hammer. If we come up with the data required for a set of objects and prepare their queries, then it's quite a lot faster to execute during the sos report data collection, compared with hammer\api. Ofcourse, this suggestion can only be implemented by keeping the fact in mind that database ERD can change in future. In simpler terms, I would prefer to not suggesting the inclusion of something that may slow down our most important data collection tool, in the hours of need. |
Relying on stable ERD (which should be stable for basic stuff but can easily change, like we saw in dynflow stuff a year ago) is kind of a risk. And I dont want to enter the rabbit hole of having different DB queries for different foreman versions. Moreover, foreman devels often repeat the DB is just an internal implementation detail that users should not directly access until needed. Which means that e.g. there is no guarantee of stable ERD and imho no announcement of ERD changes either. Collecting whole several tables is an option to get the required data in a way independent on foreman version - but we might get ridiculous or even sensitive data. Yet another option is grabbing the orgs/locs/CVs/.. lists from within Yet yet another option is calling API directly, but that approach suffers same problems like hammer does, and we lack the abstraction of API parameters changes among releases. There is no efficient way of reliable getting the data in a reasonable time (on 95+% cases, at least), I am afraid. From the options (hammer, API, console, direct psql), hammer seems to be the least painful yet not great for the reasons above. What about putting all the hammer commands (apart of ping and status, these are great) under a plugin option that is disabled by default? (or several plugopts)? |
I'll generally echo @pmoravec's responses, and add just one more thing. While we are sensitive the execution times, I think in this scenario the concern is a little overblown. Plugins have a maximum execution, defaulting to 5 minutes. The |
Logically, the data should be collected by Some time ago, I run some stats over sosreports I had access to, and - looking into the notices from the time - the running times of
Which means the plugin completed within one minute the most of the time. What about:
Then (if/when enabled, until enabled by default) the negative impact of possibly long running hammer commands will be limited. .. or we can have them really in a separate No strong preference from me. |
This commit adds collection of
hammer
output for various components within Foreman/Satellite. These are first listed and then individually collected for any entries listed.Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines