Configuration options and parameters
There are many options and parameters you can use when running the
storpool_cg
tool with the conf
command. When needed, you can save the
parameters in a file.
Configuration options
When running the storpool_cg conf
command you can use the options listed
below.
- -C / --configfile
Configuration file for the tool.
- -D / --dump-configfile
Write the config for the tool in the specified file.
- -E / --expand
Allow the migration to increase the cpus count for StorPool. Off by default.
- -i / --interactive
Migration interactive mode. Use together with
-M
. Off by default.- -L / --preserve-limits
Preserve existing memory limits when migrating. Off by default.
- -M / --migrate
Apply the configuration live. Off by default.
- -N / --noop
No operation, only print the configuration; see Understanding results for details. Off by default.
- -P / --preserve-cpus
Preserve cpus and cpu bindings when migrating. Off by default.
- -v / --verbose
Verbosity level. Default is 0.
Saving a configuration as a file
You can use the -D
option to save the configuration detected by
storpool_cg
as a file. For example, by running storpool_cg conf --noop
converged=1 --dump-configfile my-cgconf.cfg
the configuration would be saved in the
my-cgconf.cfg file. Note that my-cgconf.cfg is a valid configuration file
for storpool_cg
. As shown below, you can create the file and check its
content:
$ storpool_cg conf --noop converged=1 --dump-configfile my-cgconf.cfg
##########START SUMMARY##########
slice: machine limit: 356G
slice: storpool limit: 16134M
subslice: storpool/common limit: 12806M
subslice: storpool/alloc limit: 3328M
slice: system limit: 2836M
slice: user limit: 2G
#################################
cpus for StorPool: [3, 5, 7, 23, 25, 27]
socket:0
core: 0 cpu: 0,20
core: 1 cpu: 2,22
core: 2 cpu: 4,24
core: 3 cpu: 6,26
core: 4 cpu: 8,28
core: 8 cpu:10,30
core: 9 cpu:12,32
core:10 cpu:14,34
core:11 cpu:16,36
core:12 cpu:18,38
socket:1
core: 0 cpu: 1,21
core: 1 cpu: 3,23 <--- 3 - rdma; 23 - server
core: 2 cpu: 5,25 <--- 5 - server_1; 25 - mgmt,beacon
core: 3 cpu: 7,27 <--- 7 - iscsi; 27 - block
core: 4 cpu: 9,29
core: 8 cpu:11,31
core: 9 cpu:13,33
core:10 cpu:15,35
core:11 cpu:17,37
core:12 cpu:19,39
#################################
SP_CACHE_SIZE=1024
SP_CACHE_SIZE_1=4096
###########END SUMMARY###########
$ cat my-cgconf.cfg
##########START CONFIG##########
[cgtool]
CONVERGED=1
BLOCK=1
ISCSI=1
MGMT=1
BRIDGE=0
SERVERS=2
SET_CACHE_SIZE=1
SP_COMMON_LIMIT=12806M
SP_ALLOC_LIMIT=3328M
SYSTEM_LIMIT=2836M
KERNEL_MEM=1G
USER_LIMIT=2G
MACHINE_LIMIT=356G
IFACE=p4p1
IFACE_ACC=1
CORES=3
CONFDIR=/etc/cgconfig.d
CACHEDIR=/etc/storpool.conf.d
###########END CONFIG###########
Using the configuration file
Having a configuration file can be useful when you need to tweak the parameters, and also in cases like the one described in Configuring multiple similar machines.
Assume you have a configuration file with a name like my-cgconf.cfg
. You can
simply run storpool_cg
by telling it about the file:
storpool_cg conf --noop --configfile my-cgconf.cfg
You may override (or specify) parameters in the config file from the command
line by listing parameter=value
pairs. Here is an example:
storpool_cg conf --noop --configfile my.cfg cores=4 converged=1 iface=sp0
This command would set 4 cores and the sp0
interface to be used, and will
make a converged setup no matter what are the values (if any at all) of the
CORES
, CONVERGED
, and IFACE
parameters in the configuration file
(explained below).
When upgrading a machine (not creating the control groups configuration for the first time) you may utilize the following options:
-P (--preserve-cpus)
will read the cpuset configuration for thestorpool.slice
(only) and will keep it unchanged. Some cpuset subslices ofstorpool.slice
might be deleted during the migration (because they are not needed in the new configuration), so their cpuset won’t be preserved.-L (--preserve-limits)
will read the memory limits of the storpool (and its subslices), system, user, and machine slices and will keep them unchanged. This option will also try to preserve the memory left for the kernel.
Configuration parameters
As shown in the example above, the configuration file for the tool consists of a
single section named cgtool
. It can contain the parameters listed below.
Note
As described in the previous section, these parameters can also be
provided on the command line as parameter=value
pairs.
- BLOCK, ISCSI, MGMT, BRIDGE
Boolean. Specify whether the corresponding Storpool service will be used on the machine. If not specified, will detect which services are installed and set them to True. Consider that the services should be enabled after the configuration of cgroups is completed; for details, see 10. Managing services with storpool_ctl.
- CACHEDIR
Path to the directory where server cache configuration file (
cache-size.conf
) for StorPool servers will be written; default is/etc/storpool.conf.d
.- CONFDIR
Path to the directory where control group configuration files will be written; default is
/etc/cgoconfig.d
.- CONVERGED
Boolean, default is False. Specify whether the machine is hyperconverged or not; cannot be detected.
- CORES
The number of cores dedicated to StorPool services. Note that if the machine supports hyperthreading then 4 cores = 8 CPUs, and if not then 4 cores = 4 CPUs. For hyperthreaded machines you may specify for example 3.5 cores, which are 3 cores (6 CPUs) plus one thread (CPU) from a different core.
- IFACE
Network interface for StorPool. Should be a machine raw device, for example
enp1s0f0
. If not specified the value from thestorpool.conf
will be taken.- IFACE_ACC
Boolean. Specify whether the network interface should use hardware acceleration. If not specified it will be detected. Use this with care, only for overwriting the detection.
- KERNEL_MEM
Non-negative integer, use one of the M or G suffixes; default
1G
. Specify the amount of memory that will be left to the kernel. Note thatKERNEL_MEM
will have effect only when some of the other limits have to be calculated (are not explicitly specified).- MACHINE_LIMIT
Non-negative integer, use one of the M or G suffixes. Specify the memory limit for the machine slice.
- NUMA_OVERFLOW
Boolean, default is False. Specify whether the usage of non-interface-local CPUs for StorPool is allowed or not.
- SERVERS
Integer between 0 and 4. Specify the amount of server instances running on the machine. If not specified, the tool will detect if
storpool_server
is installed and how many instances are configured in the initialized disks (check withstorpool_initdisk --list
). If StorPool disks are not initialized the tool will exit with an error.- SET_CACHE_SIZE
Boolean, default is True. Specify whether the tool should calculate and set appropriate cache sizes for
storpool_server
instances inCACHEDIR
. If set to 0 (False) the tool will oblige to the sizes set instorpool.conf
and use them instead of calculating and setting them. Usable on server and hyperconverged setups.- SET_MEMSW
Boolean, default is True. Specify whether to set
memory.memsw.limit
in thecgconfig
file.- SP_ALLOC_LIMIT
Non-negative integer, use one of the M or G suffixes. Specify the memory limit for the
storpool/alloc
slice. If not specified it will be calculated.- SP_COMMON_LIMIT
Non-negative integer, use one of the M or G suffixes. Specify the memory limit for the
storpool/common
slice. If not specified it will be calculated. On server nodes, the calculation requires StorPool disks to be initialized.- SYSTEM_LIMIT
Non-negative integer, use one of the M or G suffixes; default is
2G
. Specify the memory limit for the system slice.- USER_LIMIT
Non-negative integer, use one of the M or G suffixes; default is
2G
. Specify the memory limit for the user slice; will be ignored on non-systemd machines.