Difference between revisions of "Man/vzlist.8"

From OpenVZ Virtuozzo Containers Wiki
< Man
Jump to: navigation, search
(Automated import of articles *** existing text overwritten ***)
(Automated import of articles *** existing text overwritten ***)
 
(6 intermediate revisions by 3 users not shown)
Line 17: Line 17:
  
 
<p style="margin-top: 1em">[<b>-a</b> | <b>-S</b>]
 
<p style="margin-top: 1em">[<b>-a</b> | <b>-S</b>]
[<b>-n</b>] [<b>-H</b>]
+
[<b>-n</b>] [<b>-H</b>] [<b>-t</b>] [<b>-j</b>]
 
[<b>-o&nbsp;</b><i>name</i>[,<i>name</i>...] | <b>-1</b>]
 
[<b>-o&nbsp;</b><i>name</i>[,<i>name</i>...] | <b>-1</b>]
 
[<b>-s&nbsp;</b>[<b>-</b>]<i>name</i>]
 
[<b>-s&nbsp;</b>[<b>-</b>]<i>name</i>]
Line 52: Line 52:
 
displayed.</p>
 
displayed.</p>
  
<p style="margin-left:11%; margin-top: 1em">For the fields
+
<p style="margin-left:11%; margin-top: 1em">For some fields
that can have many values (e.g. <b>ip</b>), all the values
+
that can have long values (e.g. <b>ip</b>, <b>hostname</b>,
are displayed only for the last (i.e. leftmost) column;
+
<b>description</b> or <b>features</b>), the value string is
otherwise, only the first value is shown.</p>
+
trimmed to some predefined width (in order not to break the
 +
columned layout), unless this field is the last one. So, in
 +
order to get the full non-trimmed value for such a field,
 +
put the field name last in the list of fields for <b>-o</b>
 +
option. If using <b>vzlist</b> from a script, add <b>-t</b>
 +
to disable trimming.</p>
  
 
== OPTIONS ==
 
== OPTIONS ==
Line 79: Line 84:
  
 
<p style="margin-left:22%;">Suppress displaying the header
 
<p style="margin-left:22%;">Suppress displaying the header
row.</p>
+
row. Usable for scripts.</p>
 +
 
 +
<p style="margin-left:11%;"><b>-t</b>, <b>--no-trim</b></p>
 +
 
 +
<p style="margin-left:22%;">Suppress trimming long fields.
 +
Usable for scripts.</p>
 +
 
 +
<p style="margin-left:11%;"><b>-j</b>, <b>--json</b></p>
 +
 
 +
<p style="margin-left:22%;">Output in JSON format. By
 +
default, all possible fields are printed.</p>
  
 
<p style="margin-left:11%;"><b>-o</b>, <b>--output</b>
 
<p style="margin-left:11%;"><b>-o</b>, <b>--output</b>
Line 85: Line 100:
  
 
<p style="margin-left:22%;">Display only the specified
 
<p style="margin-left:22%;">Display only the specified
<i>field</i>s (see <b>Standard fields</b> subsection
+
<i>field</i>s (see <b>Possible fields</b> subsection
 
below).</p>
 
below).</p>
  
Line 144: Line 159:
  
 
<p style="margin-left:22%;">list all available format
 
<p style="margin-left:22%;">list all available format
specifiers that can be used for both output both output
+
specifiers that can be used for both output (<b>-o</b>,
(<b>-o</b>, <b>--output</b>) and the sorting order
+
<b>--output</b>) and the sorting order (<b>-s</b>,
(<b>-s</b>, <b>--sort</b>).</p>
+
<b>--sort</b>).</p>
  
<p style="margin-left:22%; margin-top: 1em">For the user
+
<p style="margin-left:11%; margin-top: 1em">For the user
 
beancounter fields, if suffix is not specified, current
 
beancounter fields, if suffix is not specified, current
 
usage (a.k.a. &quot;held&quot;) value is show. One can also
 
usage (a.k.a. &quot;held&quot;) value is show. One can also
Line 156: Line 171:
 
       cellspacing="0" cellpadding="0">
 
       cellspacing="0" cellpadding="0">
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p><b>.m</b></p></td>
 
<p><b>.m</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="19%">
+
<td width="18%">
  
 
<p>maxheld</p></td>
 
<p>maxheld</p></td>
<td width="49%">
+
<td width="60%">
 
</td></tr>
 
</td></tr>
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p><b>.b</b></p></td>
 
<p><b>.b</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="19%">
+
<td width="18%">
  
 
<p>barrier</p></td>
 
<p>barrier</p></td>
<td width="49%">
+
<td width="60%">
 
</td></tr>
 
</td></tr>
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p><b>.l</b></p></td>
 
<p><b>.l</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="19%">
+
<td width="18%">
  
 
<p>limit</p></td>
 
<p>limit</p></td>
<td width="49%">
+
<td width="60%">
 
</td></tr>
 
</td></tr>
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p><b>.f</b></p></td>
 
<p><b>.f</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="19%">
+
<td width="18%">
  
 
<p>fail counter</p></td>
 
<p>fail counter</p></td>
<td width="49%">
+
<td width="60%">
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
  
<p style="margin-left:22%; margin-top: 1em">For the disk
+
<p style="margin-left:11%; margin-top: 1em">For the disk
 
quota fields, if suffix is not specified, current usage is
 
quota fields, if suffix is not specified, current usage is
 
shown. One can also use the following suffixes:</p>
 
shown. One can also use the following suffixes:</p>
Line 208: Line 223:
 
       cellspacing="0" cellpadding="0">
 
       cellspacing="0" cellpadding="0">
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p style="margin-top: 1em"><b>.s</b></p></td>
 
<p style="margin-top: 1em"><b>.s</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="16%">
+
<td width="15%">
  
 
<p style="margin-top: 1em">soft limit</p></td>
 
<p style="margin-top: 1em">soft limit</p></td>
<td width="52%">
+
<td width="63%">
 
</td></tr>
 
</td></tr>
 
<tr valign="top" align="left">
 
<tr valign="top" align="left">
<td width="22%"></td>
+
<td width="11%"></td>
 
<td width="3%">
 
<td width="3%">
  
 
<p><b>.h</b></p></td>
 
<p><b>.h</b></p></td>
<td width="7%"></td>
+
<td width="8%"></td>
<td width="16%">
+
<td width="15%">
  
 
<p>hard limit</p></td>
 
<p>hard limit</p></td>
<td width="52%">
+
<td width="63%">
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
 +
 +
<p style="margin-left:11%; margin-top: 1em">Note that for
 +
JSON output suffixes are not allowed.</p>
  
 
== EXAMPLES ==
 
== EXAMPLES ==
Line 240: Line 258:
 
kmemsize usage.</p>
 
kmemsize usage.</p>
  
== DIAGNOSTICS ==
+
== EXIT STATUS ==
  
 
<p style="margin-left:11%; margin-top: 1em">Returns 0 upon
 
<p style="margin-left:11%; margin-top: 1em">Returns 0 upon

Latest revision as of 01:42, 30 October 2013

NAME[edit]

vzlist − show various information about containers

SYNOPSIS[edit]

vzlist

[-a | -S] [-n] [-H] [-t] [-j] [-o name[,name...] | -1] [-s [-]name] [-h pattern] [-N pattern] [-d pattern] [CTID [CTID ...]]

vzlist

-L | --list

vzlist

--help

DESCRIPTION[edit]

This utility is used for listing containers and their parameters. By default only running containers are listed. If one or more CTIDs are specified, only specified containers are displayed.

For some fields that can have long values (e.g. ip, hostname, description or features), the value string is trimmed to some predefined width (in order not to break the columned layout), unless this field is the last one. So, in order to get the full non-trimmed value for such a field, put the field name last in the list of fields for -o option. If using vzlist from a script, add -t to disable trimming.

OPTIONS[edit]

-a, --all

List all containers.

-S, --stopped

List only not running containers (including the ones with status shown as mounted or suspended).

-n, --name

Display container names instead of hostnames.

-H, --no-header

Suppress displaying the header row. Usable for scripts.

-t, --no-trim

Suppress trimming long fields. Usable for scripts.

-j, --json

Output in JSON format. By default, all possible fields are printed.

-o, --output field[,field...]

Display only the specified fields (see Possible fields subsection below).

-1

Synonym for -H -octid, i.e. only show container IDs, one per line.

-s, --sort [-]field

Sort by the value of field (possible arguments are the same as for -o). The - before the field name means sorting in the reverse order.

Output filters[edit]

List of CTs can be further filtered using the following options. For patterns one can use the same wildcards as in shell (i.e. *, ?, and []). Note: to avoid expansion of wildcards by the shell, one have to escape the pattern by either putting it into single quotes (like ’a*a’) or by adding a backslash before the wildcard character (like a\*a).

-h, --hostname pattern

List only containers whose hostnames matches the pattern.

-N, --name_filter pattern

List only containers whose names matches the pattern.

-d, --description pattern

List only containers with descriptions matching the pattern.

Possible fields[edit]

-L, --list

list all available format specifiers that can be used for both output (-o, --output) and the sorting order (-s, --sort).

For the user beancounter fields, if suffix is not specified, current usage (a.k.a. "held") value is show. One can also use the following suffixes:

.m

maxheld

.b

barrier

.l

limit

.f

fail counter

For the disk quota fields, if suffix is not specified, current usage is shown. One can also use the following suffixes:

.s

soft limit

.h

hard limit

Note that for JSON output suffixes are not allowed.

EXAMPLES[edit]

vzlist -o ctid,kmemsize,kmemsize.l -s kmemsize

Show CTIDs, kmemsize usage, and kmemsize limit for all running containers, sorted by the kmemsize usage.

EXIT STATUS[edit]

Returns 0 upon success.

COPYRIGHT[edit]

Copyright (C) 2000-2011, Parallels, Inc. Licensed under GNU GPL.