6,534
edits
Changes
better formatting; separated into sections; VE->container; categorized
The creation of a VE container with vzctl needs three configuration files:<pre>* /etc/vz/vz.conf* /etc/vz/dists/<dist>''distro-name''.conf* /etc/vz/conf/ve-<parameters>''config-name''.conf-sample</pre>
=== DEF_OSTEMPLATE ===The other important line in the file <code>/etc/vz/vz.conf</code> first is '''CONFIGFILEDEF_OSTEMPLATE="<parameters>''distro''"'''. It provides sets the name of the VE parameters file: <code>/etc/vz/conf/ve-<parameters>default distribution used for container creation (i.conf-sample</code>, e a default for example: <code>/etc/vz/conf/ve-light.conf-sampleostemplate</code>argument). During VE creation, a copy An example of this file will be done with the ''distro'<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> -fedora-parameter newValue 8-i386-save'''), ''minimal'parameter="newValue"''' is saved in <code>/etc/vz/conf/<ve_id>.conf</code>.
First, this provides the name of the tar file of container template cache: <code>/vz/template/cache/''distro''.tar.gz</code>. Also, it gives the distribution configuration file, 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. Say, if ''distro'' is '''fedora-8-i386-minimal''', then the following files are tried, in sequence:* <code>/etc/vz/dists/fedora-8-i386-minimal.conf</code>* <code>/etc/vz/dists/fedora-8-i386.conf</code>* <code>/etc/vz/dists/fedora-8.conf</code>* <code>/etc/vz/dists/fedora.conf</code>. If not found, the <code>/etc/vz/dists/default.conf</code> is used (and the appropriate warning printed). === CONFIGFILE ===The other important line in the file <code>/etc/vz/vz.conf</code> is '''CONFIGFILE="''config-name''"'''. It provides the name of the container configuration file: <code>/etc/vz/conf/ve-''config-name''.conf-sample</code> (for example, <code>/etc/vz/conf/ve-light.conf-sample</code>). During container creation, this configuration file is copied to <code>''CTID''.conf</code>, for example, with CTID of 123: <code>/etc/vz/conf/123.conf</code>. Whenever a parameter is changed for this container ('''vzctl set CTID --parameter newValue --save'''), '''parameter="newValue"''' line is added to (or replaced in) <code>/etc/vz/conf/''CTID''.conf</code>. Once those three files are correctly set, creating a new VE container is just the command: ''' vzctl create <ve_id>'''.CTID [[Category: Installation]][[Category: vzctl]]