Ver lista de máquinas virtuales en OpenVZ con vzlist

En OpenVZ tenemos un comando muy útil para poder ver toda la información de un servidor virtual en tiempo real, si se sabe utilizar correctamente, podemos ver la mayoría de propiedades cómo: ips, hostname, ctid, load average, etc.

Si ponemos vzlist en nuestra linea de comandos sin ningún parámetro nos salen los fundamentales, ctid, numero de procesos, estado, ip principal y hostname.

CTID      NPROC STATUS    IP_ADDR         HOSTNAME
105         47 running   XX.XXX.XXX.XXX    test
338         55 running   XXX.XXX.XXX.XX    prueba

Ahora para mostrar solo las columnas que nos interesan vamos a utilizar el parametro "-o", por ejemplo queremos mostrar en nuestra lista el ctid, el estado y el load average de cada máquina.

vzlist -o ctid,status,laverage

Nos dará como resultado:

CTID STATUS          LAVERAGE
105 running   0.00/0.00/0.00
338 running   0.00/0.00/0.00
585 running   0.04/0.04/0.01
10556 running   0.01/0.08/0.08
20710 running   0.00/0.00/0.00
380225 running   0.00/0.00/0.00

Aquí teneis una lista de todas las posibles columnas que podeis utilizar extraído de http://www.linuxcertif.com/man/8/vzlist/

Parameter

Possible Specifiers

Output Column

Description

ctid

none

CTID

The Container ID.

hostname

none

HOSTNAME

The Container hostname.

ip

none

IP_ADDR

The Container IP address.

status

none

STATUS

Specifies whether the Container is running or stopped.

tm

none

TM

Specifies the type of the OS template your Container is based on:

  • ST indicates that the Container is based on a standard OS template;
  • EZ indicates that the Container is based on an EZ OS template.

ostemplate

none

OSTEMPLATE

Specifies the name of the OS template your Container is based on ( e.g. redhat-el5-x86).

kmemsize

.m, .b,

.l, .f

KMEMSIZE

The size of unswappable kernel memory (in bytes), allocated for internal kernel structures of the processes of a particular Container. Typical amounts of kernel memory are 16…50 Kb per process.

lockedpages

.m, .b,

.l, .f

LOCKEDP

The amount of memory not allowed to be swapped out (locked with the mlock() system call), in 4-Kb pages.

privvmpages

.m, .b,

.l, .f

PRIVVMP

The size in 4 Kb pages of private (or potentially private) memory, allocated by Container applications. Memory that is always shared among different applications is not included in this resource parameter.

shmpages

.m, .b,

.l, .f

SHMP

The total size of shared memory (including IPC, shared anonymous mappings and tmpfs objects), allocated by processes of a particular Container, in 4 Kb pages.

numproc

.m, .b,

.l, .f

NPROC

The number of processes and threads allowed.

physpages

.m, .b,

.l, .f

PHYSP

The total size of RAM used by processes. This is accounting-only parameter currently. It shows the usage of RAM by the Container. For memory pages used by several different Containers (mappings of shared libraries, for example), only a fraction of a page is charged to each Container. The sum of the physpages usage for all Containers corresponds to the total number of pages used in the system by all accounted users.

vmguarpages

.m, .b,

.l, .f

VMGUARP

The memory allocation guarantee, in pages (one page is 4 Kb). Applications are guaranteed to be able to allocate memory while the amount of memory accounted as privvmpages does not exceed the configured barrier of the vmguarpages parameter. Above the barrier, memory allocation may fail in case of overall memory shortage.

oomguarpages

.m, .b,

.l, .f

OOMGUARP

The out-of-memory guarantee, in 4 Kb pages. Any Container process will not be killed even in case of heavy memory shortage if the current memory consumption (including both physical memory and swap) does not reach the oomguarpages barrier.

numtcpsock

.m, .b,

.l, .f

NTCPSOCK

The number of TCP sockets (PF_INET family, SOCK_STREAM type). This parameter limits the number of TCP connections and, thus, the number of clients the server application can handle in parallel.

numflock

.m, .b,

.l, .f

NFLOCK

The number of file locks created by all Container processes.

numpty

.m, .b,

.l, .f

NPTY

The number of pseudo-terminals. For example, ssh session, screen, xterm application consumes pseudo-terminal resource.

numsiginfo

.m, .b,

.l, .f

NSIGINFO

The number of siginfo structures (essentially this parameter limits size of signal delivery queue).

tcpsndbuf

.m, .b,

.l, .f

TCPSNDB

The total size (in bytes) of send buffers for TCP sockets – amount of kernel memory allocated for data sent from an application to a TCP socket, but not acknowledged by the remote side yet.

tcprcvbuf

.m, .b,

.l, .f

TCPRCVB

The total size (in bytes) of receive buffers for TCP sockets. Amount of kernel memory received from the remote side but not read by the local application yet.

othersockb

.m, .b,

.l, .f

OTHSOCKB

The total size in bytes of UNIX-domain socket buffers, UDP and other datagram protocol send buffers.

dgramrcvbuf

.m, .b,

.l, .f

DGRAMRCVB

The total size in bytes of receive buffers of UDP and other datagram protocols.

nothersock

.m, .b,

.l, .f

NOTHSOCK

The number of socket other than TCP. Local (UNIX-domain) sockets are used for communications inside the system. UDP sockets are used for Domain Name Service (DNS) queries, for example.

dcachesize

.m, .b,

.l, .f

DCACHESIZE

The total size in bytes of dentry and inode structures locked in memory. Exists as a separate parameter to impose a limit causing file operations to sense memory shortage and return an error to applications, protecting from excessive consumption of memory due to intensive file system operations.

numfile

.m, .b,

.l, .f

NFILE

The number of files opened by all Container processes.

numiptent

.m, .b,

.l, .f

NIPTENT

The number of IP packet filtering entries.

diskspace

.s, .h

DQBLOCKS

The total size of disk space consumed by the Container, in 1 Kb blocks. When the space used by a Container hits the barrier, the Container can allocate additional disk space up to the limit during grace period.

diskinodes

.s, .h

DQINODES

The total number of disk inodes (files, directories, symbolic links) a Container can allocate. When the number of inodes used by a Container hits the barrier, the Container can create additional file entries up to the limit during grace period.

laverage

none

LAVERAGE

The average number of processes ready to run during the last 1, 5 and 15 minutes.

cpulimit

none

CPULIM

This is a positive number indicating the CPU time in per cent the corresponding Container is not allowed to exceed.

cpuunits

none

CPUUNI

Allowed CPU power. This is a positive integer number, which determines the minimal guaranteed share of the CPU the Container will receive. You may estimate this share as ((Container CPUUNITS)/(Sum of CPU UNITS across all busy Containers))*100%. The total CPU power depends on CPU and Virtuozzo reporting tools consider one 1 GHz PIII Intel processor to be equivalent to 50,000 CPU units.

slmmode

none

SLMMOD

The SLM mode defining the behaviour of the SLM and UBC parameters in respect of the given Container. It can be one of the following:

  • ubc: the SLM mode is disabled, which means that the slmmemorylimit parameter is not supported and you can use only the UBC parameters to control the amount of memory which can be consumed by the Container.
  • slm: the SLM mode is enabled, which means that the slmmemorylimit parameter is supported and can be used to manage the amount of memory which can be consumed by the Container.
  • all: both the slmmemorylimit and UBC parameters are supported and can be used to manage the amount of memory which can be consumed by the Container.

slminst

none

SLMINST

The instant memory usage limit set for the Container, in 4 KB pages.

slmavg

none

SLMAVG

The average memory usage limit set for the Container, in 4 KB pages.

No hay comentarios

Agregar comentario