vz.conf(5)

๐Ÿ“ฆ version 4.9.4, in ubuntu jammy

โœจ vz.conf(5) โ€” Containers โœจ

okay bestie, gather round, because this is the global OpenVZ configuration file ๐Ÿ’– it's vz.conf(5), and yeah it's giving "one file to rule your whole node" energy. let's get into it ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

vz.conf โ€” the global OpenVZ configuration file. that's her. that's the main character. ๐Ÿ‘‘


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

/etc/vz/vz.conf

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so this is the global config file for OpenVZ. it's just lines, one per setting, and every line looks like this:

PARAMETER="value"

and the rules are strict bestie, no cap:

  • every parameter name and every value is case-sensitive, so don't get cute with the capitalization ๐Ÿ™ˆ
  • the quotes around value are required if your value has spaces in it, and optional if it doesn't
  • extra spaces are NOT allowed โ€” do not add them, she will not forgive you
  • any line she doesn't recognize? ignored. fully ghosted. ๐Ÿ’€

๐Ÿ‘‘ Global parameters ๐Ÿ‘‘

  • VIRTUOZZO=yes|no โ€” set it to yes or no, and the vz init script reads it. if it is not set to yes, literally nothing happens to boot up OpenVZ on this node. like, she simply will not start. ๐ŸŒ™
  • LOCKDIR=directory โ€” the directory where lock files go. that's it, that's the job. ๐Ÿ”’
  • VE0CPUUNITS=number โ€” sets cpuunits for CT0, aka the host system itself.
  • LOGGING=yes|no โ€” turns logging on or off. yes or no, and the default is yes. โœจ
  • LOGFILE=file โ€” where the log file lives. ๐Ÿ““
  • LOG_LEVEL=number โ€” the logging level for the log file (and btw this does not touch console output). the bigger the number, the more stuff gets logged to LOGFILE. default is 0, which means normal messages and errors get logged. set it to -1 and only errors make the cut. ๐Ÿ’…
  • VERBOSE=number โ€” the logging level for console/terminal output (and this one does not touch the log file). default is 0, meaning normal messages and errors. crank the number up and vzctl(8) gets more verbose. ๐Ÿ—ฃ๏ธ
  • MODULES_DISABLED=yes|no โ€” if it's yes, the vz initscript makes no attempt at all to load kernel modules. super handy on systems where the OpenVZ-specific features are compiled right into the kernel (i.e. not as modules). ๐Ÿง 
  • IPTABLES_MODULES="module module ..." โ€” the list of iptables kernel modules that the vz initscript loads before it loads the OpenVZ modules (which is required for iptables to work inside containers). ๐Ÿ”ฅ
  • VZFASTBOOT=yes|no โ€” if it's yes, the vz initscript called with the start argument will start containers that have an uncleanly shutdown quota state without doing quota reinitialization (which is usually a whole time-consuming ordeal, ngl). after all the containers are started, the initscript restarts those unclean-quota containers in the normal way, so quotas get recalculated/fixed. ๐Ÿ˜ฎโ€๐Ÿ’จ
  • VE_STOP_MODE=suspend|stop โ€” if it's suspend (or just not set at all), the vz initscript called with the stop argument tries to suspend running containers instead of stopping them. suspended containers get restored on vz start. this feature usually helps cut down reboot time. and if a container fails to suspend? it gets stopped anyway, no drama. ๐Ÿ˜Œ
  • VE_PARALLEL=number โ€” how many containers get started or stopped at the same time on node startup or shutdown. if you don't specify it, the number is calculated based on how many CPU cores you have. used by the vz initscript. ๐Ÿƒโ€โ™€๏ธ๐Ÿƒโ€โ™€๏ธ
  • TEMPLATE=directory โ€” a directory, and inside it lives all your container template data. ๐Ÿ“ฆ
  • SKIP_SYSCTL_SETUP=yes โ€” if this parameter is not present, init.d/vz start sets some sysctl.conf(5) parameters that OpenVZ requires or recommends (with the help of the vz-postinstall sysctl script), and then adds this parameter to vz.conf. so basically she writes it in herself after doing the thing. โœ๏ธ

๐ŸŒˆ Network interface parameters ๐ŸŒˆ

  • VE_ROUTE_SRC_DEV="device" โ€” names the network device whose IP address gets used as the source IP. this is a lifesaver when you've got more than one network interface configured on the HN and you need to pin down which source IP address to use. default is the first device in the network device list. ๐Ÿ›ฐ๏ธ
  • NEIGHBOUR_DEVS="all|detect|list:dev1 [dev2 ...]" โ€” controls which interfaces get ARP records added/removed for a container IP, and also which interfaces are used to query/announce ARP. details below bestie ๐Ÿ‘‡
    • if it's set to all, an empty string, or left unset โ€” all possible network interfaces are used, i.e. the ones that are UP and don't have NOARP, SLAVE, or LOOPBACK flags. this is the default mode. โœจ
    • if it's set to detect, the right network interface gets chosen automatically โ€” meaning the one sitting in the same subnet as a container IP. ๐Ÿ•ต๏ธโ€โ™€๏ธ
    • if the value starts with the list: prefix, then the space-separated list of interfaces following that prefix is what gets used. ๐Ÿ“
  • ERROR_ON_ARPFAIL=yes|no โ€” if it's yes, vzctl will fail to start a container when there's another host on the network with the same IP. any other value means vzctl just prints the warning โ€” and that warning-only behavior is the default. โš ๏ธ
  • SKIP_ARPDETECT=yes|no โ€” if it's yes, vzctl will not use ARP queries when starting a container to detect whether another host with the same IP is out there on the network. heads up though: for each IP, vzctl sends an ARP query and waits up to 1 second for a response. any other value means ARP detection happens. โฑ๏ธ
  • FORCE_ROUTE=yes|no โ€” if it's yes, vzctl will attempt to change an existing route so it points to a container when starting a container, if the new route setup fails. any other value means it only attempts to add new routes โ€” that's the default behavior. ๐Ÿ›ฃ๏ธ

๐ŸŽ€ Defaults for vzctl create ๐ŸŽ€

these are the defaults for vzctl create, and they can be overwritten by the appropriate command line options of that command. ๐Ÿ’ซ

  • DEF_OSTEMPLATE=name โ€” the default OS template to create a container from. corresponds to the --ostemplate option of vzctl create. ๐Ÿงš
  • CONFIGFILE=name โ€” the default configuration file (/etc/vz/conf/ve-name.conf-sample) used to create a new container. corresponds to the --config option of vzctl create. ๐Ÿ“„
  • VE_LAYOUT=simfs|ploop[:{plain|expanded|raw}] โ€” the default CT filesystem layout for a new container, and it can be either ploop or simfs. if you go with ploop, you can also specify the ploop disk image format after a colon. the possible ploop formats are expanded, plain, and raw. default is expanded. using raw is not recommended and is not supported. ๐Ÿšซ corresponds to the --layout option of vzctl create. ๐Ÿ’…

๐Ÿฆ‹ Defaults for containers ๐Ÿฆ‹

these ones below are defaults for containers, and they can be overwritten by parameters in the ctid.conf(5) per-container configuration file. ๐Ÿซถ

  • DISK_QUOTA=yes|no โ€” if it's set to no, all disk quota operations are disabled. periodt. ๐Ÿ’€
  • VE_ROOT=directory โ€” the directory that serves as the container root mount point. the value must contain the literal string $VEID, which gets substituted with the actual numeric CT ID. ๐Ÿ”ข
  • VE_PRIVATE=directory โ€” the directory where all the files and directories specific to that container are stored. the value must contain the literal string $VEID, which gets substituted with the actual numeric CT ID. ๐Ÿ”ข
  • STOP_TIMEOUT="number" โ€” how long to wait for a container to shut down on vzctl stop, before forcibly killing it, in seconds. hardcoded to 120 if it's not set. โณ
  • NAMESERVER="ip [ip ...]" โ€” the default value for the container's nameserver(s). multiple name server addresses are separated by spaces. if it's set to inherit, the values from the host system's /etc/resolv.conf are used. ๐ŸŒ
  • SEARCHDOMAIN="domain [domain ...]" โ€” the default value for the container's search domains. multiple search domains are separated by spaces. if it's set to inherit, the values from the host system's /etc/resolv.conf are used. ๐Ÿ”Ž

most of the other parameters that show up in the per-container configuration files ctid.conf(5) can also be set right here. still, it is recommended to keep TEMPLATE, VE_PRIVATE, and VE_ROOT in this configuration file, and put all the other container related parameters in the per-container configuration files. like, that's the vibe. keep it tidy bestie ๐Ÿงนโœจ


๐Ÿ’œ SEE ALSO ๐Ÿ’œ

vzctl(8), ctid.conf(5).


๐Ÿ“œ LICENSE ๐Ÿ“œ

Copyright (C) 2000-2011, Parallels, Inc. Licensed under GNU GPL.


and that's the whole page, bestie ๐Ÿฅน๐Ÿ’– this was vz.conf(5) from OpenVZ, dated 20 Apr 2015. you ate that. now go configure your node responsibly, ily ๐Ÿซถ๐ŸŒธโœจ

๐Ÿ“ฆ where this page comes from