Bug 1426654
| Summary: | tuned recommend auto-parent | ||
|---|---|---|---|
| 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: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | jeder, jmencak, jreznik, jskarvad, tcerna |
| Target Milestone: | rc | Keywords: | Patch, Upstream |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | tuned-2.8.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-01 12:35:21 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: | |||
|
Description
Jeremy Eder
2017-02-24 14:35:23 UTC
Since this bug report was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. This is an request to extend Tuned engine to:
- support variables and built-in functions in [main] block of tuned.conf
- add something like ${f:vm:STR1:STR2} function which would expand to STR1 in case of VM (i.e. virt-what returns non empty string) or STR2 in case of bare metal (virt-what returns empty string).
This could be used by e.g.:
[main]
include=${f:vm:virtual-guest:throughput-performance}
This would include 'virtual-guest' profile if running inside VM and 'throughput-performance' if running on bare metal.
This would also allow combinations like:
[main]
include=myprofile-${f:vm:guest:host}
would result in inclusion of myprofile-guest inside VM and myprofile-host on bare-metal.
Added support in following upstream commit: https://github.com/redhat-performance/tuned/commit/a1b9e606449715202b4feccf8b6de23e278b776f The virt_check builtin function expands to the first argument if running inside virtual machine, otherwise it expands to the second argument (when on bare metal or in case of error). It uses virt-what as a backend. So now the following can be used to lower fragmentation of Tuned profiles: [main] include=virtual-${f:virt_check:guest:host} So it will include virtual-guest if running inside virtual machine, otherwise it includes virtual-host. It only added support for the functionality, but it didn't change currently provided profiles. ============================
Verified in:
tuned-2.8.0-5.el7.noarch
PASS
============================
>> Have a testing profiles:
# cat /usr/lib/tuned/myprofile-test/tuned.conf
[main]
include=myprofile-${f:virt_check:virtual:baremetal}
# cat /usr/lib/tuned/myprofile-virtual/tuned.conf
[sysctl]
vm.swappiness=11
# cat /usr/lib/tuned/myprofile-baremetal/tuned.conf
[sysctl]
vm.swappiness=22
>> Test on virtual machine:
# tuned-adm profile myprofile-test
# sysctl vm.swappiness
vm.swappiness = 11
>> Test on bare metal machine:
# tuned-adm profile myprofile-test
# sysctl vm.swappiness
vm.swappiness = 22
Testing profiles were used well. There was included 'myprofile-virtual' on virtual machine and 'myprofile-baremetal' on bare metal machine.
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://access.redhat.com/errata/RHBA-2017:2102 |