3.8.2. Applying New Configuration Samples to Containers

OpenVZ allows you to change the configuration sample file a container is based on and, thus, to modify all the resources the container may consume and/or allocate at once. For example, if the container MyCT is currently based on the basic configuration sample and you are planning to run the Plesk application inside the container, you may wish to apply the vswap.plesk sample to it instead of basic, which will automatically adjust the necessary container resource parameters for running the Plesk application inside the container MyCT. To do this, you can execute the following command on the hardware node:

# prlctl set MyCT --applyconfig vswap.plesk

This command reads the resource parameters from the ve-vswap.plesk.conf-sample file located in the /etc/vz/conf directory and applies them one by one to the container MyCT.

When applying new configuration samples to containers, keep in mind the following:

  • All container sample files are located in the /etc/vz/conf directory on the hardware node and are named according to the following pattern: ve-<name>.conf-sample. You should specify only the <name> part of the corresponding sample name after the --applyconfig option (vswap.plesk in the example above).
  • The --applyconfig option applies all the parameters from the specified sample file to the given container, except for the OSTEMPLATE, TEMPLATES, VE_ROOT, VE_PRIVATE, HOSTNAME, IP_ADDRESS, TEMPLATE, NETIF parameters (if they exist in the sample file).

You may need to restart your container depending on the fact whether the changes for the selected parameters can be set on the fly or not. If some parameters could not be configured on the fly, you will be presented with the corresponding message informing you of this fact.