10.8. Creating Configuration Files for New Linux Distributions¶
Distribution configuration files are used to distinguish among containers running different Linux versions and to determine what scripts should be executed when performing the relevant container-related operations (e.g., assigning a new IP address to the container).
All Linux distributions shipped with Virtuozzo have their own configuration files located in the
/usr/libexec/libvzctl/dists/ directory on the hardware node. However, you may wish to create your own distribution configuration files to support new Linux versions released. Let us assume that you wish your containers to run the CentOS 7 Linux distribution and, therefore, have to make the
centos-7.conf distribution configuration file to define what scripts are to be executed while performing major tasks with containers running this Linux version. To do this:
In the container configuration file (with the name of
centos-7as the value of the
DISTRIBUTIONvariable (for example,
centos-7.confconfiguration file in the
/usr/libexec/libvzctl/dists/directory. The easiest way to do it is copy one of the existing configuration files by executing the following command in the
# cp fedora.conf centos-7.config
In the example above, we assume that the
fedora.conffile is present in the
/usr/libexec/libvzctl/dists/directory on the hardware node. In case it is not, you may use any other distribution configuration file available on your server.
centos.conffile for editing, go to the first entry and, in the right part of the entry, specify the name of the script you wish to be run on issuing the
prlctlcommand with the parameter specified in the left part of the entry. For example, if you wish the script to be executed while assigning a new IP address to your container and the script has the
my_centos_scriptname, your entry should look as follows:
Repeat Step 3 for all entries in the file.
Place the scripts for the new Linux distribution to the
/usr/libexec/libvzctl/dists/scriptsdirectory on the Node. Make sure the names of these scripts coincide with those specified in the