Bug 1225124
| Summary: | Add a variables plugin to tuned | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jeremy Eder <jeder> |
| Component: | tuned | Assignee: | Jaroslav Škarvada <jskarvad> |
| Status: | CLOSED ERRATA | QA Contact: | Tereza Cerna <tcerna> |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 7.2 | CC: | bblaskov, jeder, jscotka, jskarvad, mtosatti, tcerna, williams |
| Target Milestone: | rc | Keywords: | Patch |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | tuned-2.5.1-1.el7 | Doc Type: | Enhancement |
| Doc Text: |
Feature:
Add support for variables to Tuned.
Reason:
Variables may ease creation/maintenance of Tuned profiles - there is no need to repeat the same values multiple time on multiple places and the profile can be parametrized - there are use cases when user supplied parameters are needed.
Result:
Support for variables was added into Tuned, for details see comments in bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1225124
especially comments number 2, 3, and 9.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 12:21:43 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: | |||
|
Comment 2
Jaroslav Škarvada
2015-06-01 17:24:37 UTC
tuned-2.4.1-1.20150602git.el7 changes relevant to this feature:
No more support for $VARIABLE syntax, now only the ${VARIABLE} syntax is supported. It is to resolve ambiguity and prepare room for the more complex syntax which will be introduced by built-in functions, e.g now the following works:
[variables]
delay = 20
[audio]
timeout = ${delay}
The timeout will be set to 20.
Also support for '$' was added, use $${VARIABLE} to disable expansion. The first '$' will be removet, e.g.:
[variables]
delay = 20
[audio]
timeout = $${delay}
The timeout will be set to '${delay}' literally which is not integer and error will be emitted.
Also undefined variables are not expanded to NULL (as in bash) but are taken literally, e.g.:
[audio]
timeout = ${delay}
The timout will be set to '${delay}' and the result will be the same as in the prevous example.
(In reply to Jaroslav Škarvada from comment #3) > Also support for '$' was added Should be: Also support for escaping was added Works now. One thing I noted was that after applying the profile, grub.cfg reflected the new cmdline immediately, but /etc/tuned/bootcmdline took a few seconds to update. Not a bug, just surprised me.
# rpm -q tuned
tuned-2.4.1-1.20150604git.el7.noarch
# grep cmdline tuned.conf
cmdline=isolcpus=${isolated_cores} nohz_full=${isolated_cores} mce=ignore_ce intel_pstate=disable nosoftlockup
# cat variables.conf
[variables]
# Examples:
# isolated_cores=2,4-7
isolated_cores=2-23
# tail -1 /etc/tuned/bootcmdline
TUNED_BOOT_CMDLINE="isolcpus=2-23 nohz_full=2-23 mce=ignore_ce intel_pstate=disable nosoftlockup"
# grep ^"set tuned" /boot/grub2/grub.cfg
set tuned_params="isolcpus=2-23 nohz_full=2-23 mce=ignore_ce intel_pstate=disable nosoftlockup"
I had to change the syntax a bit to be consistent with the newly implemented feature, so since tuned build 20150605 quoting is done by backslash '\' not by doubling dollar '$', e.g.:
[variables]
a = 1
audio = a
[audio]
timeout = \${audio}
timeout will be set to '${audio}'.
but:
[variables]
audio = 1
[audio]
timeout = $${audio}
timeout will be set to '$1' which is not expanded further (there is only one level expansion)
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://rhn.redhat.com/errata/RHBA-2015-2375.html |