Open main menu

OpenVZ Virtuozzo Containers Wiki β

Configuring container creation

Revision as of 12:18, 18 March 2008 by Jmelyn (talk | contribs) (New page: The creation of a VE needs three configuration files: <pre>/etc/vz/vz.conf /etc/vz/dists/<dist>.conf /etc/vz/conf/ve-<parameters>.conf-sample</pre> There are two important lines in the fi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The creation of a VE needs three configuration files:

/etc/vz/vz.conf
/etc/vz/dists/<dist>.conf
/etc/vz/conf/ve-<parameters>.conf-sample

There are two important lines in the file /etc/vz/vz.conf. The first is DEF_OSTEMPLATE="<dist>"; an example of <dist> is: fedora-8-i386-minimal. It provides the name of the tar file of VE template cache: /vz/template/cache/<dist>.tar.gz. This line gives the distribution config file as well, because unfortunately all distributions do not work the same way when setting the host name or the ip address. Several tries are done to find this configuration file name: if <dist> is fedora-8-i386-minimal, then first guest will be /etc/vz/dists/fedora-8-i386-minimal.conf, second will be /etc/vz/dists/fedora-8-i386.conf, third /etc/vz/dists/fedora-8.conf, and finally /etc/vz/dists/fedora.conf. If not found, the /etc/vz/dists/default.conf will be used.

The other important line in the file /etc/vz/vz.conf is CONFIGFILE="<parameters>". It provides the name of the VE parameters file: /etc/vz/conf/ve-<parameters>.conf-sample, for example: /etc/vz/conf/ve-light.conf-sample. During VE creation, a copy of this file will be done with the <ve_id>, for example <ve_id>=123: /etc/vz/conf/123.conf. Whenever a parameter is changed for this VE (vzctl set <ve_id> --parameter newValue --save), parameter="newValue" is saved in /etc/vz/conf/<ve_id>.conf.

Once those three files are correctly set, creating a new VE is just the command: vzctl create <ve_id>.