Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Configuring container creation

1,711 bytes added, 12:18, 18 March 2008
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...
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 file <code>/etc/vz/vz.conf</code>. 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: <code>/vz/template/cache/<dist>.tar.gz</code>. 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 <code>/etc/vz/dists/fedora-8-i386-minimal.conf</code>, second will be <code>/etc/vz/dists/fedora-8-i386.conf</code>, third <code>/etc/vz/dists/fedora-8.conf</code>, and finally <code>/etc/vz/dists/fedora.conf</code>. If not found, the <code>/etc/vz/dists/default.conf</code> will be used.

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

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