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 ***)
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>-t</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 90: Line 90:
 
<p style="margin-left:22%;">Suppress trimming long fields.
 
<p style="margin-left:22%;">Suppress trimming long fields.
 
Usable for scripts.</p>
 
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 240: Line 245:
 
</td></tr>
 
</td></tr>
 
</table>
 
</table>
 +
 +
<p style="margin-left:11%;">Note that for JSON output
 +
suffixes are not allowed.</p>
  
 
== EXAMPLES ==
 
== EXAMPLES ==

Revision as of 16:03, 25 September 2012

NAME

vzlist − show various information about containers

SYNOPSIS

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

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

-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 Standard 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

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

-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

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

Returns 0 upon success.

COPYRIGHT

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