Bug 1798183

Summary: RFE: support post-loaded profile
Product: Red Hat Enterprise Linux 8 Reporter: Rich Megginson <rmeggins>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: medium Docs Contact:
Priority: high    
Version: 8.4CC: jeder, jskarvad, rhack, thozza
Target Milestone: rcKeywords: FutureFeature, Patch, TestCaseProvided, Triaged, Upstream
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.14.0-0.1.rc1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:03:07 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: 1817044, 1825061    

Description Rich Megginson 2020-02-04 18:27:06 UTC
Description of problem:
Need to be able to configure tuned to always load a given profile first, before loading other profiles.

One possible implementation - add a file /etc/tuned/pre-loaded-profile - the name of the profile to pre-load is in this file - tuned will load this profile before loading any other profiles.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jaroslav Škarvada 2020-02-04 18:33:46 UTC
Are you OK with the /etc/tuned-main.conf option like, e.g.:
preload_profile = your_preloaded_profile

or is special file better for you? In this case we could also add option to /etc/tuned-main.conf, e.g.:
preload_profile_file = /etc/tuned/pre-loaded-profile

Comment 2 Rich Megginson 2020-02-04 18:39:19 UTC
(In reply to Jaroslav Škarvada from comment #1)
> Are you OK with the /etc/tuned-main.conf option like, e.g.:
> preload_profile = your_preloaded_profile

It depends.  Is the /etc/tuned-main.conf in a strict INI file format?  If so, I can use the ansible ini module.  If not, then I would have to resort to using less optimal solutions such as the lineinfile module with a regexp.

> 
> or is special file better for you? In this case we could also add option to
> /etc/tuned-main.conf, e.g.:
> preload_profile_file = /etc/tuned/pre-loaded-profile

see above

Comment 3 Jaroslav Škarvada 2020-02-04 19:28:49 UTC
(In reply to Rich Megginson from comment #2)
> (In reply to Jaroslav Škarvada from comment #1)
> > Are you OK with the /etc/tuned-main.conf option like, e.g.:
> > preload_profile = your_preloaded_profile
> 
> It depends.  Is the /etc/tuned-main.conf in a strict INI file format?  If
> so, I can use the ansible ini module.  If not, then I would have to resort
> to using less optimal solutions such as the lineinfile module with a regexp.
> 
Yes, it's strict ini file, i.e. no special features, just 'option = value', whitespaces and comments.

Comment 4 Rich Megginson 2020-02-04 19:32:48 UTC
(In reply to Jaroslav Škarvada from comment #3)
> (In reply to Rich Megginson from comment #2)
> > (In reply to Jaroslav Škarvada from comment #1)
> > > Are you OK with the /etc/tuned-main.conf option like, e.g.:
> > > preload_profile = your_preloaded_profile
> > 
> > It depends.  Is the /etc/tuned-main.conf in a strict INI file format?  If
> > so, I can use the ansible ini module.  If not, then I would have to resort
> > to using less optimal solutions such as the lineinfile module with a regexp.
> > 
> Yes, it's strict ini file, i.e. no special features, just 'option = value',
> whitespaces and comments.

Ok.  Then yes, the implementation can be the addition of a new parameter to tuned-main.conf:

preload_profile = your_preloaded_profile

Thanks!

Comment 5 Ondřej Lysoněk 2020-02-05 10:28:17 UTC
(In reply to Jaroslav Škarvada from comment #1)
> Are you OK with the /etc/tuned-main.conf option like, e.g.:
> preload_profile = your_preloaded_profile
> 
> or is special file better for you? In this case we could also add option to
> /etc/tuned-main.conf, e.g.:
> preload_profile_file = /etc/tuned/pre-loaded-profile

What is the reason to do it this way? It seems like we're complicating things unnecessarily. And given that the preset profile is stored in a separate file, hiding the preloaded profile in tuned-main.conf might be considered inconsistent and a hard-to-discover easter egg.

Personally, I'd go with the original proposal to store it in something like /etc/tuned/pre-loaded-profile.

Comment 6 Rich Megginson 2020-02-05 15:05:07 UTC
(In reply to Ondřej Lysoněk from comment #5)
> (In reply to Jaroslav Škarvada from comment #1)
> > Are you OK with the /etc/tuned-main.conf option like, e.g.:
> > preload_profile = your_preloaded_profile
> > 
> > or is special file better for you? In this case we could also add option to
> > /etc/tuned-main.conf, e.g.:
> > preload_profile_file = /etc/tuned/pre-loaded-profile
> 
> What is the reason to do it this way? It seems like we're complicating
> things unnecessarily. And given that the preset profile is stored in a
> separate file, hiding the preloaded profile in tuned-main.conf might be
> considered inconsistent and a hard-to-discover easter egg.
> 
> Personally, I'd go with the original proposal to store it in something like
> /etc/tuned/pre-loaded-profile.

It doesn't matter to me - either way works fine with Ansible.  Do whatever you guys think is the right thing.

Comment 9 Ondřej Lysoněk 2020-05-04 09:32:02 UTC
It turns out that Rich needs the "pre-loaded profile" to be applied last, so that other profiles don't override its settings. So in my view, this is more like a "post-loaded profile".

Comment 10 Ondřej Lysoněk 2020-06-01 17:48:20 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/272

Comment 20 errata-xmlrpc 2020-11-04 02:03:07 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 (tuned bug fix and enhancement update), 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-2020:4559