Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Man/vzctl.8

57,148 bytes added, 21:17, 29 May 2011
beta version of man2wiki man page (work in progress!)
== NAME ==

<p style="margin-left:11%; margin-top: 1em">vzctl &minus;
utility to control an OpenVZ container.</p>

== SYNOPSIS ==

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>create</b> <i>CTID</i>
[<b>--ostemplate</b> <i>name</i>] [<b>--config</b>
<i>name</i>] [<b>--private</b> <i>path</i>] [<b>--root</b>
<i>path</i>] [<b>--ipadd</b> <i>addr</i>] [<b>--hostname</b>
<i>name</i>]</p>

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>set</b> <i>CTID parameters</i>
[<b>--save</b>]</p>

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>destroy</b> | <b>mount</b> | <b>umount</b>
| <b>start</b> | <b>stop</b> | <b>restart</b> |
<b>status</b> | <b>quotaon</b> | <b>quotaoff</b> |
<b>quotainit</b> <i>CTID</i></p>

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>exec</b> | <b>exec2</b> <i>CTID
command</i> [<i>arg</i> ...]</p>

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>enter</b> <i>CTID</i> [<b>--exec</b>
<i>command</i> [<i>arg</i> ...]]</p>

<p style="margin-left:11%; margin-top: 1em">vzctl
[<i>flags</i>] <b>runscript</b> <i>CTID script</i></p>

<p style="margin-left:11%; margin-top: 1em">vzctl
<b>--help</b> | <b>--version</b></p>

== DESCRIPTION ==

<p style="margin-left:11%; margin-top: 1em">Utility
<b>vzctl</b> runs on the host system (otherwise known as
Hardware Node, or HN) and performs direct manipulations with
containers (CTs).</p>

<p style="margin-left:11%; margin-top: 1em">Containers can
be referred to by either numeric <i>CTID</i> or by name (see
<b>--name</b> option). Note that CT ID &lt;= 100 are
reserved for OpenVZ internal purposes.</p>

== OPTIONS ==

=== Flags ===

<p style="margin-top: 1em">These flags come before a
command, and can be used with any command. They affect
logging to console (terminal) only, and do not affect
logging to a log file.</p>

<p style="margin-left:11%;"><b>--quiet</b></p>

<p style="margin-left:17%;">Disables output. Note that
scripts run by vzctl are still able to produce some
output.</p>

<p style="margin-left:11%;"><b>--verbose</b></p>

<p style="margin-left:17%;">Increments logging level up
from the default. Can be used multiple times. Default value
is set to the value of <b>VERBOSE</b> parameter in the
global configuration file [[Man/vz.conf.5|<b>vz.conf</b>(5)]], or to <b>0</b>
if not set by <b>VERBOSE</b> parameter.</p>

=== Setting container parameters ===

<p style="margin-left:11%;"><b>set</b> <i>CTID
parameters</i> [<b>--save</b>] [<b>--force</b>]</p>

<p style="margin-left:17%;">This command sets various
container parameters. If a <b>--save</b> flag is given,
parameters are saved in container configuration file
[[Man/ctid.conf.5|<b>ctid.conf</b>(5)]]. Use <b>--force</b> to save the
parameters even if the current kernel doesn&rsquo;t support
OpenVZ. If the container is currently running, <b>vzctl</b>
applies these parameters to the container.</p>

<p style="margin-left:17%; margin-top: 1em">The following
parameters can be used with <b>set</b> command.</p>

<p style="margin-left:11%;"><b>Miscellaneous <br>
--onboot yes</b>|<b>no</b></p>

<p style="margin-left:17%;">Sets whether the container will
be started during system boot. The container will not be
auto-started unless this parameter is set to <i>yes</i>.</p>

<p style="margin-left:11%;"><b>--bootorder</b>
<i>number</i></p>

<p style="margin-left:17%;">Sets the boot order priority
for this CT. The higher the <i>number</i> is, the earlier in
the boot process this container starts. By default this
parameter is unset, which is considered to be the lowest
priority, so containers with unset <b>bootorder</b> will
start last.</p>

<p style="margin-left:11%;"><b>--root</b> <i>path</i></p>

<p style="margin-left:17%;">Sets the path to root directory
for this container. This is essentially a mount point for
container&rsquo;s root directory. Argument can contain
literal string <b>$VEID</b>, which will be substituted with
the numeric CT ID. Changing this parameter is not
recommended, better edit [[Man/vz.conf.5|<b>vz.conf</b>(5)]] global
configuration file.</p>

<p style="margin-left:11%;"><b>--userpasswd</b>
<i>user</i>:<i>password</i></p>

<p style="margin-left:17%;">Sets password for the given
user in a container, creating the user if it does not
exists. Note that this option is not saved in configuration
file at all (so <b>--save</b> flag is useless), it is
applied to the container (by modifying its /etc/passwd and
/etc/shadow files).</p>

<p style="margin-left:17%; margin-top: 1em">In case
container root filesystem is not mounted, it is
automatically mounted, then all the appropriate file changes
are applied, then it is unmounted.</p>

<p style="margin-left:17%; margin-top: 1em">Note that
container should be created before using this option.</p>

<p style="margin-left:11%;"><b>--disabled</b>
<i>yes</i>|<i>no</i></p>

<p style="margin-left:17%;">Disable container start. To
force the start of a disabled container, use <b>vzctl start
--force</b>.</p>

<p style="margin-left:11%;"><b>--name</b> <i>name</i></p>

<p style="margin-left:17%;">Add a name for a container. The
<i>name</i> can later be used in subsequent calls to
<b>vzctl</b> in place of <i>CTID</i>.</p>

<p style="margin-left:11%;"><b>--description</b>
<i>string</i></p>

<p style="margin-left:17%;">Add a textual description for a
container.</p>

<p style="margin-left:11%;"><b>--setmode
restart</b>|<b>ignore</b></p>

<p style="margin-left:17%;">Whether to restart a container
after applying parameters that require the container to be
restarted in order to take effect.</p>

<p style="margin-left:11%;"><b>Networking <br>
--ipadd</b> <i>addr</i></p>

<p style="margin-left:17%;">Adds IP address to a given
container. Note that this option is incremental, so
<i>addr</i> are added to already existing ones.</p>

<p style="margin-left:11%;"><b>--ipdel</b> <i>addr</i> |
<b>all</b></p>

<p style="margin-left:17%;">Removes IP address <i>addr</i>
from a container. If you want to remove all the addresses,
use <b>--ipdel all</b>.</p>

<p style="margin-left:11%;"><b>--hostname</b>
<i>name</i></p>

<p style="margin-left:17%;">Sets container hostname.
<b>vzctl</b> writes it to the appropriate file inside a
container (distribution-dependent).</p>

<p style="margin-left:11%;"><b>--nameserver</b>
<i>addr</i></p>

<p style="margin-left:17%;">Sets DNS server IP address for
a container. If you want to set several nameservers, you
should do it at once, so use <b>--nameserver</b> option
multiple times in one call to <b>vzctl</b>, as all the name
server values set in previous calls to <b>vzctl</b> are
overwritten.</p>

<p style="margin-left:11%;"><b>--searchdomain</b>
<i>name</i></p>

<p style="margin-left:17%;">Sets DNS search domains for a
container. If you want to set several search domains, you
should do it at once, so use <b>--searchdomain</b> option
multiple times in one call to <b>vzctl</b>, as all the
search domain values set in previous calls to <b>vzctl</b>
are overwritten.</p>

<p style="margin-left:11%;"><b>--netif_add</b>
<i>ifname[</i>,<i>mac</i>,<i>host_ifname</i>,<i>host_mac</i>,<i>bridge]</i></p>

<p style="margin-left:17%;">Adds a virtual Ethernet device
(veth) to a given container. Here <i>ifname</i> is the
Ethernet device name in the container, <i>mac</i> is its MAC
address, <i>host_ifname</i> is the Ethernet device name on
the host, and <i>host_mac</i> is its MAC address. MAC
addresses should be in the format like XX:XX:XX:XX:XX:XX.
<i>bridge</i> is an optional parameter which can be used in
custom network start scripts to automatically add the
interface to a bridge. All parameters except <i>ifname</i>
are optional and are automatically generated if not
specified.</p>

<p style="margin-left:11%;"><b>--netif_del</b>
<i>dev_name</i> | <b>all</b></p>

<p style="margin-left:17%;">Removes virtual Ethernet device
from a container. If you want to remove all devices, use
<b>all</b>.</p>

<p style="margin-left:11%;"><b>Veth interface
configuration</b></p>

<p style="margin-left:11%; margin-top: 1em">The following
options can be used to reconfigure the already-created
virtual Ethernet interface. To select the interface to
configure, use <b>--ifname</b> <i>name</i> option. <b><br>
--mac</b> <i>XX:XX:XX:XX:XX:XX</i></p>

<p style="margin-left:22%;">MAC address of interface inside
a container.</p>

<p style="margin-left:11%;"><b>--host_ifname</b>
<i>name</i></p>

<p style="margin-left:22%;">interface name for virtual
interface in the host system.</p>

<p style="margin-left:11%;"><b>--host_mac</b>
<i>XX:XX:XX:XX:XX:XX</i></p>

<p style="margin-left:22%;">MAC address of interface in the
host system.</p>

<p style="margin-left:11%;"><b>--bridge</b> <i>name</i></p>

<p style="margin-left:22%;">Bridge name. Custom network
start scripts can use this value to automatically add the
interface to a bridge.</p>

<p style="margin-left:11%;"><b>--mac_filter</b>
<i>on|off</i></p>

<p style="margin-left:22%;">Enables/disables MAC address
filtering for the Container veth device and the possibility
of configuring the MAC address of this device from inside
the Container. If the filtering is turned on: <br>
&bull; the veth device accepts only those packets that have
a MAC address in their headers corresponding to that of this
device (excluding all broadcast and multicast packets); <br>
&bull; it is impossible to modify the veth MAC address from
inside the Container.</p>

<p style="margin-left:22%; margin-top: 1em">By default,
this functionality is enabled for all veth devices existing
inside the Container.</p>

<p style="margin-left:11%;"><b>Resource limits</b></p>

<p style="margin-left:22%; margin-top: 1em">The following
options sets barrier and limit for various user
beancounters. Each option requires one or two arguments. In
case of one argument, <b>vzctl</b> sets barrier and limit to
the same value. In case of two colon-separated arguments,
the first is a barrier, and the second is a limit. Each
argument is either a number, a number with a suffix, or a
special value <b>unlimited</b>.</p>

<p style="margin-left:22%; margin-top: 1em">Arguments are
in items, pages or bytes. Note that page size is
architecture-specific, it is 4096 bytes on IA32
platform.</p>

<p style="margin-left:22%; margin-top: 1em">You can also
specify different suffixes for <b>set</b> parameters (except
for the parameters which names start with <b>num</b>). For
example, <b>vzctl set</b> <i>CTID</i> <b>--privvmpages
5M:6M</b> should set <b>privvmpages</b>&rsquo; barrier to 5
megabytes and its limit to 6 megabytes.</p>

<p style="margin-left:22%; margin-top: 1em">Available
suffixes are: <b><br>
g</b>, <b>G</b> -- gigabytes. <b><br>
m</b>, <b>M</b> -- megabytes. <b><br>
k</b>, <b>K</b> -- kilobytes. <b><br>
p</b>, <b>P</b> -- pages (page is 4096 bytes on x86
architecture, other architectures may differ).</p>

<p style="margin-left:22%; margin-top: 1em">You can also
specify the literal word <b>unlimited</b> in place of a
number. In that case the corresponding value will be set to
<b>LONG_MAX</b>, i. e. the maximum possible value.</p>

<p style="margin-left:11%;"><b>--numproc</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Maximum number of processes and
kernel-level threads. Setting the barrier and the limit to
different values does not make practical sense.</p>

<p style="margin-left:11%;"><b>--numtcpsock</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Maximum number of TCP sockets.
This parameter limits the number of TCP connections and,
thus, the number of clients the server application can
handle in parallel. Setting the barrier and the limit to
different values does not make practical sense.</p>

<p style="margin-left:11%;"><b>--numothersock</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Maximum number of non-TCP
sockets (local sockets, UDP and other types of sockets).
Setting the barrier and the limit to different values does
not make practical sense.</p>

<p style="margin-left:11%;"><b>--vmguarpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">Memory allocation guarantee.
This parameter controls how much memory is available to a
container. The barrier is the amount of memory that
container&rsquo;s applications are guaranteed to be able to
allocate. The meaning of the limit is currently unspecified;
it should be set to <b>unlimited</b>.</p>

<p style="margin-left:11%;"><b>--kmemsize</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum amount of kernel memory
used. This parameter is related to <b>--numproc</b>. Each
process consumes certain amount of kernel memory - 16 KB at
least, 30-50 KB typically. Very large processes may consume
a bit more. It is important to have a certain safety gap
between the barrier and the limit of this parameter: equal
barrier and limit may lead to the situation where the kernel
will need to kill container&rsquo;s applications to keep the
<b>kmemsize</b> usage under the limit.</p>

<p style="margin-left:11%;"><b>--tcpsndbuf</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum size of TCP send
buffers. Barrier should be not less than 64 KB, and
difference between barrier and limit should be equal to or
more than value of <b>numtcpsock</b> multiplied by 2.5
KB.</p>

<p style="margin-left:11%;"><b>--tcprcvbuf</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum size of TCP receive
buffers. Barrier should be not less than 64 KB, and
difference between barrier and limit should be equal to or
more than value of <b>numtcpsock</b> multiplied by 2.5
KB.</p>

<p style="margin-left:11%;"><b>--othersockbuf</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum size of other (non-TCP)
socket send buffers. If container&rsquo;s processes needs to
send very large datagrams, the barrier should be set
accordingly. Increased limit is necessary for high
performance of communications through local (UNIX-domain)
sockets.</p>

<p style="margin-left:11%;"><b>--dgramrcvbuf</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum size of other (non-TCP)
socket receive buffers. If container&rsquo;s processes needs
to receive very large datagrams, the barrier should be set
accordingly. The difference between the barrier and the
limit is not needed.</p>

<p style="margin-left:11%;"><b>--oomguarpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">Guarantees against OOM kill.
Under this beancounter the kernel accounts the total amount
of memory and swap space used by the container&rsquo;s
processes. The barrier of this parameter is the
out-of-memory guarantee. If the <b>oomguarpages</b> usage is
below the barrier, processes of this container are
guaranteed not to be killed in out-of-memory situations. The
meaning of limit is currently unspecified; it should be set
to <b>unlimited</b>.</p>

<p style="margin-left:11%;"><b>--lockedpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">Maximum number of pages
acquired by <b>mlock</b>(2).</p>

<p style="margin-left:11%;"><b>--privvmpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">Allows controlling the amount
of memory allocated by the applications. For shared (mapped
as <b>MAP_SHARED</b>) pages, each container really using a
memory page is charged for the fraction of the page
(depending on the number of others using it). For
&quot;potentially private&quot; pages (mapped as
<b>MAP_PRIVATE</b>), container is charged either for a
fraction of the size or for the full size if the allocated
address space. In the latter case, the physical pages
associated with the allocated address space may be in
memory, in swap or not physically allocated yet.</p>

<p style="margin-left:22%; margin-top: 1em">The barrier and
the limit of this parameter control the upper boundary of
the total size of allocated memory. Note that this upper
boundary does not guarantee that container will be able to
allocate that much memory. The primary mechanism to control
memory allocation is the <b>--vmguarpages</b> guarantee.</p>

<p style="margin-left:11%;"><b>--shmpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">Maximum IPC SHM segment size.
Setting the barrier and the limit to different values does
not make practical sense.</p>

<p style="margin-left:11%;"><b>--numfile</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Maximum number of open files.
In most cases the barrier and the limit should be set to the
same value. Setting the barrier to <b>0</b> effectively
disables pre-charging optimization for this beancounter in
the kernel, which leads to the held value being precise but
could slightly degrade file open performance.</p>

<p style="margin-left:11%;"><b>--numflock</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Maximum number of file locks.
Safety gap should be between barrier and limit.</p>

<p style="margin-left:11%;"><b>--numpty</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Number of pseudo-terminals
(PTY). Note that in OpenVZ each container can have not more
than 255 PTYs. Setting the barrier and the limit to
different values does not make practical sense.</p>

<p style="margin-left:11%;"><b>--numsiginfo</b>
<i>items</i>[:<i>items</i>]</p>

<p style="margin-left:22%;">Number of siginfo structures.
Setting the barrier and the limit to different values does
not make practical sense.</p>

<p style="margin-left:11%;"><b>--dcachesize</b>
<i>bytes</i>[:<i>bytes</i>]</p>

<p style="margin-left:22%;">Maximum size of
filesystem-related caches, such as directory entry and inode
caches. Exists as a separate parameter to impose a limit
causing file operations to sense memory shortage and return
an errno to applications, protecting from memory shortages
during critical operations that should not fail. Safety gap
should be between barrier and limit.</p>

<p style="margin-left:11%;"><b>--numiptent</b>
<i>num</i>[:<i>num</i>]</p>

<p style="margin-left:22%;">Number of iptables (netfilter)
entries. Setting the barrier and the limit to different
values does not make practical sense.</p>

<p style="margin-left:11%;"><b>--physpages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">This is currently an
accounting-only parameter. It shows the usage of RAM by this
container. Barrier should be set to 0, and limit should be
set to <b>unlimited</b>.</p>

<p style="margin-left:11%;"><b>--swappages</b>
<i>pages</i>[:<i>pages</i>]</p>

<p style="margin-left:22%;">The limit, if set, is used to
show a total amount of swap space available inside the
container. The barrier of this parameter is currently
ignored. The default value is <b>unlimited</b>, meaning
total swap will be reported as 0.</p>

<p style="margin-left:22%; margin-top: 1em">Note that in
order for the value to be shown as total swap space,
<b>--meminfo</b> parameter should be set to value other than
<b>none</b>.</p>

<p style="margin-left:11%;"><b>CPU fair scheduler
parameters</b></p>

<p style="margin-left:22%; margin-top: 1em">These
parameters control CPU usage by container.</p>

<p style="margin-left:11%;"><b>--cpuunits</b>
<i>num</i></p>

<p style="margin-left:22%;">CPU weight for a container.
Argument is positive non-zero number, passed to and used in
the kernel fair scheduler. The larger the number is, the
more CPU time this container gets. Maximum value is 500000,
minimal is 8. Number is relative to weights of all the other
running containers. If <b>cpuunits</b> are not specified,
default value of 1000 is used.</p>

<p style="margin-left:22%; margin-top: 1em">You can set CPU
weight for CT0 (host system itself) as well (use <b>vzctl
set 0 --cpuunits</b> <i>num</i>). Usually, OpenVZ initscript
(<b>/etc/init.d/vz</b>) takes care of setting this.</p>

<p style="margin-left:11%;"><b>--cpulimit</b>
<i>num</i>[<b>%</b>]</p>

<p style="margin-left:22%;">Limit of CPU usage for the
container, in per cent. Note if the computer has 2 CPUs, it
has total of 200% CPU time. Default CPU limit is <b>0</b>
(no CPU limit).</p>

<p style="margin-left:11%;"><b>--cpus</b> <i>num</i></p>

<p style="margin-left:22%;">sets number of CPUs available
in the container.</p>

<p style="margin-left:11%;"><b>--cpumask</b> <i>cpus</i> |
<b>all</b></p>

<p style="margin-left:22%;">sets list of allowed CPUs for
the container. Input format is a comma-separated list of
decimal numbers and ranges. Consecutively set bits are shown
as two hyphen-separated decimal numbers, the smallest and
largest bit numbers set in the range. For example, if you
want the container to execute on CPUs 0, 1, 2, 7, you should
pass <b>0-2,7</b>. Default value is <b>all</b> (the
container can execute on any CPU).</p>

<p style="margin-left:11%;"><b>Memory output
parameters</b></p>

<p style="margin-left:22%; margin-top: 1em">This parameter
control output of /proc/meminfo inside a container.</p>

<p style="margin-left:11%;"><b>--meminfo none</b></p>

<p style="margin-left:22%;">No /proc/meminfo virtualization
(the same as on host system).</p>

<p style="margin-left:11%;"><b>--meminfo</b>
<i>mode</i>:<i>value</i></p>

<p style="margin-left:22%;">Configure total memory output
in a container. Reported free memory is evaluated
accordingly to the mode being set. Reported swap is
evaluated according to the settings of <b>--swappages</b>
parameter.</p>

<p style="margin-left:22%; margin-top: 1em">You can use the
following modes for <i>mode</i>: <br>
&bull; <b>pages</b>:<i>value</i> - sets total memory in
pages; <br>
&bull; <b>privvmpages</b>:<i>value</i> - sets total memory
as <b>privvmpages</b> * <i>value</i>.</p>

<p style="margin-left:22%; margin-top: 1em">Default is
<b>privvmpages:1</b>.</p>

<p style="margin-left:11%;"><b>Iptables control parameters
<br>
--iptables</b> <i>name</i></p>

<p style="margin-left:22%;">Allow to use the functionality
of <i>name</i> iptables module inside the container. To
specify multiple <i>name</i>s, repeat --iptables for each,
or use space-separated list as an argument (enclosed in
single or double quotes to protect spaces).</p>

<p style="margin-left:22%; margin-top: 1em">The default
list of enabled iptables modules is specified by the
<b>IPTABLES</b> variable in [[Man/vz.conf.5|<b>vz.conf</b>(5)]].</p>

<p style="margin-left:22%; margin-top: 1em">You can use the
following values for <i>name</i>: <b>iptable_filter</b>,
<b>iptable_mangle</b>, <b>ipt_limit</b>,
<b>ipt_multiport</b>, <b>ipt_tos</b>, <b>ipt_TOS</b>,
<b>ipt_REJECT</b>, <b>ipt_TCPMSS</b>, <b>ipt_tcpmss</b>,
<b>ipt_ttl</b>, <b>ipt_LOG</b>, <b>ipt_length</b>,
<b>ip_conntrack</b>, <b>ip_conntrack_ftp</b>,
<b>ip_conntrack_irc</b>, <b>ipt_conntrack</b>,
<b>ipt_state</b>, <b>ipt_helper</b>, <b>iptable_nat</b>,
<b>ip_nat_ftp</b>, <b>ip_nat_irc</b>, <b>ipt_REDIRECT</b>,
<b>xt_mac</b>, <b>ipt_recent</b>, <b>ipt_owner</b>.</p>

<p style="margin-left:11%;"><b>Network devices control
parameters <br>
--netdev_add</b> <i>name</i></p>

<p style="margin-left:22%;">move network device from the
host system to a specified container</p>

<p style="margin-left:11%;"><b>--netdev_del</b>
<i>name</i></p>

<p style="margin-left:22%;">delete network device from a
specified container</p>

<p style="margin-left:11%;"><b>Disk quota parameters <br>
--diskquota yes</b>|<b>no</b></p>

<p style="margin-left:22%;">allows to enable or disable
disk quota for a container. By default, a global value
(<b>DISK_QUOTA</b>) from [[Man/vz.conf.5|<b>vz.conf</b>(5)]] is used.</p>

<p style="margin-left:11%;"><b>--diskspace</b>
<i>num</i>[:<i>num</i>]</p>

<p style="margin-left:22%;">sets soft and hard disk quota
limits, in blocks. First parameter is soft limit, second is
hard limit. One block is currently equal to 1Kb. Suffixes
<b>G</b>, <b>M</b>, <b>K</b> can also be specified (see
<b>Resource limits</b> section for more info on
suffixes).</p>

<p style="margin-left:11%;"><b>--diskinodes</b>
<i>num</i>[:<i>num</i>]</p>

<p style="margin-left:22%;">sets soft and hard disk quota
limits, in i-nodes. First parameter is soft limit, second is
hard limit.</p>

<p style="margin-left:11%;"><b>--quotatime</b>
<i>seconds</i></p>

<p style="margin-left:22%;">sets quota grace period.
Container is permitted to exceed its soft limits for the
grace period, but once it has expired, the soft limit is
enforced as a hard limit.</p>

<p style="margin-left:11%;"><b>--quotaugidlimit</b>
<i>num</i></p>

<p style="margin-left:22%;">sets maximum number of
user/group IDs in a container for which disk quota inside
the container will be accounted. If this value is set to
<b>0</b>, user and group quotas inside the container will
not be accounted.</p>

<p style="margin-left:22%; margin-top: 1em">Note that if
you have previously set value of this parameter to <b>0</b>,
changing it while the container is running will not take
effect.</p>

<p style="margin-left:11%;"><b>Mount option <br>
--noatime yes</b> | <b>no</b></p>

<p style="margin-left:22%;">Sets noatime flag (do not
update inode access times) on filesystem.</p>

<p style="margin-left:11%;"><b>Capability option <br>
--capability</b> <i>capname</i>:<b>on</b>|<b>off</b></p>

<p style="margin-left:22%;">Sets a capability for a
container. Note that setting capability when the container
is running does not take immediate effect; restart the
container in order for the changes to take effect. Note a
container has default set of capabilities, thus any
operation on capabilities is &quot;logical and&quot; with
the default capability mask.</p>

<p style="margin-left:22%; margin-top: 1em">You can use the
following values for <i>capname</i>: <b>chown</b>,
<b>dac_override</b>, <b>dac_read_search</b>, <b>fowner</b>,
<b>fsetid</b>, <b>kill</b>, <b>setgid</b>, <b>setuid</b>,
<b>setpcap</b>, <b>linux_immutable</b>,
<b>net_bind_service</b>, <b>net_broadcast</b>,
<b>net_admin</b>, <b>net_raw</b>, <b>ipc_lock</b>,
<b>ipc_owner</b>, <b>sys_module</b>, <b>sys_rawio</b>,
<b>sys_chroot</b>, <b>sys_ptrace</b>, <b>sys_pacct</b>,
<b>sys_admin</b>, <b>sys_boot</b>, <b>sys_nice</b>,
<b>sys_resource</b>, <b>sys_time</b>, <b>sys_tty_config</b>,
<b>mknod</b>, <b>lease</b>, <b>setveid</b>, <b>ve_admin</b>.
For detailed description, see <b>capabilities</b>(7).</p>

<p style="margin-left:22%; margin-top: 1em"><b>WARNING</b>:
setting some of those capabilities may have far reaching
security implications, so do not do it unless you know what
you are doing. Also note that setting <b>setpcap:on</b> for
a container will most probably lead to inability to start
it.</p>

<p style="margin-left:11%;"><b>Device access management
<br>
--devnodes</b> <i>device</i>:<b>[r][w][q]|none</b></p>

<p style="margin-left:22%;">Give the container an access
(<b>r</b> - read, <b>w</b> - write, <b>q</b> - disk quota
management, <b>none</b> - no access) to a device designated
by the special file /dev/<i>device</i>. Device file is
created in a container by <b>vzctl</b>. Example: <b>vzctl
set 777 --devnodes sdb:rwq</b>.</p>

<p style="margin-left:11%;"><b>--devices
b|c</b>:<i>major</i>:<i>minor</i>|<b>all</b>:<b>[r][w][q]|none</b></p>

<p style="margin-left:22%;">Give the container an access to
a <b>b</b>lock or <b>c</b>haracter device designated by its
<i>major</i> and <i>minor</i> numbers. Device file have to
be created manually.</p>

<p style="margin-left:11%;"><b>PCI device management <br>
--pci_add</b>
[<i>domain</i><b>:</b>]<i>bus</i><b>:</b><i>slot</i><b>.</b><i>func</i></p>

<p style="margin-left:22%;">Give the container an access to
a specified PCI device. All numbers are hexadecimal (as
printed by <b>lspci</b>(8) in the first column).</p>

<p style="margin-left:11%;"><b>--pci_del</b>
[<i>domain</i><b>:</b>]<i>bus</i><b>:</b><i>slot</i><b>.</b><i>func</i></p>

<p style="margin-left:22%;">Delete a PCI device from the
container.</p>

<p style="margin-left:22%; margin-top: 1em">Note that
<b>vps-pci</b> configuration script is executed by
<b>vzctl</b> then configuring PCI devices. The script is
usually located at <b>/usr/lib[64]/vzctl/scripts/</b>.</p>

<p style="margin-left:11%;"><b>Features management <br>
--features</b> <i>name</i><b>:on</b>|<b>off</b></p>

<p style="margin-left:22%;">Enable or disable a specific
container feature. Known features are: <b>sysfs</b>,
<b>nfs</b>, <b>sit</b>, <b>ipip</b>, <b>ppp</b>,
<b>ipgre</b>, <b>bridge</b>, <b>nfsd</b>.</p>

<p style="margin-left:11%;"><b>Apply config <br>
--applyconfig</b> <i>name</i></p>

<p style="margin-left:22%;">Read container parameters from
the container sample configuration file
<tt>/etc/vz/conf/ve-</tt><i>name</i><tt>.conf-sample</tt>,
and apply them, if <b>--save</b> option specified save to
the container config file. The following parameters are not
changed: <b>HOSTNAME</b>, <b>IP_ADDRESS</b>,
<b>OSTEMPLATE</b>, <b>VE_ROOT</b>, and
<b>VE_PRIVATE</b>.</p>

<p style="margin-left:11%;"><b>--applyconfig_map</b>
<i>group</i></p>

<p style="margin-left:22%;">Apply container config
parameters selected by <i>group</i>. Now the only possible
value for <i>group</i> is <b>name</b>: to restore container
name based on <b>NAME</b> variable in container
configuration file.</p>

<p style="margin-left:11%;"><b>I/O priority management <br>
--ioprio</b> <i>priority</i></p>

<p style="margin-left:22%;">Assigns I/O priority to
container. <i>Priority</i> range is <b>0-7</b>. The greater
<i>priority</i> is, the more time for I/O activity container
has. By default each container has <i>priority</i> of
<b>4</b>.</p>

=== Checkpointing and restore ===

<p style="margin-top: 1em">Checkpointing is a feature of
OpenVZ kernel which allows to save a complete state of a
running container, and to restore it later.</p>

<p style="margin-left:11%;"><b>chkpnt</b> <i>CTID</i>
[<b>--dumpfile</b> <i>name</i>]</p>

<p style="margin-left:17%;">This command saves a complete
state of a running container to a dump file, and stops the
container. If an option <b>--dumpfile</b> is not set,
default dump file name <b>/vz/dump/Dump.</b><i>CTID</i> is
used.</p>

<p style="margin-left:11%;"><b>restore</b> <i>CTID</i>
[<b>--dumpfile</b> <i>name</i>]</p>

<p style="margin-left:17%;">This command restores a
container from the dump file created by the <b>chkpnt</b>
command.</p>

=== Performing container actions ===

<p style="margin-left:11%;"><b>create</b> <i>CTID</i>
[<b>--ostemplate</b> <i>name</i>] [<b>--config</b>
<i>name</i>] [<b>--private</b> <i>path</i>] <br>
[<b>--root</b> <i>path</i>] [<b>--ipadd</b> <i>addr</i>]
[<b>--hostname</b> <i>name</i>]</p>

<p style="margin-left:17%;">Creates a new container area.
This operation should be done once, before the first start
of the container.</p>

<p style="margin-left:17%; margin-top: 1em">If the
<b>--config</b> option is specified, values from example
configuration file
<b>/etc/vz/conf/ve-</b><i>name</i><b>.conf-sample</b> are
put into the container configuration file. If this container
configuration file already exists, it will be removed.</p>

<p style="margin-left:17%; margin-top: 1em">You can use
<b>--root</b> <i>path</i> option to sets the path to the
mount point for the container root directory (default is
<b>VE_ROOT</b> specified in [[Man/vz.conf.5|<b>vz.conf</b>(5)]] file).
Argument can contain literal string <b>$VEID</b>, which will
be substituted with the numeric CT ID.</p>

<p style="margin-left:17%; margin-top: 1em">You can use
<b>--private</b> <i>path</i> option to set the path to
directory in which all the files and directories specific to
this very container are stored (default is <b>VE_PRIVATE</b>
specified in [[Man/vz.conf.5|<b>vz.conf</b>(5)]] file). Argument can contain
literal string <b>$VEID</b>, which will be substituted with
the numeric CT ID.</p>

<p style="margin-left:17%; margin-top: 1em">You can use
<b>--ipadd</b> <i>addr</i> option to assign an IP address to
a container. Note that this option can be used multiple
times.</p>

<p style="margin-left:17%; margin-top: 1em">You can use
<b>--hostname</b> <i>name</i> option to set a host name for
a container.</p>

<p style="margin-left:11%;"><b>destroy</b> |
<b>delete</b></p>

<p style="margin-left:17%;">Removes a container private
area by deleting all files, directories and the
configuration file of this container.</p>

<p style="margin-left:11%;"><b>start</b> [<b>--wait</b>]
[<b>--force</b>]</p>

<p style="margin-left:17%;">Mounts (if necessary) and
starts a container. Unless <b>--wait</b> option is
specified, <b>vzctl</b> will return immediately; otherwise
an attempt to wait till the default runlevel is reached will
be made by <b>vzctl</b>.</p>

<p style="margin-left:17%; margin-top: 1em">Specify
<b>--force</b> if you want to start a container which is
disabled (see <b>--disabled</b>).</p>

<p style="margin-left:17%; margin-top: 1em">Note that this
command can lead to execution of <b>premount</b>,
<b>mount</b> and <b>start</b> action scripts (see <b>ACTION
SCRIPTS</b> below).</p>

<p style="margin-left:11%;"><b>stop</b> [<b>--fast</b>]</p>

<p style="margin-left:17%;">Stops and unmounts a container.
Normally, <b>halt</b>(8) is executed inside a container;
option <b>--fast</b> makes <b>vzctl</b> use <b>reboot</b>(2)
syscall instead which is faster but can lead to unclean
container shutdown.</p>

<p style="margin-left:17%; margin-top: 1em">Note that this
command can lead to execution of <b>stop</b>, <b>umount</b>
and <b>postumount</b> action scripts (see <b>ACTION
SCRIPTS</b> below).</p>

<p style="margin-left:11%;"><b>restart</b></p>

<p style="margin-left:17%;">Restarts a container, i.e.
stops it if it is running, and starts again. Accepts all the
<b>start</b> and <b>stop</b> options.</p>

<p style="margin-left:17%; margin-top: 1em">Note that this
command can lead to execution of some action scripts (see
<b>ACTION SCRIPTS</b> below).</p>

<p style="margin-left:11%;"><b>status</b></p>

<p style="margin-left:17%;">Shows a container status. This
is a line with five or six words, separated by spaces.</p>

<p style="margin-left:17%; margin-top: 1em">First word is
literally <b>CTID</b>.</p>

<p style="margin-left:17%; margin-top: 1em">Second word is
the numeric <i>CT ID</i>.</p>

<p style="margin-left:17%; margin-top: 1em">Third word is
showing whether this container exists or not, it can be
either <b>exist</b> or <b>deleted</b>.</p>

<p style="margin-left:17%; margin-top: 1em">Fourth word is
showing the status of the container filesystem, it can be
either <b>mounted</b> or <b>unmounted</b>.</p>

<p style="margin-left:17%; margin-top: 1em">Fifth word
shows if the container is running, it can be either
<b>running</b> or <b>down</b>.</p>

<p style="margin-left:17%; margin-top: 1em">Sixth word, if
exists, is <b>suspended</b>. It appears if both a container
and its dump file exist (see <b>chkpnt</b>).</p>

<p style="margin-left:17%; margin-top: 1em">This command
can also be usable from scripts.</p>

<p style="margin-left:11%;"><b>mount</b></p>

<p style="margin-left:17%;">Mounts container private area.
Note that this command can lead to execution of
<b>premount</b> and <b>mount</b> action scripts (see
<b>ACTION SCRIPTS</b> below).</p>

<p style="margin-left:11%;"><b>umount</b></p>

<p style="margin-left:17%;">Unmounts container private
area. Note that this command can lead to execution of
<b>umount</b> and <b>postumount</b> action scripts (see
<b>ACTION SCRIPTS</b> below).</p>

<p style="margin-left:17%; margin-top: 1em">Note that
<b>stop</b> does <b>umount</b> automatically.</p>

<p style="margin-left:11%;"><b>quotaon</b> <i>ctid</i></p>

<p style="margin-left:17%;">Turn disk quota on. Not that
<b>mount</b> and <b>start</b> does that automatically.</p>

<p style="margin-left:11%;"><b>quotaoff</b> <i>ctid</i></p>

<p style="margin-left:17%;">Turn disk quota off. Not that
<b>umount</b> and <b>stop</b> does that automatically.</p>

<p style="margin-left:11%;"><b>quotainit</b>
<i>ctid</i></p>

<p style="margin-left:17%;">Initialize disk quota (i.e. run
<b>vzquota init</b>) with the parameters taken from the CT
configuration file [[Man/ctid.conf.5|<b>ctid.conf</b>(5)]].</p>

<p style="margin-left:11%;"><b>exec</b> <i>CTID
command</i></p>

<p style="margin-left:17%;">Executes <i>command</i> in a
container. Environment variables are not set inside the
container. Signal handlers may differ from default settings.
If <i>command</i> is <b>-</b>, commands are read from
stdin.</p>

<p style="margin-left:11%;"><b>exec2</b> <i>CTID
command</i></p>

<p style="margin-left:17%;">The same as <b>exec</b>, but
return code is that of <i>command</i>.</p>

<p style="margin-left:11%;"><b>runscript</b> <i>CTID
script</i></p>

<p style="margin-left:17%;">Run specified shell script in
the container. Argument <i>script</i> is a file on the host
system which contents is read by vzctl and executed in the
context of the container. For a running container, the
command jumps into the container and executes the script.
For a stopped container, it enters the container, mounts
container&rsquo;s root filesystem, executes the script, and
unmounts CT root. In the latter case, the container is not
really started, no file systems other than root (such as
<b>/proc</b>) are mounted, no startup scripts are executed
etc. Thus the environment in which the script is running is
far from normal and is only usable for very basic
operations.</p>

<p style="margin-left:11%;"><b>enter</b> [<b>--exec</b>
<i>command</i> [<i>arg</i> ...]]</p>

<p style="margin-left:17%;">Enters into a container (giving
a container&rsquo;s root shell). This option is a back-door
for host root only. The proper way to have CT root shell is
to use <b>ssh</b>(1).</p>

<p style="margin-left:17%; margin-top: 1em">Option
<b>--exec</b> is used to run <i>command</i> with arguments
after entering into container. This is useful if command to
be run requires a terminal (so <b>vzctl exec</b> can not be
used) and for some reason you can not use <b>ssh</b>(1).</p>

<p style="margin-left:17%; margin-top: 1em">You need to log
out manually from the shell to finish session (even if you
specified <b>--exec</b>).</p>

=== Other options ===

<p style="margin-left:11%;"><b>--help</b></p>

<p style="margin-left:17%;">Prints help message with a
brief list of possible options.</p>

<p style="margin-left:11%;"><b>--version</b></p>

<p style="margin-left:17%;">Prints <b>vzctl</b>
version.</p>

== ACTION SCRIPTS ==

<p style="margin-left:11%; margin-top: 1em"><b>vzctl</b>
has an ability to execute user-defined scripts when a
specific <b>vzctl</b> command is run for a container. The
following <b>vzctl</b> commands can trigger execution of
action scripts: <b>start</b>, <b>stop</b>, <b>restart</b>,
<b>mount</b> and <b>umount</b>.</p>

<p style="margin-left:11%; margin-top: 1em">Action scripts
are located in the <b>/etc/vz/conf/</b> directory. There are
global and per-CT scripts. Global scripts have a literal
prefix of <b>vps.</b> and are executed for all containers.
Per-CT scripts have a <i>CTID</i> numeric prefix and are
executed for the given container only.</p>

<p style="margin-left:11%; margin-top: 1em">There are 8
action scripts currently defined: <b><br>
vps.premount</b>, <i>CTID</i><b>.premount</b></p>

<p style="margin-left:22%;">Global and per-CT mount scripts
which are executed for a container before it is mounted.
Scripts are executed in the host OS context, while a CT is
not yet mounted or running. Global script, if exists, is
executed first.</p>

<p style="margin-left:11%;"><b>vps.mount</b>,
<i>CTID</i><b>.mount</b></p>

<p style="margin-left:22%;">Global and per-CT mount scripts
which are executed for a container right after it is
mounted. Otherwise they are the same as <b>.premount</b>
scripts.</p>

<p style="margin-left:11%;"><i>CTID</i><b>.start</b></p>

<p style="margin-left:22%;">Right after <b>vzctl</b> has
started a container, it executes this script in a container
context.</p>

<p style="margin-left:11%;"><i>CTID</i><b>.stop</b></p>

<p style="margin-left:22%;">Right before <b>vzctl</b> has
stopped a container, it executes this script in a container
context.</p>

<p style="margin-left:11%;"><b>vps.umount</b>,
<i>CTID</i><b>.umount</b></p>

<p style="margin-left:22%;">Global and per-CT umount
scripts which are executed for a container before it is
unmounted. Scripts are executed in the host OS context,
while a CT is mounted. Global script, if exists, is executed
first.</p>

<p style="margin-left:11%;"><b>vps.postumount</b>,
<i>CTID</i><b>.postumount</b></p>

<p style="margin-left:22%;">Global and per-CT umount
scripts which are executed for a container right after it is
unmounted. Otherwise they are the same as <b>.umount</b>
scripts.</p>

<p style="margin-left:22%; margin-top: 1em">The environment
passed to all the <b>*mount</b> scripts is the standard
environment of the parent (i.e. <b>vzctl</b>) with two
additional variables: <b>$VEID</b> and <b>$VE_CONFFILE</b>.
The first one holds the ID of the container, and the second
one holds the full path to the container configuration file.
If the script needs to get other CT configuration
parameters, such as <b>$VE_ROOT</b>, it needs to get those
from global and per-CT configuration files.</p>

<p style="margin-left:22%; margin-top: 1em">Here is an
example of a mount script, which makes host system&rsquo;s
/mnt/disk available to container(s). Script name can either
be <b>/etc/vz/conf/vps.mount</b> or
<b>/etc/vz/conf/</b><i>CTID</i><b>.mount</b>.</p>

<p style="margin-left:22%; margin-top: 1em"># If one of
these files does not exist then something <br>
# is really broken <br>
[ -f /etc/sysconfig/vz ] || exit 1 <br>
[ -f $VE_CONFFILE ] || exit 1 <br>
# Source both files. Note the order is important. <br>
. /etc/vz/vz.conf <br>
. $VE_CONFFILE <br>
mount -n --bind /mnt/disk $VE_ROOT/mnt/disk</p>

== EXIT STATUS ==

<p style="margin-left:11%; margin-top: 1em">Returns 0 upon
success, or an appropriate error code in case of an
error:</p>

<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>1</p></td>
<td width="7%"></td>
<td width="78%">

<p>Failed to set a UBC parameter</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>2</p></td>
<td width="7%"></td>
<td width="78%">

<p>Failed to set a fair scheduler parameter</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>3</p></td>
<td width="7%"></td>
<td width="78%">

<p>Generic system error</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>5</p></td>
<td width="7%"></td>
<td width="78%">

<p>The running kernel is not an OpenVZ kernel (or some
OpenVZ modules are not loaded)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>6</p></td>
<td width="7%"></td>
<td width="78%">

<p>Not enough system resources</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>7</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>ENV_CREATE</b> ioctl failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>8</p></td>
<td width="7%"></td>
<td width="78%">

<p>Command executed by <b>vzctl exec</b> returned non-zero
exit code</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>9</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container is locked by another <b>vzctl</b>
invocation</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>10</p></td>
<td width="7%"></td>
<td width="78%">

<p>Global OpenVZ configuration file [[Man/vz.conf.5|<b>vz.conf</b>(5)]] not
found</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>11</p></td>
<td width="7%"></td>
<td width="78%">

<p>A vzctl helper script file not found</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>12</p></td>
<td width="7%"></td>
<td width="78%">

<p>Permission denied</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>13</p></td>
<td width="7%"></td>
<td width="78%">

<p>Capability setting failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>14</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container configuration file [[Man/ctid.conf.5|<b>ctid.conf</b>(5)]] not
found</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>15</p></td>
<td width="7%"></td>
<td width="78%">

<p>Timeout on <b>vzctl exec</b></p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>16</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error during <b>vzctl chkpnt</b></p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>17</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error during <b>vzctl restore</b></p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>18</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error from <b>setluid()</b> syscall</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>20</p></td>
<td width="7%"></td>
<td width="78%">

<p>Invalid command line parameter</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>21</p></td>
<td width="7%"></td>
<td width="78%">

<p>Invalid value for command line parameter</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>22</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container root directory (<b>VE_ROOT</b>) not set</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>23</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container private directory (<b>VE_PRIVATE</b>) not
set</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>24</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container template directory (<b>TEMPLATE</b>) not
set</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>28</p></td>
<td width="7%"></td>
<td width="78%">

<p>Not all required UBC parameters are set, unable to start
container</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>29</p></td>
<td width="7%"></td>
<td width="78%">

<p>OS template is not specified, unable to create
container</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>31</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container not running</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>32</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container already running</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>33</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to stop container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>34</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to add IP address to container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>40</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container not mounted</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>41</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container already mounted</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>43</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container private area not found</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>44</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container private area already exists</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>46</p></td>
<td width="7%"></td>
<td width="78%">

<p>Not enough disk space</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>47</p></td>
<td width="7%"></td>
<td width="78%">

<p>Bad/broken container (<b>/sbin/init</b> or
<b>/bin/sh</b> not found)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>48</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to create a new container private area</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>49</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to create a new container root area</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>50</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to mount container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>51</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to unmount container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>52</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to delete a container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>53</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container private area not exist</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>60</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>vzquota on</b> failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>61</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>vzquota init</b> failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>62</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>vzquota setlimit</b> failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>63</p></td>
<td width="7%"></td>
<td width="78%">

<p>Parameter <b>DISKSPACE</b> not set</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>64</p></td>
<td width="7%"></td>
<td width="78%">

<p>Parameter <b>DISKINODES</b> not set</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>66</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>vzquota off</b> failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>67</p></td>
<td width="7%"></td>
<td width="78%">

<p>ugid quota not initialized</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>71</p></td>
<td width="7%"></td>
<td width="78%">

<p>Incorrect IP address format</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>74</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error changing password</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>78</p></td>
<td width="7%"></td>
<td width="78%">

<p>IP address already in use</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>79</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container action script returned an error</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>82</p></td>
<td width="7%"></td>
<td width="78%">

<p>Config file copying error</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>86</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error setting devices (<b>--devices</b> or
<b>--devnodes</b>)</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>89</p></td>
<td width="7%"></td>
<td width="78%">

<p>IP address not available</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>91</p></td>
<td width="7%"></td>
<td width="78%">

<p>OS template not found</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>100</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to find container IP address</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>104</p></td>
<td width="7%"></td>
<td width="78%">

<p><b>VE_NETDEV</b> ioctl error</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>105</p></td>
<td width="7%"></td>
<td width="78%">

<p>Container start disabled</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>106</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to set iptables on a running container</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>107</p></td>
<td width="7%"></td>
<td width="78%">

<p>Distribution-specific configuration file not found</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>109</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to apply a config</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>129</p></td>
<td width="7%"></td>
<td width="78%">

<p>Unable to set meminfo parameter</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>130</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error setting veth interface</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>131</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error setting container name</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>133</p></td>
<td width="7%"></td>
<td width="78%">

<p>Waiting for container start failed</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>139</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error saving container configuration file</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">

<p>148</p></td>
<td width="7%"></td>
<td width="78%">

<p>Error setting container IO parameters (ioprio)</p></td></tr>
</table>

== EXAMPLES ==

<p style="margin-left:11%; margin-top: 1em">To create and
start &quot;basic&quot; container with ID of 1000 using
<i>fedora-core-5</i> OS template and IP address of
192.168.10.200: <br>
vzctl create 1000 --ostemplate fedora-core-5 --config basic
<br>
vzctl set 1000 --ipadd 192.168.10.200 --save <br>
vzctl start 1000</p>

<p style="margin-left:11%; margin-top: 1em">To set number
of processes barrier/limit to 80/100, and PTY barrier/limit
to 16/20 PTYs: <br>
vzctl set 1000 --numproc 80:100 -t 16:20 --save</p>

<p style="margin-left:11%; margin-top: 1em">To execute
command <b>ls -la</b> in this container: <br>
vzctl exec 1000 /bin/ls -la</p>

<p style="margin-left:11%; margin-top: 1em">To execute
command pipe <b>ls -l / | sort</b> in this container: <br>
vzctl exec 1000 &rsquo;ls -l / | sort&rsquo;</p>

<p style="margin-left:11%; margin-top: 1em">To enter this
container and execute command <b>apt-get install vim</b>:
<br>
vzctl enter 1000 --exec apt-get install vim</p>

<p style="margin-left:11%; margin-top: 1em">Note that in
the above example you will need to log out from the
container&rsquo;s shell after apt-get finishes.</p>

<p style="margin-left:11%; margin-top: 1em">To enter this
container, execute command <b>apt-get install vim</b> and
logout after successful installation (or stay inside the
container if installation process failed) use
<b>&amp;&amp;</b>: <br>
vzctl enter 1000 --exec &quot;apt-get install vim &amp;&amp;
logout&quot;</p>

<p style="margin-left:11%; margin-top: 1em">To enter this
container, execute command <b>apt-get install vim</b> and
logout independently of exit code of installation process
use <b>;</b>: <br>
vzctl enter 1000 --exec &quot;apt-get install vim ;
logout&quot;</p>

<p style="margin-left:11%; margin-top: 1em">Note that you
need to quote the command if you use <b>&amp;&amp;</b> or
<b>;</b>.</p>

<p style="margin-left:11%; margin-top: 1em">To stop this
container: <br>
vzctl stop 1000</p>

<p style="margin-left:11%; margin-top: 1em">To permanently
remove this container: <br>
vzctl destroy 1000</p>

== FILES ==

<p style="margin-left:11%; margin-top: 1em">/etc/vz/vz.conf
<br>
/etc/vz/conf/<i>CTID</i>.conf <br>
/etc/vz/conf/vps.{premount,mount,umount,postumount} <br>

/etc/vz/conf/<i>CTID</i>.{premount,mount,start,stop,umount,postumount}
<br>
/proc/vz/veinfo <br>
/proc/vz/vzquota <br>
/proc/user_beancounters <br>
/proc/bc/* <br>
/proc/fairsched</p>

== SEE ALSO ==

<p style="margin-left:11%; margin-top: 1em">[[Man/vz.conf.5|<b>vz.conf</b>(5)]],
[[Man/ctid.conf.5|<b>ctid.conf</b>(5)]], [[Man/arpsend.8|<b>arpsend</b>(8)]], [[Man/vzcalc.8|<b>vzcalc</b>(8)]],
[[Man/vzcfgvalidate.8|<b>vzcfgvalidate</b>(8)]], [[Man/vzcpucheck.8|<b>vzcpucheck</b>(8)]],
[[Man/vzifup-post.8|<b>vzifup-post</b>(8)]], [[Man/vzlist.8|<b>vzlist</b>(8)]],
[[Man/vzmemcheck.8|<b>vzmemcheck</b>(8)]], [[Man/vzmigrate.8|<b>vzmigrate</b>(8)]], [[Man/vzpid.8|<b>vzpid</b>(8)]],
[[Man/vzquota.8|<b>vzquota</b>(8)]], [[Man/vzsplit.8|<b>vzsplit</b>(8)]],
<b>[[UBC]]</b>.</p>

== LICENSE ==

<p style="margin-left:11%; margin-top: 1em">Copyright (C)
2000-2011, Parallels, Inc. Licensed under GNU GPL.</p>