tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Allow setting the active profile in a different filesystem root without DBus

Open thozza opened this issue 4 years ago • 1 comments

In the Image Builder project, which is intended for Red Hat customers to build custom RHEL images, we use osbuild as the low-level assembler of the OS images. The tools assembles the images in a separate filesystem tree and in a sandboxed environment (using bubblewrap container). The system which ends up being the actual image is not booted and services like DBus are not running in the environment during the build. In addition, we tend to not run binaries from the assembled image using chroot, because we don't want the content of the image to affect the outcome of the build.

Some RHEL images, such as the EC2 SAP image are setting a specific TuneD profile. Since Image Builder is used to build the official RHEL EC2 images now, it needs to be able to achieve the same configuration on the image.

For now I implemented setting of the active TuneD profile simply by putting the desired values into /etc/tuned/active_profile and /etc/tuned/profile_mode (https://github.com/osbuild/osbuild/pull/797).

However it would be great if we could use tuned-adm from the image buildroot on the filesystem tree of the image which is being assembled. Something like this:

tuned-adm profile --root=/tmp/tmp.fGWLwIRpwV sap-hana

The expectation is that tuned-adm would treat the /tmp/tmp.fGWLwIRpwV as the filesystem root and e.g. look for available profiles in /tmp/tmp.fGWLwIRpwV/usr/lib/tuned/, set the active profile in /tmp/tmp.fGWLwIRpwV/etc/tuned/active_profile and so on.

thozza avatar Sep 06 '21 13:09 thozza

I think this RFE can be also beneficial for a) TuneD sandboxing e.g. running from the chroot and b) multiple instances of the TuneD. For b) it will probably need another option not to chroot the special filesystems mount points (e.g. /sys).

yarda avatar Sep 06 '21 17:09 yarda