sysconfig #8

Supports: bionic xenial
Add to new model

Description

SYSConfig can configure cpufreq governor (ie powersave, performance),
and CPU Affinity or Kernel's isolcpus details in systemd-sytem.conf
or Grub. It can also configure HugePages on Grub.


Overview

This is a subordinate charm to apply grub, systemd, kernel and cpufrequtils configuration.

Usage

Deploy sysconfig alongside your service,

juju deploy ubuntu
juju deploy sysconfig

Add the relations:

juju add-relation sysconfig ubuntu

Configuration

Enable-container

By default, the charm can not be installed in a container.
Configuring enable-container=true the charm will be installed in
a container too. This is intended only for testing purpose.

Reservation

By default, the charm does not configure any CPU related reservation.
However, "isolcpus" or "affinity" can be configured on systemd hosts.

cpu-range

In case of "isolcpus", it determines the pcpus that won't be used by the
host (ie. the same range is configured for QEMU usage).

In case of "affinity", it determines the pcpus that the host WILL use
(ie. a complementary range to the QEMU vcpu_pin_set).

If this value is left empty, charm behaves as if "reservation=off".

Hugepages

It controls the number of hugepages to be set in the system. By default the
value is empty, if specified hugepages={{ hugepages }} will be attached to
the grub cmdline.

Hugepagesz

It controls the size of each hugepage to be set in the system. By default the
value is empty, if specified hugepagesz={{ hugepagesz }} will be attached to
the grub cmdline.

Raid autodetection

It controls the raid detection mode. By default it is empty, this means that
autodetection is enabled if 'md' module is compiled into the kernel. Possibles
values will be "noautodetect" that disables raid autodetection and "partitionable"
where all auto-detected arrays are assembled as partitionable.

Enable Pti

By default Page Table Isolation is disabled passing "pti=off" to the grub cmdline.
Set to true to enable it.

Enable Iommu

If true and VT-d enabled in the BIOS, it will allow to use direct I/O
bypassing DMA translation with pci-passthrough devices. Enable it to use SR-IOV

grub-config-flags

If you need further options configured, this extra options will be added
to the files /etc/default/grub

systemd-config-flags

If you need further options configured, this extra options will be added
to the files /etc/systemd/system.conf

config-flags

DEPRECATED in favor of grub-config-flags or systemd-config-flags

If you need further options configured, these extra options will be added
to the files:
* /etc/default/grub (reservation=isolcpus)
* /etc/systemd/system.conf (reservation=affinity)

Kernel Version

Upgrade kernel and modules-extra package to this version and add GRUB_DEFAULT to
/etc/default/grub to load the required kernel version. It does
nothing if same kernel already running.

update-grub

By default, this value is set to "false". If enabled, charm will run
"update-grub" when changing /etc/default/grub.

Governor

Governor is configured via cpufrequtils, possible values are:
* '' (default): systemd will choose the first available between 'ondemand', 'powersave', 'performance'.
Recommended option when Bios control power is set to the OS.
* 'performance'
* 'powersave'

Release notes

With the new release default behaviour has changed.
To produce same configuration as was before default behaviour use the following configuration:

sysconfig:
charm: cs:~canonical-bootstack/xenial/sysconfig
options:
raid-autodetection: "noautodetect"
enable-iommu: true

Contact Information


Configuration

config-flags
(string) If extra lines need to be configured on /etc/default/grub (isolcpus) or /etc/systemd/system.conf (affinity), this string can be used as a list in yaml format. Sample: {'grub': 'key1=value1, key2=value2', 'systemd': 'key1=value1'} [DEPRECATED]: this option should no longer be used. Instead grub-config-flags and systemd-config-flags should be used.
cpu-range
(string) Single pcpus (0,1,2) or range of pcpus (0-10) to isolate (if isolcpus is selected) or reserve (if affinity is selected). Default value (empty) will make "reservation" work as if it was "off".
enable-container
(boolean) Enable support for containers. For testing purpose only.
enable-iommu
(boolean) If true and VT-d enabled in the BIOS, it will allow to use direct I/O bypassing DMA translation with pci-passthrough devices. Enable it to use SR-IOV
enable-pti
(boolean) Allow enabling/disabling page table isolation, adding pti=off to grub cmdline
extra_packages
(string) Space separated list of extra deb packages to install.
governor
(string) Configured via cpufrequtils, possible values are: - '' (default): systemd will choose the first available between 'ondemand', 'powersave', 'performance'. Recommended option when Bios control power is set to the OS. - 'performance' - 'powersave'
grub-config-flags
(string) If extra lines need to be configured on /etc/default/grub this string can be used as a list of key/value pairs 'key1=value1,key2=value2'
hugepages
(string) Number of hugepages. Example: 400
hugepagesz
(string) Size of each hugepage. Example: 1G
install_keys
(string) List of signing keys for install_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
install_sources
(string) List of extra apt sources, per charm-helpers standard format (a yaml list of strings encoded as a string). Each source may be either a line that can be added directly to sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal Package Archives, or a distribution component to enable.
kernel-version
(string) Upgrade kernel and modules-extra package to this version and add GRUB_DEFAULT to /etc/default/grub to load the required kernel version. Does nothing if same kernel already running.
package_status
(string) The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
install
raid-autodetection
(string) Configure raid detection. Possible value are - '': (default) autodetection enabled if md module is compiled into the kernel - 'noautodetect': autodetection is disabled - 'partitionable': all auto-detected arrays are assembled as partitionable
reservation
(string) Type of CPU reservation: isolcpus, affinity, off isolcpus is a kernel cmdline paremeter affinity (CPU Affinity) is a systemd configuration parameter. Other processes inherit from systemd-system.conf off (default) disables any CPU reservation on host-side.
off
systemd-config-flags
(string) If extra lines need to be configured on /etc/systemd/system.conf this string can be used as a list of key/value pairs 'key1=value1,key2=value2'
update-grub
(boolean) Allows the charm to run "update-grub" command if /etc/default/grub was changed. This is discouraged and by default it is disabled.