Changes

Jump to: navigation, search

Man/vzctl.8

9,620 bytes added, 18:21, 23 April 2015
Automated import of articles *** existing text overwritten ***
<p>[<i>flags</i>] <b>start</b> <i>CTID</i> [<b>--wait</b>]
[<b>--force</b>] [<b>--skip-fsck</b>][<b>--skip-remount</b>]</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<p>[<i>flags</i>] <b>restart</b> <i>CTID</i>
[<b>--wait</b>] [<b>--force</b>] [<b>--fast</b>][<b>--skip-fsck</b>] [<b>--skip-remount</b>]</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="80%">
<p>[<i>flags</i>] <b>snapshot-switch</b> <i>CTID</i>[<b>--skip-resume</b> |<b>--must-resume</b>][<b>--skip-config</b>] <b>--id</b> <i>uuid</i></p></td></tr><tr valign="top" align="left"><td width="11%"></td><td width="7%"> <p><b>vzctl</b></p></td><td width="2%"></td><td width="80%"> <p>[<i>flags</i>] <b>snapshot-delete</b> <i>CTID</i> <b>--id</b><i>uuid</i></p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
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. A numeric ID shouldnot be more than <b>2147483644</b>.</p>
== OPTIONS ==
[<b>--name&nbsp;</b><i>name</i>]
[<b>--description&nbsp;</b><i>string</i>]
[<b>--ostemplate&nbsp;</b><i>string</i>]
[<b>--stop-timeout&nbsp;</b><i>seconds</i>]
[<b>--ipadd&nbsp;</b><i>addr</i>]
[<b>--ipdel&nbsp;</b><i>addr</i>|<b>all</b>]
[<b>--ram&nbsp;</b><i>bytes</i>]
[<b>--swap&nbsp;</b><i>bytes</i>]
[<b>--vm_overcommit&nbsp;</b><i>float</i>]
[<b>--cpuunits&nbsp;</b><i>num</i>]
[<b>--cpulimit&nbsp;</b><i>num</i>]
[<b>--cpus&nbsp;</b><i>num</i>]
[<b>--cpumask&nbsp;</b><i>cpus</i>|<b>auto</b>|<b>all</b>][<b>--nodemask&nbsp;</b><i>nodes</i>|<b>all</b>]
[<b>--meminfo&nbsp;none</b>|<i>mode</i>:<i>value</i>]
[<b>--iptables&nbsp;</b><i>name</i>[<b>,</b>...]]
[<b>--netfilter&nbsp;disabled</b>|<b>stateless</b>|<b>stateful</b>|<b>full</b>]
[<b>--netdev_add&nbsp;</b><i>ifname</i>]
[<b>--netdev_del&nbsp;</b><i>ifname</i>]
[<b>--applyconfig&nbsp;</b><i>name</i>]
[<b>--applyconfig_map&nbsp;</b><i>group</i>]
[<b>--ioprio&nbsp;</b><i>num</i>][<b>--iolimit&nbsp;</b><i>mbps</i>][<b>--iopslimit&nbsp;</b><i>iops</i>] [<b>--save</b>]
[<b>--force</b>] [<b>--reset_ub</b>]
[<b>--setmode&nbsp;restart</b>|<b>ignore</b>]</p> </td></tr>
<p style="margin-left:17%;">Add a textual description for a
container.</p>
 
<p style="margin-left:11%;"><b>--ostemplate</b>
<i>string</i></p>
 
<p style="margin-left:17%;">Sets a new value of
<b>OSTEMPLATE</b> parameter in container configuration file
[[Man/ctid.conf.5|<b>ctid.conf</b>(5)]]. Requires <b>--save</b> flag. Useful
after a change/upgrade of a distribution running inside
container, as vzctl uses the value of OSTEMPLATE to run
distribution-specific scripts.</p>
 
<p style="margin-left:11%;"><b>--stop-timeout</b>
<i>seconds</i></p>
 
<p style="margin-left:17%;">Sets a time to wait for
container to stop on <b>vzctl stop</b> before forcibly
killing it, in seconds. Note this option can not be used
without <b>--save</b> flag.</p>
 
<p style="margin-left:17%; margin-top: 1em">Special value
of <b>0</b> means to use compiled-in default.</p>
==== Networking ====
server values set in previous calls to <b>vzctl</b> are
overwritten.</p>
 
<p style="margin-left:17%; margin-top: 1em">A special value
of <b>inherit</b> can be used to auto-propagate nameserver
value(s) from the host system&rsquo;s
<b>/etc/resolv.conf</b> file.</p>
<p style="margin-left:11%;"><b>--searchdomain</b>
search domain values set in previous calls to <b>vzctl</b>
are overwritten.</p>
 
<p style="margin-left:17%; margin-top: 1em">A special value
of <b>inherit</b> can be used to auto-propagate search
domain value(s) from the host system&rsquo;s
<b>/etc/resolv.conf</b> file.</p>
<p style="margin-left:11%;"><b>--netif_add</b>
<b>--swappages</b> limit (the barrier is set to 0).</p>
<p style="margin-left:11%;"><b>--vm_overcommit</b><i>float</i></p> <p style="margin-left:22%;">Set VM overcommitment value to<i>float</i>. If set, it is used to calculate<b>privmmpages</b> parameter in case it is not setexplicitly (see below). Default value is <b>0</b>, meaningunlimited privvmpages.</p> <p style="margin-left:11%; margin-top: 1em">Note that<b>vzctl</b> checks if running kernel is VSwap capable, andrefuses to use these parameters otherwise. This behavior canbebe overriden by using <b>--force</b> flag before
parameters.</p>
 
<p style="margin-left:11%; margin-top: 1em">In VSwap mode,
all beancounters other than RAM and swap become optional.
Note though that if some optional beancounters are not set,
they are calculated and set by vzctl implicitly, using the
following formulae:</p>
 
<p style="margin-left:11%; margin-top: 1em"><b>&bull;
lockedpages.barrier = oomguarpages.barrier = ram</b></p>
 
<p style="margin-left:11%; margin-top: 1em"><b>&bull;
lockedpages.limit = oomguarpages.limit = unlimited</b></p>
 
<p style="margin-left:11%; margin-top: 1em"><b>&bull;
vmguarpages.barrier = vmguarpages.limit = ram + swap</b></p>
 
<p style="margin-left:11%; margin-top: 1em"><b>&bull;
privvmpages.barrier = privvmpages.limit = (ram + swap) *
vm_overcommit</b></p>
 
<p style="margin-left:11%; margin-top: 1em">(if
<b>vm_overcommit</b> is <b>0</b> or not set,
<b>privvmpages</b> is set to &quot;unlimited&quot;)</p>
<p style="margin-left:11%; margin-top: 1em">Here is an
<p style="margin-left:11%;"><b>--cpumask</b> <i>cpus</i> |
<b>auto</b> | <b>all</b></p>
<p style="margin-left:22%;">sets Sets list of allowed CPUs for
the container. Input format is a comma-separated list of
decimal numbers and /or ranges. Consecutively set bits are shownas two hyphen-separated decimal numbers, the smallest andlargest bit numbers set in the range. For example, if youwant the container to execute on CPUs 0, 1, 2, 7, you shouldpass <b>0-2,7</b>. Default value is <b>all</b> (thecontainer can execute on any CPU). If used with the<b>--nodemask</b> option, value of <b>auto</b> assigns allCPUs from the specified NUMA node to a container.</p> <p style="margin-left:11%;"><b>--nodemask</b> <i>nodes</i>| <b>all</b></p> <p style="margin-left:22%;">Sets list of allowed NUMA nodesfor the container. Input format is the same as for<b>--cpumask</b>. Note that <b>--nodemask</b> must be usedwith the <b>--cpumask</b> option.</p>
==== Memory output parameters ====
<b>privvmpages:1</b>.</p>
==== Netfilter (iptables ) control parameters ==== <p style="margin-left:11%;"><b>--netfilter&nbsp;disabled</b>|<b>stateless</b>|<b>stateful</b>|<b>full</b></p> <p style="margin-left:22%;">Restrict access tonetfilter/iptables modules for a container. This optionreplaces obsoleted <b>--iptables</b>.</p> <p style="margin-left:22%; margin-top: 1em">Note thatchanging this parameter requires container restart, soconsider using <b>--setmode</b> option.</p> <p style="margin-left:22%; margin-top: 1em">The followingarguments can be used: <b><br>&bull; disabled</b></p> <p style="margin-left:32%;">no modules are allowed</p> <p style="margin-left:22%;"><b>&bull; stateless</b></p> <p style="margin-left:32%;">all modules except NAT andconntracks are allowed (i.e. filter and mangle); this is thedefault</p> <p style="margin-left:22%;"><b>&bull; stateful</b></p> <p style="margin-left:32%;">all modules except NAT areallowed</p> <table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td width="22%"></td><td width="9%"> <p><b>&bull; full</b></p></td><td width="1%"></td><td width="36%"> <p>all modules are allowed</p></td><td width="32%"></td></tr></table>
<p style="margin-left:11%;"><b>--iptables</b>
<i>name</i>[<b>,</b>...]</p>
<p style="margin-left:22%;"><b>Note</b> this option isobsoleted, <b>--netfilter</b> should be used instead.</p> <p style="margin-left:22%; margin-top: 1em">Allow to use the functionalityof <i>name</i> iptables module inside the container.Multiple comma-separated <i>name</i>s can be specified.</p>
<p style="margin-left:22%; margin-top: 1em">The default
ploop image file to the new size. Since there is no
soft/hard limit concept in ploop, second <i>num</i>, if
specified, is ignored. </p> <p style="margin-left:22%; margin-top: 1em">By default,ploop resize is done online, i.e. on a mounted ploop. Thisis a preferred way of doing resize. Although, in a rare casea container was using lots of disk space and should now beresized to a much smaller size, an offline resize might bemore appropriate. In this case, make sure the container isstopped and unmounted and use additional<b>--offline-resize</b> option</p> <p style="margin-left:22%; margin-top: 1em">Note that such ploopresize is NOTperformed on container start, so for consistency<b>--diskspace</b> must be used together with <b>--save</b>flag.</p>
<p style="margin-left:22%; margin-top: 1em">Suffixes
configuration file.</p>
==== I/O priority management scheduling ====
<p style="margin-left:11%;"><b>--ioprio</b>
<i>priority</i></p>
<p style="margin-left:22%;">Assigns disk 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>
 
<p style="margin-left:11%;"><b>--iolimit</b>
<i>limit</i>[<b>B</b>|<b>K</b>|<b>M</b>|<b>G</b>]</p>
 
<p style="margin-left:22%;">Assigns disk I/O bandwidth
limit for a container. Value is either a number with an
optional suffix, or a literal string <b>unlimited</b>. Value
of <b>0</b> means &quot;unlimited&quot;. By default a
container has no I/O limit. Maximum allowed limit is 2
gigabytes per second; values exceeding the limit are
truncated.</p>
 
<p style="margin-left:22%; margin-top: 1em">If no suffix is
provided, the <i>limit</i> is assumed to be in megabytes per
second. Available suffixes are: <br>
&bull; <b>b</b>, <b>B</b> -- bytes per second; <br>
&bull; <b>k</b>, <b>K</b> -- kilobytes per second; <br>
&bull; <b>m</b>, <b>M</b> -- megabytes per second (default);
<br>
&bull; <b>g</b>, <b>G</b> -- gigabytes per second;</p>
 
<p style="margin-left:11%;"><b>--iopslimit</b>
<i>iops</i></p>
 
<p style="margin-left:22%;">Assigns IOPS limit for a
container, in number of input/output operations per second.
Value is a number or a literal string <b>unlimited</b>.
Value of <b>0</b> means &quot;unlimited&quot;. By default a
container has no IOPS limit.</p>
=== Suspending and resuming ===
<p style="margin-left:11%;"><b>snapshot-switch</b>
<i>CTID</i> [<b>--skip-resume</b> | <b>--must-resume</b>][<b>--skip-config</b>] <b><br>--id</b> <i>uuid</i></p>
<p style="margin-left:17%;">Switches the container to a
snapshot identified by <i>uuid</i>, restoring its filesystem state, configuration (if available) and its runningstate (if available). </p> <p style="margin-left:17%; margin-top: 1em"><b>Note that the currentstate of a container (including its file systemcontainer state and its configuration file system state ) is lost! </b></p> <p style="margin-left:17%; margin-top: 1em">Option<b>--skip-resume</b> is used to ignore a CT memory dump filein a snapshot, as a result the container will end up beingin a stopped state (same as if a snapshot has been takenwith <b>--skip-suspend</b>).</p> <p style="margin-left:17%; margin-top: 1em">If givenoptionsnapshot contains CT <b>--must-resume</b> is set, absense of a memory dumpistreated as an error, it and the inability to restore from thememory dump is restoredtreated as an error rather than warning.</p> <p style="margin-left:17%; margin-top: 1em">Option option<b>--skip-config</b> is used to ignore the CT configurationfile in a snapshot, otherwisei.e. the current configuration file willcontainer be left as is stopped.</p>
<p style="margin-left:11%;"><b>snapshot-delete</b>
[<b>--layout&nbsp;simfs</b>|<b>ploop</b>[<b>:</b>{<b>expanded</b>|<b>plain</b>|<b>raw</b>}]]
[<b>--diskspace&nbsp;</b><i>kbytes</i>]
[<b>--diskinodes&nbsp;</b><i>num</i>]
[<b>--private&nbsp;</b><i>path</i>]
[<b>--root&nbsp;</b><i>path</i>]
[<b>--ipadd&nbsp;</b><i>addr</i>]
[<b>--hostname&nbsp;</b><i>name</i>]
[<b>--name&nbsp;</b><i>name</i>][<b>--local_uid&nbsp;</b><i>uid</i>][<b>--local_gid&nbsp;</b><i>gid</i>]</p> </td></tr>
</table>
<p style="margin-left:17%; margin-top: 1em">You can use
<b>--diskspace</b> option and <b>--diskinodes</b> options to specify container file systemsize. Note that forsize<b>ploop</b> layout, you will not be able to change inodesvalue later. </p> <p style="margin-left:17%; margin-top: 1em">If <b>DISKSPACE </b> is not specified either in the sampleconfiguration file used for creation or in global configuration file[[Man/vz.conf.5|<b>vz.conf</b>(5)]], this <b>--diskspace</b>parameter is required for<b>ploop</b> layout.</p>
<p style="margin-left:17%; margin-top: 1em">Suffixes
<b>--hostname</b> <i>name</i> option to set a host name for
a container.</p>
 
<p style="margin-left:17%; margin-top: 1em">When running
with an upstream Linux Kernel that supports user namespaces
(&gt;= 3.8), the parameters <b>--local_uid</b> and
<b>--local_gid</b> can be used to select which <i>uid</i>
and <i>gid</i> respectively will be used as a base user in
the host system. Note that user namespaces provide a 1:1
mapping between container users and host users. If these
options are not specified, the values <b>LOCAL_UID</b> and
<b>LOCAL_GID</b> from global configuration file
[[Man/vz.conf.5|<b>vz.conf</b>(5)]] are used. An explicit <b>--local_uid</b>
value of 0 will disable user namespace support, and run the
container as a privileged user. In this case,
<b>--local_gid</b> is ignored.</p>
 
<p style="margin-left:17%; margin-top: 1em"><b>Warning:</b>
use <b>--local_uid</b> and <b>--local_gid</b> with care,
specially when migrating containers. In all situations, the
container&rsquo;s files in the filesystem needs to be
correctly owned by the host-side users.</p>
<p style="margin-left:11%;"><b>destroy</b> | <b>delete</b>
<p style="margin-left:11%;"><b>start</b> <i>CTID</i>
[<b>--wait</b>] [<b>--force</b>] [<b>--skip-fsck</b>][<b>--skip-remount</b>]</p>
<p style="margin-left:17%;">Mounts (if necessary) and
<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">Specify
<b>--skip-fsck</b> to skip fsck for ploop-based container
filesystem (this option is used by vz initscript).</p>
 
<p style="margin-left:17%; margin-top: 1em">By default, if
a container to be started happens to be already mounted, it
is unmounted and mounted again. This behavior can be turned
off by using <b>--skip-remount</b> flag.</p>
<p style="margin-left:17%; margin-top: 1em">Note that this
syscall instead which is faster but can lead to unclean
container shutdown.</p>
 
<p style="margin-left:17%; margin-top: 1em">Note that
<b>vzctl stop</b> is not asyncronous, in other words vzctl
waits for container&rsquo;s init to exit (unless
<b>--fast</b> is given), which can take up to a few minutes.
Default wait timeout is 120 seconds; it can be changed
globally, by setting <b>STOP_TIMEOUT</b> in
[[Man/vz.conf.5|<b>vz.conf</b>(5)]], or per container (<b>STOP_TIMEOUT</b> in
[[Man/ctid.conf.5|<b>ctid.conf</b>(5)]], see <b>--stop-timeout</b>).</p>
<p style="margin-left:17%; margin-top: 1em">Note that this
<p style="margin-left:11%;"><b>restart</b> <i>CTID</i>
[<b>--wait</b>] [<b>--force</b>] [<b>--fast</b>][<b>--skip-fsck</b>]</p>
<p style="margin-left:17%;">Restarts a container, i.e.
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><b>.</b> numeric prefix and areexecuted for the given container only.</p>
<p style="margin-left:11%; margin-top: 1em">Please note
<pre style="margin-left:11%; margin-top: 1em"> # If one of these files does not exist then something
# is really broken
[ -f /etc/sysconfigvz/vz .conf ] || exit 1
[ -f $VE_CONFFILE ] || exit 1
# Source both files. Note the order is important.
<td width="78%">
<p>Parameter <b>DISKSPACE</b> not set (or set too high)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
2,253
edits

Navigation menu