Parallels Virtuozzo Containers 4.7 For Linux Reference Guide Vz Ref

User Manual: parallels Virtuozzo Containers - 4.7 - Linux - Reference Guide Free User Guide for Parallels Virtuozzo Containers Software, Manual

Open the PDF directly: View PDF PDF.
Page Count: 176 [warning: Documents this large are best viewed by clicking the View PDF Link!]

Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
Parallels Virtuozzo
Containers 4.7 for Linux
Reference Guide
Parallels Holdings, Ltd.
c/o Parallels International GMbH.
Parallels International GmbH
Vordergasse 49
CH8200 Schaffhausen
Switzerland
Tel: + 41 526320 411
Fax: + 41 52672 2010
www.parallels.com
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
This product is protected by United States and international copyright laws. The product’s underlying technology,
patents, and trademarks are listed at http://www.parallels.com/trademarks.
Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-
DOS are registered trademarks of Microsoft
Corporation.
Apple, Mac, the Mac logo, Mac OS, iPad, iPhone, iPod touch, FaceTime HD camera and iSight are trademarks of Apple
Inc., registered in the US and other countries.
Linux is a registered trademark of Linus Torvalds.
All other marks and names mentioned herein may be trademarks of their respective owners.
Contents
Preface ....................................................................................................................... 7
About Parallels Virtuozzo Containers ................................................................................ 8
About This Guide ............................................................................................................ 9
Organization of This Guide .......................................................................................................9
Documentation Conventions ................................................................................................. 10
Getting Help .................................................................................................................. 11
Feedback ...................................................................................................................... 12
Configuring Parallels Virtuozzo Containers 4.7 ...................................................... 13
Matrix of Parallels Virtuozzo Containers Configuration Files ............................................. 14
Global Parallels Virtuozzo Containers Configuration File ......................................................... 16
Container Configuration File ................................................................................................... 23
Linux Distribution Configuration Files ..................................................................................... 31
Network Classes Definition File .............................................................................................. 33
vzup2date Configuration File ................................................................................................. 34
vzup2date-mirror Configuration File ....................................................................................... 35
vzvpn Configuration File ......................................................................................................... 38
vzreport Configuration File ..................................................................................................... 39
Kernel Parameters ................................................................................................................. 40
Offline Management Configuration Files ................................................................................. 41
vzlmond Configuration File ..................................................................................................... 42
vzstat Configuration File......................................................................................................... 44
vzrmond Configuration File .................................................................................................... 46
vzstatrep Configuration File ................................................................................................... 49
Backup Configuration File ...................................................................................................... 51
vzrhnproxy Configuration File ................................................................................................. 54
vzpkgproxy Configuration File ................................................................................................ 55
vztt Configuration File ............................................................................................................ 56
Managing Parallels Virtuozzo Containers Scripts ............................................................ 56
Overview ............................................................................................................................... 57
Parallels Virtuozzo Containers Action Scripts ......................................................................... 58
Contents
Parallels Virtuozzo Containers Command-Line Interface ...................................... 60
Matrix of Parallels Virtuozzo Containers Command Line Utilities ...................................... 61
vzctl .............................................................................................................................. 64
vzctl create ............................................................................................................................ 66
vzctl delete and vzctl destroy ................................................................................................. 67
vzctl mount and vzctl umount ................................................................................................ 67
vzctl start, vzctl stop, vzctl restart, and vzctl status................................................................ 68
vzctl set ................................................................................................................................. 70
vzctl unset ............................................................................................................................. 79
vzctl exec, vzctl exec2, and vzctl enter .................................................................................. 79
vzctl recover and vzctl reinstall .............................................................................................. 80
vzctl quotaon, vzctl quotaoff, and vzctl quotainit .................................................................... 81
vzctl suspend and vzctl resume ............................................................................................. 81
vzctl convert .......................................................................................................................... 82
vzctl runscript ........................................................................................................................ 82
vzlist ............................................................................................................................. 83
vzlist Output Parameters and Their Specifiers ........................................................................ 85
vzquota ......................................................................................................................... 89
vzquota init ............................................................................................................................ 90
vzquota drop ......................................................................................................................... 91
vzquota on and vzquota off ................................................................................................... 91
vzquota setlimit ..................................................................................................................... 92
vzquota setlimit2 ................................................................................................................... 92
vzquota stat and vzquota show ............................................................................................. 93
Licensing Utilities ........................................................................................................... 94
vzlicload ................................................................................................................................ 94
vzlicupdate ............................................................................................................................ 95
vzlicview ................................................................................................................................ 96
Migration Utilities ........................................................................................................... 97
vzmigrate ............................................................................................................................... 97
vzmlocal .............................................................................................................................. 100
vzp2v................................................................................................................................... 101
Backing-Up Utilities ..................................................................................................... 102
vzabackup ........................................................................................................................... 103
vzarestore............................................................................................................................ 106
Contents
EZ Template Management Utilities ............................................................................... 108
vzpkg install template .......................................................................................................... 109
vzpkg update template ........................................................................................................ 109
vzpkg remove template ....................................................................................................... 110
vzpkg list ............................................................................................................................. 111
vzpkg info ............................................................................................................................ 113
vzpkg status ........................................................................................................................ 116
vzpkg install ......................................................................................................................... 117
vzpkg update ...................................................................................................................... 119
vzpkg remove ...................................................................................................................... 120
vzpkg link ............................................................................................................................ 121
vzpkg create cache ............................................................................................................. 122
vzpkg update cache ............................................................................................................ 123
vzpkg remove cache ........................................................................................................... 124
vzpkg localinstall .................................................................................................................. 125
vzpkg localupdate ............................................................................................................... 126
vzpkg upgrade .................................................................................................................... 127
vzpkg fetch .......................................................................................................................... 128
vzpkg clean ......................................................................................................................... 129
vzpkg update metadata ....................................................................................................... 130
vzpkg upgrade area ............................................................................................................. 130
vzmktmpl ............................................................................................................................. 131
vzpkgproxy .......................................................................................................................... 135
vzrhnproxy ........................................................................................................................... 136
Supplementary Tools................................................................................................... 137
vzup2date ........................................................................................................................... 137
vzup2date-mirror ................................................................................................................. 145
vzfsutil ................................................................................................................................. 146
vzcache ............................................................................................................................... 148
vzps and vztop .................................................................................................................... 149
vzsetxinetd .......................................................................................................................... 150
vzdqcheck ........................................................................................................................... 151
vzdqdump and vzdqload ..................................................................................................... 152
vznetstat .............................................................................................................................. 153
vzcpucheck ......................................................................................................................... 153
Contents
vzmemcheck ....................................................................................................................... 154
vzcalc .................................................................................................................................. 154
vzcheckovr .......................................................................................................................... 154
pstat .................................................................................................................................... 155
vzpid ................................................................................................................................... 161
vzsplit .................................................................................................................................. 161
vzcfgscale ........................................................................................................................... 162
vzcfgvalidate ........................................................................................................................ 163
vzcfgconvert ........................................................................................................................ 163
vzstatrep ............................................................................................................................. 164
vzreport ............................................................................................................................... 165
vzhwcalc ............................................................................................................................. 166
vzveconvert ......................................................................................................................... 167
vznetcfg ............................................................................................................................... 169
vzmtemplate ........................................................................................................................ 170
Glossary ................................................................................................................. 171
Index ...................................................................................................................... 173
In This Chapter
About Parallels Virtuozzo Containers ....................................................................... 8
About This Guide ................................................................................................... 9
Getting Help ........................................................................................................... 11
Feedback ............................................................................................................... 12
CHAPTER 1
Preface
8
Preface
About Parallels Virtuozzo Containers
Parallels Virtuozzo Containers is a patented OS virtualization solution. It creates isolated partitions
or Containers on a single physical server and OS instance to utilize hardware, software, data center
and management effort with maximum efficiency. The basic Parallels Virtuozzo Containers
capabilities are:
Intelligent PartitioningDivision of a server into as many as hundreds of Containers with
full server functionality.
Complete IsolationContainers are secure and have full functional, fault and performance
isolation.
Dynamic Resource AllocationCPU, memory, network, disk and I/O can be changed
without rebooting.
Mass ManagementSuite of tools and templates for automated, multi-Container and multi-
server administration.
The diagram below represents a typical model of the Parallels Virtuozzo Containers system
structure:
9
Preface
The Parallels Virtuozzo Containers OS virtualization model is streamlined for the best performance,
management, and efficiency. At the base resides a standard Host operating system which can be
either Windows or Linux. Next is the virtualization layer with a proprietary file system and a kernel
service abstraction layer that ensure the isolation and security of resources between different
Containers. The virtualization layer makes each Container appear as a standalone server. Finally,
the Container itself houses the application or workload.
The Parallels Virtuozzo Containers OS virtualization solution has the highest efficiency and
manageability making it the best solution for organizations concerned with containing the IT
infrastructure and maximizing the resource utilization. The Parallels Virtuozzo Containers complete
set of management tools and unique architecture makes it the perfect solution for easily
maintaining, monitoring, and managing virtualized server resources for consolidation and business
continuity configurations.
About This Guide
This guide is a complete reference on all Parallels Virtuozzo Containers configuration files and
Hardware Node command-line utilities. It familiarizes you with the way to configure Parallels
Virtuozzo Containers to meet your requirements and to perform various tasks by using the
corresponding Parallels command line utilities.
The primary audience for this guide is anyone who is looking for an explanation of a particular
configuration option, does not understand a Parallels file format, needs help for a particular
command, or is seeking for a command to perform a certain task.
Organization of This Guide
Chapter 2, Configuring Parallels Virtuozzo Containers 4.7, explains how to configure Parallels
Virtuozzo Containers configuration files to make your Containers function more effectively.
Chapter 3, Parallels Virtuozzo Containers Command Line Interface, describes all available
Hardware Node command-line utilities together with the options and switches that can be passed
to them.
10
Preface
Documentation Conventions
Before you start using this guide, it is important to understand the documentation conventions used
in it.
The table below presents the existing formatting conventions.
Formatting convention Type of Information Example
Special Bold
Items you must select, such as
menu options, command buttons,
or items in a list.
Go to the Resources tab.
Titles of chapters, sections, and
subsections.
Read the Basic Administration chapter.
Italics Used to emphasize the
importance of a point, to
introduce a term or to designate a
command-line placeholder, which
is to be replaced with a real name
or value.
These are the so-called EZ templates.
To destroy a Container, type vzctl
destroy ctid.
Monospace The names of commands, files,
and directories.
Use vzctl start to start a Container.
Preformatted
On-screen computer output in
your command-line sessions;
source code in XML, C++, or
other programming languages.
Saved parameters for Container
101
Monospace Bold
What you type, as contrasted with
on-screen computer output.
# rpm –V virtuozzo-release
Key+Key Key combinations for which the
user must press and hold down
one key and then press another.
Ctrl+P, Alt+F4
Besides the formatting conventions, you should also know about the document organization
convention applied to Parallels documents: chapters in all guides are divided into sections, which,
in their turn, are subdivided into subsections. For example, About This Guide is a section, and
Documentation Conventions is a subsection.
11
Preface
Getting Help
In addition to this guide, there are a number of other resources available for Parallels Virtuozzo
Containers 4.7 which can help you use the product more effectively. These resources include:
Manuals:
Parallels Virtuozzo Containers 4.7 Evaluation Guide. This guide is destined to introduce
you to the main features of Parallels Virtuozzo Containers 4.7 and to its underlying
technology, to help you set up an environment for evaluating the Parallels Virtuozzo
Containers major features, and to suggest the relevant procedures for this evaluation.
Getting Started With Parallels Virtuozzo Containers 4.7 for Linux. This guide provides
basic information on how to install Parallels Virtuozzo Containers 4.7 on your server, create
new Containers, and perform main operations on them.
Parallels Virtuozzo Containers 4.7 for Linux Installation Guide. This guide provides
exhaustive information on the process of installing, configuring, and deploying your Parallels
Virtuozzo Containers system. As distinct from the Getting Started With Parallels Virtuozzo
Containers 4.7 for Linux guide, it contains a more detailed description of all the operations
needed to install and set Parallels Virtuozzo Containers 4.7 to work including planning the
structure of your network, performing the Parallels Virtuozzo Containers unattended
installation, etc. Besides, it does not include the description of any Container-related
operations.
Parallels Virtuozzo Containers 4.7 for Linux User's Guide. This guide provides
comprehensive information on Parallels Virtuozzo Containers 4.7 covering the necessary
theoretical conceptions as well as all practical aspects of working with Parallels Virtuozzo
Containers. However, it does not deal with the process of installing and configuring your
system.
Parallels Virtuozzo Containers 4.7 for Linux Templates Management Guide. This guide
is meant to provide complete information on Parallels Virtuozzo Containers templates - an
exclusive Parallels technology allowing you to efficiently deploy standard Linux applications
inside your Containers and to greatly save the Hardware Node resources (physical memory,
disk space, etc.).
Help systems:
Parallels Management Console Help. This help system provides detailed information on
Parallels Management Console - a graphical user interface tool for managing Hardware
Nodes and their Containers.
Parallels Virtual Automation Online Help. This help system shows you how to work with
Parallels Virtual Automation - a tool providing you with the ability to manage Hardware
Nodes and their Containers with the help of a standard Web browser on any platform.
Parallels Power Panel Online Help. This help system deals with Parallels Power Panel - a
means for administering individual Containers through a common Web browser on any
platform.
12
Preface
Feedback
If you spot a typo in this guide, or if you have an opinion about how to make this guide more
helpful, you can share your comments and suggestions with us by completing the Documentation
Feedback form on our website (http://www.parallels.com/en/support/usersdoc/).
In order to make Parallels Virtuozzo Containers 4.7 successfully accomplish its tasks, you need to
understand how to configure the Parallels Virtuozzo Containers software correctly. This chapter
explains what configuration parameters Parallels Virtuozzo Containers has and how they affect its
behavior.
In This Chapter
Matrix of Parallels Virtuozzo Containers Configuration Files ...................................... 14
Managing Parallels Virtuozzo Containers Scripts ..................................................... 56
CHAPTER 2
Configuring Parallels Virtuozzo Containers
4.7
14
Configuring Parallels Virtuozzo Containers 4.7
Matrix of Parallels Virtuozzo Containers
Configuration Files
There are a number of files responsible for the Parallels Virtuozzo Containers system configuration.
Most of the files are located in the /etc directory on the Node. However, some configuration files
are stored in the /etc directory inside the Service Container, on the Backup Node, inside a
Container, or on a dedicated server. In case a configuration file is located in a place other than the
Hardware Node, we point clearly the exact position (the Service Container, etc.) where it can be
found.
A list of configuration files is presented in the table below:
/etc/vz/vz.conf The Parallels Virtuozzo Containers global
configuration file. This file keeps system-wide settings
affecting the Container and template default
location, global network settings, and so on.
/etc/vz/conf/<CT_ID>.conf The private configuration file owned by a Container
numbered <CT_ID>. The file keeps Container
specific settings: its resource management
parameters, the location of private area, IP
addresses, and so on.
/etc/vz/conf/ve-<name>.conf.sample Sample files containing a number of resources
settings that can be used as the basis for creating
Containers.
/etc/vz/conf/dists/<distribution_name>
.conf
The configuration files used to determine what scripts
are to be run on performing some operations in the
Container context (e.g. on adding a new IP address
to the Container). These scripts are different from
Parallels Virtuozzo Containers action scripts and
depend on the Linux version the given Container is
running.
/etc/sysconfig/vzsve The configuration file used for the Service Container
creation by
vzsveinstall
.
/etc/sysconfig/vzagent/<file> Parallels Agent configuration files.
/etc/vz/conf/networks_classes The definition of network classes, used by traffic
shaping and bandwidth management in Parallels
Virtuozzo Containers.
/etc/sysconfig/vzup2date/vzup2date.con
f
This file specifies the default connection parameters
for the vzup2date utility.
/<path>/<name>.conf This configuration file specifies the default connection
parameters for the vzup2date-mirror utility. It
should be located on the computer where you are
planning to run vzup2date-mirror.
/etc/cron.d/vereboot The configuration file for the cron daemon. Using
this file, Parallels Virtuozzo Containers emulates the
reboot” command working inside a Container.
15
Configuring Parallels Virtuozzo Containers 4.7
/etc/vzvpn/vzvpn.conf The configuration file used to define the parameters
for establishing a private secure channel to the
Parallels support team server.
/etc/vzreport.conf The configuration file used to define the parameters
for sending your problem report to the Parallels
support team.
/etc/sysctl.conf Kernel parameters. Parallels Virtuozzo Containers
adjusts a number of kernel sysctl parameters, and
modifies the default
/etc/sysctl.conf
file.
/etc/vzredirect.d/*.conf These files define the offline management modes for
controlling Containers by Container administrators.
/etc/vzlmond.conf This configuration file defines the parameters used by
the vzlmond daemon to collect information on the
main Hardware Node resources consumption.
/etc/vzstat.conf The file lists the warning and/or error levels for a
number of resource control parameters. If a
parameter hits the warning or error value, the
vzstat utility will display this parameter in yellow or
red.
/etc/vzstatrep.conf This configuration file is located on the Monitor Node
and used by the vzstatrep utility when generating
statistic reports and graphics on the Hardware Node
resource consumption and sending these reports to
the Node administrator.
/etc/vzbackup.conf The global configuration file residing on the Backup
Node and determining the global Container backup
settings.
/etc/vz/pkgproxy/rhn.conf The Red Hat Network (RHN) Proxy Server
configuration file used by the vzrhnproxy utility
when setting up the RHN Proxy Server. This file can
be located on any computer where the vzrhnproxy
package is installed.
/etc/vzpkgpoxy/vzpkgproxy.conf This configuration file is used by the vzpkgproxy
utility when creating special caching proxy servers for
OS and application EZ templates. The file can be
located on any computer where the vzpkgproxy
package is installed.
/etc/vztt/vztt.conf This configuration file is used by the vzpkg utility
when managing OS and application EZ templates.
16
Configuring Parallels Virtuozzo Containers 4.7
Global Parallels Virtuozzo Containers Configuration File
Parallels Virtuozzo Containers keeps its system wide configuration parameters in the
/etc/vz/vz.conf configuration file. This file is in shell format. Keep in mind that Parallels
Virtuozzo Containers scripts source this file thus, shell commands in this file will cause system to
execute them under root account. Parameters in this file are presented in the form
PARAMETER=”value”. Logically all the parameters belong to the following groups: global
parameters, logging, disk quota, template, network traffic, Containers, validation and
overcommitment, supplementary parameters, and name-based hosting parameters. Below is the
description of all parameters defined in this version of Parallels Virtuozzo Containers.
Global parameters
Parameter Description Default value
VIRTUOZZO This can be either “yes” or “no”. Parallels Virtuozzo
Containers System V startup script checks this
parameter. If set to “no”, then Parallels Virtuozzo
Containers modules are not loaded. You might set
it to “no” if you want to perform system
maintenance and do not want to bring up all
Containers on the Node.
yes
HTTP_PROXY Specifies either the hostname or the IP address of
the HTTP proxy server. After setting this
parameter and in case you use an HTTP proxy
server for handling all HTTP requests, the Parallels
Virtuozzo Containers utilities communicating with
the outer world through HTTP (e.g. the vzreport
utility) will use this server for managing all your
HTTP messages (e.g. sending your problem
report).
-
ACTIONLOGDIR This is the directory where vzctl keeps a log of
its actions in the format suitable for Parallels
Virtuozzo Containers statistics daemon hwcoll.
/vz/actionlog
LOCKDIR Actions on a Container should be serialized, since
two simultaneous operations on the same
Container may break its consistency. Parallels
Virtuozzo Containers keeps lock files in this
directory in order to serialize access to one
Container.
/vz/lock
REMOVEMIGRATED Specifies whether the private area and the
configuration file of the Container moved to a new
Node with the vzmigrate command should be
destroyed on the Source Node (the value of the
parameter is set to yes) or renamed to have the
.migrated suffix (the value of the parameter is
set to no). You may wish to leave the Container
private area and the configuration file to make
migration faster. This configuration value can be
overridden by the vzmigrate command-line
options.
no
17
Configuring Parallels Virtuozzo Containers 4.7
VE0CPUUNITS CPU weight designated for the Node itself. 1000
OFFLINE_MANAGEMENT Specifies whether Containers can be managed by
the Container administrator by means of the
services indicated in the OFFLINE_SERVICE
parameter.
yes
OFFLINE_SERVICE These services correspond to the names of the
files in the /etc/vzredirect.d directory, each
file defining at what port the service will be
accessible and to what Container the requests
coming to this port will be redirected. These
services will be accessible to those Containers
which have the OFFLINE_MANAGEMENT
parameter set to "yes".
vzpp-plesk vzpp
BURST_CPU_AVG_USAGE The CPU usage limit, in percent, set for the
Container. This limit is calculated as the ratio of
the current Container CPU usage to the CPU limit
(i.e to the value of the CPULIMIT parameter) set
for the Container in its configuration file. If the limit
is not specified, the full CPU power of the Node is
considered as the CPU limit. Upon exceeding the
BURST_CPU_AVG_USAGE limit, the
BURST_CPULIMIT limit is applied to the given
Container.
This parameter can be redefined by the
BURST_CPU_AVG_USAGE parameter set in the
Container configuration file.
disabled
BURST_CPULIMIT The CPU power limit, in per cent, the Container
cannot exceed. The limitations set in this
parameter are applied to any Container exceeding
the limit specified in the BURST_CPU_AVG_USAGE
parameter.
This parameter can be redefined by the
BURST_CPULIMIT parameter set in the Container
configuration file.
VEFORMAT Determines the VZFS version to be applied to all
Containers that will be created on the given Node:
If you wish your Containers to use the
benefits of the VZFS v2 technology, the
value of this parameter should be set to
vz4.
If you wish your Containers to be based
on VZFS v1, you should make sure that
the value of this parameter is set to
vz3
.
vz4
18
Configuring Parallels Virtuozzo Containers 4.7
VZMOUNTS Defines the partitions which will be automatically
mounted by the /etc/init.d/vz script after
the Node boot. This script will check (by calling the
fsck utility) and mount all the partitions specified
as the value of this parameter, listed in
/etc/fstab file on the Node, and having the
noauto flag set for them in this file.
/vz
CEP Enables/disables your participation in the Parallels
Customer Experience Program (CEP). The
following options are available:
yes enables CEP
no
disables CEP
yes
Logging parameters affect the vzctl utility logging behavior.
Parameter Description Default value
LOGGING This parameter defines whether vzctl should log its
actions.
yes
LOGFILE File where
vzctl
logs its actions. /var/log/vzctl.log
LOG_LEVEL There are three levels of logging defined in the current
version of Parallels Virtuozzo Containers.
0
The table below describes the possible values of the LOG_LEVEL parameter and their meanings:
Log level Information to be logged
0 Actions of
on Containers like
,
,
,
,
,
.
1 Level 1 logs events, calls to vzctl helper scripts located in /etc/vz/conf (such as vz-
start and vz-stop) and situations when the init process of the Container is killed on
Container stop after timeout.
2 Level 0 and level 1 logging events, plus template version used for Container creation and
calls to mount and quota operations with parameters.
Disk quota parameters allow you to control the disk usage by the Containers:
Parameter Description Default value
DISK_QUOTA Defines whether to turn on disk quota for Containers. If set to
“no” then disk space and inodes accounting will be disabled.
yes
VZFASTBOOT Determines the Container quota reinitialization procedure when
the Node is booted after an incorrect shutdown. If set to "no",
the disk quota is reinitialized for each Container during the Node
startup and only then are the Containers started, which results
in a long Node and Containers booting time. When set to "yes",
the Container quota reinitialization procedure depends on the
Container quota files state:
Those Containers whose quota files
(/var/vzquota/quota.<CT_ID>) have a "dirty"
flag set, meaning that their contents are inconsistent
with the real Containers usage, are started without
no
19
Configuring Parallels Virtuozzo Containers 4.7
the quota reinitialization. After all the Containers with
"dirty" flags are launched, they are restarted one by
one to reinitialize their respective quotas.
Those Containers whose quota files are absent from
the Node or corrupted are started only after their
quota has been successfully reinitialized.
In general, setting the VZFASTBOOT parameter to "yes" allows
you to considerably reduce the Node and Containers downtime
after the incorrect Node shutdown.
Network traffic parameters define whether you want to account bandwidth consumed by
Containers and whether you want to limit bandwidth available to Containers:
Parameter Description Default value
TRAFFIC_SHAPING Traffic shaping allows you to limit the bandwidth
consumed by Containers for outgoing traffic. If it is set
to “yes”, then limitations will be turned on.
no
BANDWIDTH This is the list of network interfaces on which we want
to shape the traffic and their speed in the form of
“dev:rate”. The rate is measured in Kbits/s. If you want
to shape traffic on more than one interface, set this
parameter to “dev1:rate1 dev2:rate2”. For example, for
two 100 Mbits/s Ethernet cards, set it to “eth0:102400
eth1:102400”.
eth0:102400
TOTALRATE Size of the bandwidth pool for all Containers. It is the
upper limit for the bandwidth available to all your
Containers and is specified in the form of
“dev:class:rate”. The rate is measured in Kbits/s.
Containers can consume bandwidth up to this limit in
addition to the limit specified by the RATE parameter.
Default value corresponds to 4 Mbits/s limit for the
Class 1 Containers.
eth0:1:4096
RATE Default bandwidth guaranteed to a Container for
outgoing traffic if the Container configuration file does
not explicitly specify a different value. This value is in
the same format as TOTALRATE and its default value is
“eth0:1:8”. The rate is measured in Kbits/s. Note that
8 Kbits/s, offered by the default configuration, is the
guarantee and the Container cannot consume less
than this value and more than the sum of this value
and
TOTALRATE
.
eth0:1:8
IPV6 Enables (yes) or disables (no) the support for using
IPv6 addresses with Containers. If enabled, you can
assign IPv6 addresses to Containers and manage
them in the same way you would manage IPv4
addresses (e.g., set network classes for IPv6
addresses or connect to Containers with Parallels
Power Panel using IPv6 addresses).
yes
USE_VENET_MASK Enables (yes) or disables (no) the possibility of setting
network masks for Containers operating in the venet0
networking mode.
no
20
Configuring Parallels Virtuozzo Containers 4.7
VZ_TOOLS_BCID Enables disk I/O limits for vzabackup,
vzarestore, and vzmigrate operations. Make
sure that the value of this parameter does not coincide
with the ID assigned to some of your Containers. For
example, if you leave the default value 2, ensure that
no Container with ID 2 exists on the Node.
no
VZ_TOOLS_IOLIMIT Sets the disk I/O limit for the backup, restore, and
migration operations, in bytes per second.
10485760
Template parameters allow to configure the template area location.
Parameter Description Default value
TEMPLATE This is the directory where to find templates. It is not
recommended to redefine this option since all the
templates built by Parallels use the default directory.
/vz/template
Container default parameters either affect new Container creation or represent Container
parameters that can be overridden in the Container configuration file:
Parameter Description Default value
VE_ROOT This is a path to the Container root directory where
the private area is mounted.
/vz/root/CT_ID
VE_PRIVATE This is a path to the Container private area, where
VZFS keeps its private data. VZFS implementation
requires VE_PRIVATE reside within a single
physical partition.
/vz/private/CT_ID
CONFIGFILE The default configuration file sample to be used for
the Container creation; it may be overridden with
the --config option of the vzctl create
command.
basic
DEF_OSTEMPLATE The default OS template to be used for the
Container creation; it may be overridden with the -
-pkgset command-line option for vzctl
create
.
.centos-5-x86
IPTABLES Only those iptables modules will be loaded to
the Containers hosted on the Node which are
indicated as the value of this parameter and only if
they are loaded on the Node itself as well.
ip_tables ipt_REJECT
ipt_tos ipt_limit
ipt_multiport
iptable_filter
iptable_mangle
ipt_TCPMSS ipt_tcpmss
ipt_ttl ipt_length
VE_ENVIRONMENT Additional environment variables to be passed to
the Container init process. Should be provided
as any number of name=value pairs separated by
spaces.
Container validation and overcommitment parameters define whether the Container configuration
should be validated and the Node overcommitment checked on a Container startup:
Parameter Description Default value
VE_VALIDATE_ACTION Defines whether the
Container configuration
none
21
Configuring Parallels Virtuozzo Containers 4.7
should be validated when a
Container is started. If this
parameter is set to
“warning”, a warning is
displayed in case of
misconfiguration. If set to
“error”, the Container is not
started in case of
misconfiguration. If set to
“fix”, the configuration is
automatically corrected.
OVERCOMMITMENT_ACTION Defines whether the Node
should be checked for the
overcommitment of
resources when a Container
is started. If this parameter is
set to “warning”, a warning
is displayed in case of
overcommitment. If set to
“error”, the Container that
would cause
overcommitment is not
started. When checking for
overcommitment, the
following five parameters are
checked.
none
OVERCOMMITMENT_LEVEL_LOWMEM The percentage of
committed memory residing
at lower addresses and
directly accessed by the
kernel.
120
OVERCOMMITMENT_LEVEL_MEMSWAP The percentage of
committed memory available
for applications including
both RAM and swap space.
90
OVERCOMMITMENT_LEVEL_ALLOCMEM The allocation memory
commitment level is the ratio
of the memory size
guaranteed to be available
for allocation to the capacity
of the system.
100
OVERCOMMITMENT_LEVEL_ALLOCMEM_T
OT
The number shows how
much memory the
1000
22
Configuring Parallels Virtuozzo Containers 4.7
applications are allowed to
allocate in comparison with
the capacity of the system.
OVERCOMMITMENT_LEVEL_ALLOCMEM_M
AX
This allocation memory
commitment level is the ratio
of the maximal (among all
running Containers) amount
of allocated memory to the
capacity of the system.
60
Supplementary parameters define other Parallels Virtuozzo Containers settings:
Parameter Description Default value
VZWDOG Defines whether the vzwdog module is loaded on Parallels
Virtuozzo Containers startup. This module is responsible for
catching messages from the kernel. It is needed if you configure
the serial Monitor Node for Parallels Virtuozzo Containers.
no
VZPRIVRANGE Defines the ID range for the Containers that are allowed to access
the <servere> ID stored in the /proc/vz/hwid file.
1 100
DUMPDIR The directory where the Container dump file created by means of
the vzctl suspend command is to be stored.
/vz/private/C
T_ID/dump
23
Configuring Parallels Virtuozzo Containers 4.7
Container Configuration File
Each Container has its own configuration file, which is stored in the /etc/vz/conf directory and
has a name like CT_ID.conf. This file has the same format as the global configuration file. The
settings specified in this file can be subdivided into the following categories: miscellaneous,
networking, backup, resource management parameters, and name-based hosting parameters.
Note: In Parallels Virtuozzo Containers, you can also configure a number of settings for the Node itself by
editing the /etc/vz/conf/0.conf file. Currently, these settings include the VERSION and ONBOOT
parameters, as well as all parameters listed in the table under the System parameters group.
Miscellaneous parameters:
ONBOOT Specifies whether the Container should be started automatically on system
startup. Parallels Virtuozzo Containers automatically starts all Containers that
have this parameter set to “yes” upon startup.
Note: If "yes" is specified as the value of this parameter in the
0.conf file, all Node system management parameters are set on
the Node boot to the values indicated in this file.
OFFLINE_MANAGEMENT Overrides the OFFLINE_MANAGEMENT parameter from the global
configuration file.
OFFLINE_SERVICE Overrides the OFFLINE_SERVICE parameter from the global configuration
file.
ALLOWREBOOT Specifies whether the Container may be restarted with the “reboot”
command inside. If omitted or set to “yes”, reboot is allowed.
Note: To make reboot working, you should uncomment the
corresponding line in the /etc/cron.d/vereboot file.
CAPABILITY Specifies capabilities inside of the Container. Setting of following capabilities
is allowed: CHOWN, AC_OVERRIDE, AC_READ_SEARCH, FOWNER, FSETID,
KILL, SETGID, SETUID, SETPCAP, LINUX_IMMUTABLE,
NET_BIND_SERVICE, NET_BROADCAST, NET_ADMIN, NET_RAW,
IPC_LOCK, IPC_OWNER, SYS_MODULE, SYS_RAWIO, SYS_CHROOT,
SYS_PTRACE, SYS_PACCT, SYS_ADMIN, SYS_BOOT, SYS_NICE,
SYS_RESOURCE
,
SYS_TIME
,
SYS_TTY_CONFIG
,
MKNOD
,
LEASE
.
OSTEMPLATE The name of the OS template that was used for creating the Container. You
do not have to change this parameter; vzctl will set it for you upon calling
the vzctl create command (or using the defaults from the global
configuration file). The . symbol before the OS template name, if specified,
indicates that this is an EZ OS template.
24
Configuring Parallels Virtuozzo Containers 4.7
TEMPLATES When used in the Container sample configuration file, this parameter defines
a list of application templates that should be automatically added to the
Container being created on the basis of this sample. So, if the corresponding
templates are installed on the Node, and the vzctl create command
uses a configuration file with this parameter defined, the templates will be
added to the Container immediately upon its creation.
When used in the configuration file of an existing Container, this parameter
provides a list of templates that have been installed inside the Container by
means of either the vzctl create, vzpkgadd, or vzpkg install
commands. In this case you should not modify this parameter since it is used
by template management utilities to track the history of the installed
templates. This parameter is omitted if no templates have been applied to the
Container.
VE_ROOT Overrides the VE_ROOT parameter from the global configuration file.
VE_PRIVATE Overrides the VE_PRIVATE parameter from the global configuration file.
VE_ENVIRONMENT Overrides the VE_ENVIRONMENT parameter from the global configuration
file.
TECHNOLOGIES Determines a set of technologies which should be provided by the Parallels
Virtuozzo Containers kernel for the Container operability. Currently, this
parameter can contain the information about the following technologies:
The system architecture of the Container (x86, x86_64, or i64).
Whether the Container is based on the OS template supporting
the Native POSIX Thread Library (NPTL). In this case, the nptl
entry is specified as the value of this parameter.
Whether the OS EZ template the Container is based on requires
the sysfs filesystem support (e.g. the OS EZ template for SUSE
Linux Enterprise 10).
DISABLED If set to yes, disables the Container making it impossible to start the
Container once it was stopped. You can start the disabled Container by
setting the value of this parameter to no or using the --force option with
the vzctl set command.
DESCRIPTION Sets the description for the Container.
Note: You are allowed to use only symbols in the 'A -z' and '0-9'
ranges in your descriptions.
NAME The name assigned to the Container. You can use this name, along with the
Container ID, to refer to the Container while performing this or that Container-
related operation on the Node. Follow the following rules while setting the
Container name:
The name should contain the A-Z, a-z, 0-9, \, -, and _
symbols only.
If the name consists of two or more words, it should be quoted
(e.g. "My Container 101").
25
Configuring Parallels Virtuozzo Containers 4.7
ORIGIN_SAMPLE The configuration sample the Container was based on when created.
CONFIG_CUSTOMIZED Indicates whether any of the Container configuration parameters have been
modified as regards its original configuration sample. If this parameter is
omitted, its value is considered as "no".
UUID The Container unique identifier. This identifier is used by certain Parallels
Virtuozzo Containers utilities during their execution.
VEFORMAT Displays the VZFS version applied to the Container during its creation:
vz4 denotes that the Container is based on VZFS v2.
vz3 denotes that the Container is based on VZFS v1.
This parameter is meant for your information only and cannot
be changed.
All resource management parameters can be subdivided into the CPU, disk, system, and VSwap
categories for your convenience. Any parameter can be set with the vzctl set command and
the corresponding option name (in the lower case, e.g. --kmemsize for KMEMSIZE, etc.). See the
Parallels Virtuozzo Containers Command Line Interface chapter for more details. The Typical
value column, if present, specifies a range of reasonable parameter values for different
applications, from light to huge heavy loaded Containers (consuming 1/8 of Node with 2 GB
memory). If barrier and limit fields are in use, ranges for both thresholds are given.
CPU parameters:
Parameter Description Typical value
CPUUNITS Guaranteed CPU power. This is a positive integer
number, which determines the minimal guaranteed share
of the CPU the Container receives. The total CPU power
in CPUUNITS is its Bogomips number multiplied by 25.
Parallels Virtuozzo Containers reporting tools consider
one 1 GHz Intel processor to be approximately equivalent
to 50,000 CPU units.
250…1000
CPULIMIT Allowed CPU power. This is a positive number indicating
the share of the CPU time, in per cent, the Container may
never exceed. You can estimate this share as (allowed
Container CPUUNITS/CPU power)*100%.
CPUS The number of CPUs set to handle all the processes
inside the given Container. By default, any Container is
allowed to consume the CPU time of all processors on
the Node.
CPUMASK The CPU affinity mask defining which CPUs on the Node
can be used to handle the processes running in the
Container. The CPU mask can be specified as both
separate CPU index numbers (1,2,3) and CPU ranges (2-
4,5-7).
26
Configuring Parallels Virtuozzo Containers 4.7
NODEMASK The NUMA node mask defining a NUMA node to bind the
Container to. Once you set the mask, the processes
running in the Container will be executed only on the
CPUs that belong to the specified NUMA node.
BURST_CPU_AVG_
USAGE
The CPU usage limit, in percent, set for the Container.
This limit is calculated as the ratio of the current
Container CPU usage to the CPU limit (i.e to the value of
the CPULIMIT parameter) set for the Container in its
configuration file. If the limit is not specified, the full CPU
power of the Node is considered as the CPU limit. Upon
exceeding the BURST_CPU_AVG_USAGE limit, the
BURST_CPULIMIT limit is applied to the Container. This
parameter redefines the BURST_CPU_AVG_USAGE
parameter set in the Parallels Virtuozzo Containers
configuration file.
disabled
BURST_CPULIMIT The CPU power limit, in per cent, the Container cannot
exceed. The limitations set in this parameter are applied
to the Container when it exceeds the limit specified in the
BURST_CPU_AVG_USAGE parameter. This parameter
redefines the BURST_CPULIMIT parameter specified in
the Parallels Virtuozzo Containers configuration file.
Disk parameters:
DISKSPACE Total size of disk space that can be consumed by the
Container, in 1 Kb blocks.
204800…10485760-
204800…11534340
DISKINODES Total number of disk inodes (files, directories, symbolic
links) the Container can allocate.
80000…400000-
88000…440000
QUOTATIME The grace period of the disk quota. It is defined in
seconds. The Container is allowed to temporarily exceed
its quota soft limits for not more than the QUOTATIME
period.
Specifying -1 as the value of this setting makes the grace
period last 'infinitely'.
0…604800
QUOTAUGIDLIMIT This parameter defines the maximum aggregate number
of user IDs and group IDs for which disk quota inside the
given Container will be accounted. If set to 0, the UID and
GID quota will be disabled.
When managing the quotaugidlimit parameter, keep in
mind the following:
Enabling per-user and per-group quotas for
a Container requires restarting the
Container.
If you delete a registered user but some
files with their ID continue residing inside
your Container, the current number of ugids
(user and group identities) inside the
Container will not decrease.
If you copy an archive containing files with
user and group IDs not registered inside
your Container, the number of ugids inside
0…500
27
Configuring Parallels Virtuozzo Containers 4.7
the Container will increase by the number of
these new IDs.
IOPRIO The Container priority for disk I/O operations. The higher
the priority, the more time the Container has for writing to
and reading from the disk. The default Container priority
is 4.
0-7
IOLIMIT The bandwidth a Container is allowed to use for its disk
input and output (I/O) operations, in bytes per second.
In the current version of Parallels Virtuozzo Containers,
the maximum I/O bandwidth limit you can set for a
Container is 2 GB per second.
unlimited
IOPS The maximum number of disk input and output
operations per second a Container is allowed to perform.
unlimited
System parameters:
NUMPROC Number of processes and threads allowed. Upon hitting
this limit, Container will not be able to start a new process
or thread.
40…400
AVNUMPROC Number of processes expected to run in the Container
on average. This is informational parameter used by
utilities like vzcfgvalidate in order to ensure
configuration correctness.
0…NUMPROC
NUMTCPSOCK 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.
40…500
NUMOTHERSOCK Number of sockets other than TCP. Local (UNIX-domain)
sockets are used for communications inside the system.
UDP sockets are used for Domain Name Service (DNS)
queries, as example. UDP and other sockets may also be
used in some very special applications (SNMP agents
and others).
40…500
VMGUARPAGES Memory allocation guarantee, in pages. 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 is not
guaranteed and may fail in case of overall memory
shortage.
1725…107520
KMEMSIZE Size of unswappable kernel memory, allocated for internal
kernel structures for the processes of a particular
Container. Typical amounts of kernel memory is 16…50
Kb per process.
798720…13148160-
851968…14024704
TCPSNDBUF The total size of send buffers for TCP sockets, i.e. the
amount of kernel memory allocated for data sent from
applications to TCP sockets, but not acknowledged by
the remote side yet.
159744…5365760-
262144…10458760
TCPRCVBUF Total size of receive buffers for TCP sockets. Amount of
kernel memory, received from remote side but not read
by local application yet.
159744…5365760-
262144…10458760
28
Configuring Parallels Virtuozzo Containers 4.7
OTHERSOCKBUF Total size of UNIX-domain socket buffers, UDP and other
datagram protocols send buffers.
61440…1503232-
163840…4063232
DGRAMRCVBUF Total size of receive buffers of UDP and other datagram
protocols.
32768…262144
OOMGUARPAGES Out-of-memory guarantee, in pages. Any Container
process will not be killed even in case of heavy memory
shortage if current memory consumption (including both
physical memory and swap) until the oomguarpages
barrier is not reached.
1725…107520
LOCKEDPAGES Memory not allowed to be swapped out (locked with the
mlock()
system call), in pages (one page is 4 Kb).
4…4096
SHMPAGES Total size of shared memory (including IPC, shared
anonymous mappings and tmpfs objects), allocated by
processes of a particular Container, in pages.
512…16384
PRIVVMPAGES Size of private (or potentially private) memory, allocated
by an application. Memory that is always shared among
different applications is not included in this resource
parameter.
3072…151200-
3450…1612800
NUMFILE Number of files opened by all Container processes. 512…8192
NUMFLOCK Number of file locks created by all Container processes. 50…200 – 60…220
NUMPTY Number of pseudo-terminals. For example, the ssh
session, screen, the xterm application consumes
pseudo-terminal resources.
4…64
NUMSIGINFO Number of siginfo structures (essentially this
parameter limits the size of signal delivery queue).
256…512
DCACHESIZE Total size of dentry and inode structures locked in
memory. As example, application, first opening the
/etc/passwd file, locks entries corresponding to etc
and passwd inodes. If a second application opens the
/etc/shadow file only entry corresponding to shadow
is charged, because etc is charged already.
184320…3932160-
196608…4194304
NUMIPTENT The number of IP packet filtering entries. 12…128
VSwap parameters:
PHYSPAGES Amount of RAM that can be used by the processes of a
Container, in 4-KB pages.
SWAPPAGES Amount of swap space that can be used by the
Container for swapping out memory once the RAM is
exceeded, in 4-KB pages.
VM_OVERCOMMIT Memory overcommit factor that defines the
memory allocation limit for a Container. The
limit is calculated as
(PHYSPAGES + SWAPPAGES) * factor.
1.5
29
Configuring Parallels Virtuozzo Containers 4.7
Network-related parameters allow you to set bandwidth management parameters, hostname and
IP addresses that a Container can use as well as to indicate those iptables modules that can be
loaded to the Container:
HOSTNAME If this parameter is specified, then vzctl will set the hostname to its value upon
the next Container start. This parameter can be omitted. In this case, the Container
administrator should configure the hostname manually.
IP_ADDRESS The list of IP addresses that can be used on Container network interfaces. This list
is an argument of the Container start call and it is impossible to assign an IP
address from inside the Container if the address is not on the list. Any IP address
assigned from within the Container will be visible only within the Container.
EXT_IP_ADDRESS The external IP address assigned to the Container. External IP addresses are
considered valid IP addresses by the venet0 adapter, though they are not set as
alias addresses inside Containers and are not announced via Address Resolution
Protocol (ARP).
NAMESERVER The IP address of the DNS server the Container is supposed to use. More than one
server can be specified in the space-separated format.
SEARCHDOMAIN DNS search domains for the Container. More than one domain can be specified.
NETDEV The names of physical network adapters that have been moved from the Node to
the given Container.
IPTABLES Overrides the IPTABLES parameter from the Parallels Virtuozzo Containers global
configuration file.
NETIF Specifies a number of parameters for the virtual network adapters existing inside
the Container. These parameters include:
ifname: the name of the veth virtual Ethernet interface inside the
Container.
mac: the MAC address assigned to the veth virtual Ethernet interface
inside the Container.
host_mac: the MAC address assigned to the veth virtual Ethernet
interface on the Node.
network: the name of the virtual network where the veth virtual
network adapter is included.
ip
: the IP address(es) assigned to the
veth
virtual network adapter.
RATE If traffic shaping is turned on, then this parameter specifies bandwidth guarantee, in
Kb/s, for the Container. The parameters should be set in the form of
“eth0:1:8”
.
RATEBOUND
If set to “yes”, the bandwidth guarantee is also the limit for the Container, and the
Container cannot borrow the bandwidth from the TOTALRATE bandwidth pool.
Backup-related parameters, if present, allow you to specify the number of backups to store. If absent, these parameters
are taken from the global backup configuration file or the backup configuration file for a particular Node.
BACKUP_CHAIN_LEN An incremental backup parameter. After this
number of incremental backups, a full backup
is performed.
7
BACKUP_CHAIN_DAY An incremental backup parameter. After this 7
30
Configuring Parallels Virtuozzo Containers 4.7
S
number of days a full backup is performed.
BACKUP_KEEP_MAX The number of backups to store. Only full and
plain full backups are accounted. If a regular
backup is being performed that exceeds this
number, the oldest backup is automatically
deleted. This parameter is effective only if the -
p option is specified with the vzbackup utility.
If there is no -p option, the number of backups
to store is not limited whatever the value of this
parameter.
3
31
Configuring Parallels Virtuozzo Containers 4.7
Linux Distribution Configuration Files
Some Parallels Virtuozzo Containers utilities (e.g. vzctl) need to run special scripts inside a
Container to perform certain operations on it. However, carrying out one and the same operation
inside Containers running different Linux versions may require execution of different actions. This
may be caused by the fact that different Linux distributions store files in different locations, use
different commands to complete one and the same task, and so on. To distinguish between
Containers running different Linux versions and to determine what scripts should be executed while
performing the relevant Container-related operations, Parallels Virtuozzo Containers uses special
distribution configuration files located in the /etc/vz/conf/dists directory on the Node.
There are a number of distribution configuration files shipped with Parallels Virtuozzo Containers by
default (centos.conf, fedora-core.conf, gentoo.conf, etc.). To view all configuration files
available on your Parallels Virtuozzo Containers, you can go to the /etc/vz/conf/dists
directory and issue the ls command. The distribution configuration files will be displayed in the
form of Linux_Distribution_Name-version.conf where Linux_Distribution_Name
and version denote the name of the Linux distribution and its version, respectively (e.g. fedora-
core-7.conf).
Any distribution configuration file consists of a number of entries in the form of
<parameter_name>=<script_name> where <parameter_name> denotes the name of the
parameter defining the operation when the script in the right part of the entry is to be executed and
<script_name> is the name of the script to be run on performing the operation defined by the
parameter in the left part of the entry. In the current version of Parallels Virtuozzo Containers, the
following parameters are used to define what scripts should be executed for the corresponding
Linux version a Container is running:
ADD_IP: the script specified as the value of this parameter has the default name of
<distribution_name>-add_ip.sh and is used to configure the network settings during
the Container startup and the IP address(es) assignment. The script is launched inside the
Container on executing the following commands:
vzctl start CT_ID
vzctl set CT_ID --ipadd <ip_address>
vzctl set CT_ID --ipadd <ip_address> --ipdel all
DEL_IP: the script specified as the value of this parameter has the default name of
<distribution_name>-del_ip.sh and is used to delete an existing IP address from the
Container. The script is launched inside the Container on executing the following commands:
vzctl set CT_ID --ipdel <ip_address>
vzctl set CT_ID --ipdel all
SET_HOSTNAME: the script specified as the value of this parameter has the default name of
<distribution_name>-set_hostname.sh and is used to configure the hostname of the
Container. The script is launched inside the Container on executing the following command:
vzctl set CT_ID --hostname <name>
32
Configuring Parallels Virtuozzo Containers 4.7
SET_DNS: the script specified as the value of this parameter has the default name of
<distribution_name>-set_dns.sh and is used to configure DNS parameters in the
/etc/resolv.conf file. The script is launched inside the Container on executing the following
command:
vzctl set CT_ID --searchdomain <domain> --nameserver <ip_address>
SET_USERPASS: the script specified as the value of this parameter has the default name of
<distribution_name>-set_userpass.sh and is used to add a new user or change the
current password. The script is launched inside the Container on executing the following
command:
vzctl set CT_ID --userpasswd <user:passwd>
SET_UGID_QUOTA: the script specified as the value of this parameter has the default name of
<distribution_name>-set_ugid_quota.sh and is used to set up second level quota.
The script is launched inside the Container on executing the following command:
vzctl set CT_ID --quotaugidlimit <num>
POST_CREATE: the script specified as the value of this parameter has the default name of
<distribution_name>-postcreate.sh and is used to perform certain tasks (e.g. to
modify the crontab files) after the Container creation. This script is launched on the Node on
executing the following command:
vzctl create CT_ID
POST_MIGRATE: the script specified as the value of this parameter has the default name of
<distribution_name>-post_migrate.sh and is used to perform certain operations on
the Container where the physical server has been successfully migrated. This script is launched
inside the Container on executing the following command:
vzp2v [options] --ctid CT_ID
The scripts specified in distribution configuration files are located in the
/etc/vz/conf/dists/scripts directory on the Node and executed on performing the
aforementioned operations on the Containers. After an operation has been initiated, the vzctl or
vzp2v utility turns to the corresponding Container configuration file, looks for the value of the
DISTRIBUTION variable or, if the latter is not present, of the OSTEMPLATE variable in this file, and
defines on their basis what Linux version the given Container is running. After that, vzctl reads
the corresponding configuration file for the determined Linux version from the
/etc/vz/conf/dists directory and executes the scripts specified in this file.
Note: If no distribution is specified as the value of the DISTRIBUTION and OSTEMPLATE variables in the
Container configuration file or no configuration file for the given Linux version was found in the
/etc/vz/conf/dists directory, the default file from this directory is used.
33
Configuring Parallels Virtuozzo Containers 4.7
Network Classes Definition File
In Parallels Virtuozzo Containers, both traffic accounting and bandwidth management are based on
network classes. The network classes’ definition file (/etc/vz/conf/networks_classes)
describes network classes that Parallels Virtuozzo Containers recognizes. Currently, there can be
up to 15 classes defined.
The lines in this file have the following format:
<class_id> <ip_address>/<prefix_length>
where <class_id> defines the network class identifier, <ip_address> defines the starting IP
address, and <prefix_length> defines the subnet mask. In pair <ip_address> and
<prefix_length> define the range of IP addresses for this class. There may be several lines for
each class. Classes should be defined after Class 1 and represent exceptions from the “matching-
everything” rule of Class 1. Class 0 has a special meaning and defines the IP ranges for which no
accounting is done (this Node Container addresses).
The definition of class 1 is required; any class except class 1 can be omitted. However, it is
recommended to define class 0 correctly - it will improve performance. For example:
# HW node VPS's networks
0 10.10.10.0/24
0 10.10.15.0/24
# all IP("local" traffic)
1 0.0.0.0/0
# class 2 - "foreign" traffic
#2 10.0.0.0/8
#2 11.0.0.0/8
# inside "foreign" network there
# is a hole with "local" traffic
#1 10.10.16.0/24
34
Configuring Parallels Virtuozzo Containers 4.7
vzup2date Configuration File
The /etc/sysconfig/vzup2date/vzup2date.conf file is used by the vzup2date utility on
the step of connecting to the repository with storing the latest Parallels Virtuozzo Containers
updates.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Description Example
Server The URL used for the connection. https://vzup2date.
parallels.com
User The user name for accessing the update server. user1
Password The password for accessing the update server. sample
HTTP_PROXY The proxy server address, if you use this server. http://192.168.1.20
HTTP_PROXY_U
SER
The user name used by the HTTP proxy server for
your authentication.
peter
HTTP_PROXY_P
ASSWORD
The password of the user specified in the
HTPP_PROXY_USER parameter and used for your
authentication by the HTTP proxy server.
2wed45r
LocalReposit
oryDir
The path to the local directory on the Node where the
downloaded Parallels Virtuozzo Containers updates
are stored. By default, the /vz/vzup2date directory
is used.
/vz/vzup2date
LogFile The path to the log file on the Node containing the
information on Parallels Virtuozzo Containers updates.
By default, the /var/log/vzup2date.log file is
used.
/var/log/vzup2date.log
Not all the possible parameters must be necessarily present in this file. In fact, all the parameters
are optional, i.e. if they are missing from this file, the vzup2date utility will ask for the user input
without suggesting its own variant taken from this file.
35
Configuring Parallels Virtuozzo Containers 4.7
vzup2date-mirror Configuration File
The vzup2date-mirror configuration file is used by the vzup2date-mirror utility for
determining the connection parameters of the repository with Parallels Virtuozzo Containers system
and templates updates and deciding what updates to download to the local mirror. The parameters
in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The options that can be specified in the vzup2date.conf file are described in the table below:
Parameter Description Example
Server The URL used for the connection.
As a rule, this parameter is set automatically and
does not need to be modified.
https://vzup2date.
parallels.com
User The user name for accessing the update server.
As a rule, this parameter is set automatically and
does not need to be modified.
user1
Password The password for accessing the update server.
As a rule, this parameter is set automatically and
does not need to be modified.
sample
HTTP_PROXY The proxy server address, if you use this server. http://192.168.1.20
HTTP_PROXY_USER The user name used by the HTTP proxy server
for your authentication.
peter
HTTP_PROXY_PASSWO
RD
The password of the user specified in the
HTTP_PROXY_USER parameter and used for
your authentication by the HTTP proxy server.
2wed45r
LocalRepositoryRo
ot
The local directory where the mirror is to be
located and all the required packages are to be
stored after the execution of vzup2date-
mirror. This parameter can be overwritten by
the local_repo_path parameter of the
vzup2date-mirror utility (to learn more
about local_repo_path, see the
vzup2date-mirror subsection).
/var/www/html
36
Configuring Parallels Virtuozzo Containers 4.7
Releases The list of comma-separated Parallels
Virtuozzo Containers releases or OS
templates names. The format of this
parameter is different for different types
of updates:
For system updates, you should set
it in the arch/Parallels
Virtuozzo
Containers_release format.
For EZ templates updates, you
should set it in the
arch/EZ_template_name
format.
By default, the value of this parameter is set to
all/all meaning that all available updates for
all system architectures will be downloaded
from the Parallels Virtuozzo Containers official
repository to your local mirror.
i386/5
MirrorName The name assigned to the mirror. You must
specify this parameter for each mirror if you are
planning to have several mirrors with different
LocalRepositoryRoot parameters
operating simultaneously on your server (in one
Container). These mirror names will be used by
the apache application to distinguish among
the existing mirrors.
Mirror1
HTTPD_CONFIG_
FILE
The path to the httpd configuration file. This
file is required for the correct work of the
apache application. As you can create an
HTTP-based mirror only, the apache
application should be installed on the server and
a valid path to httpd.conf should be
specified. By default, this parameter is set to
/etc/httpd/conf/httpd.conf. If you have
not change the default httpd.conf file
location, you do not need to change this
parameter.
/etc/httpd/conf/
httpd.conf
The vzup2date-mirror configuration file can also include a section defining the updates
approval policy for deploying Parallels Virtuozzo Containers system updates to the Nodes in your
local network. This section must be opened with the <ApproveSystemUpdate
arch/release> tag (where arch denotes the system architecture (e.g. x86_64) and release
denotes the Parallels Virtuozzo Containers release (e.g. 5) the specified policy will be applied to)
and closed with the </ApproveSystemUpdate> tag. This section is optional. If it is absent from
the configuration file, all updates downloaded to your local mirror are automatically approved for
installation on your Nodes. The parameters that can be specified in this section are described in the
table below:
37
Configuring Parallels Virtuozzo Containers 4.7
Parameter Description
CU The maximum version of Parallels Virtuozzo Containers kernel updates for the specified
architecture/release pair. All Parallels Virtuozzo Containers kernel updates having
higher versions and downloaded to your local mirror will be invisible for the
vzup2date utility that you will run on the Nodes in your local network.
TU The maximum version of Parallels Virtuozzo Containers tools and utilities updates for
the specified architecture/release pair. All tools and utilities updates having higher
versions and downloaded to your mirror will be invisible for the vzup2date utility that
you will run on the Nodes in your local network.
MU Enables (yes) or disables (no) the vzup2date utility to download the next major
version update of the Parallels Virtuozzo Containers software.If this parameter or the
whole updates approval mechanism section is omitted, major updates are available to
the vzup2date utility by default.
38
Configuring Parallels Virtuozzo Containers 4.7
vzvpn Configuration File
The /etc/vzvpn/vzvpn.conf file is used by the Parallels Support Tool to establish a secure
connection (a virtual private network) between your Node and the Parallels support server.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Description
REMOTE_HOST Mandatory. The hostname or the IP address of the Parallels support
server.
REMOTE_PORT Mandatory. The port number of the Parallels support server to be used for
establishing a virtual private network (VPN).
STARTTMO Mandatory. The time, in seconds, during which there will be attempts to
start the Parallels Support Tool if it could not be started immediately after
its launching.
INACTIVE Mandatory. The time of inactivity, in seconds, after which the connection
between your Node and the Parallels support server will be closed.
PING Mandatory. The time, in seconds, at the end of which the port of the
Parallels support server will be pinged in case no packets have been
received from the support server during the time specified.
PING_EXIT Mandatory. The time, in seconds, after a lapse of which the connection
between your Node and the Parallels support server will be closed in case
no ping signals or other packets have been received from the support
server during this time.
HTTP_PROXY=hostname[:
port]
Optional. The hostname or the IP address and the port number of the
HTTP proxy server through which a VPN between your Node and the
Parallels support server is to be established. This parameter overrides the
HTTP_PROXY parameter set in the /etc/vz/vz.conf file on the Node.
If the HTTP_PROXY parameter is not specified in either of the files, the
Parallels Support Tool looks for the http_proxy environment variable on
the Node and takes its value for establishing a VPN.
HTTP_PROXY_USER Optional. The user name used by the HTTP proxy server for your
authentication.
HTTP_PROXY_PASSWORD Optional. The password of the user specified in the HTTP_PROXY_USER
parameter and used for your authentication by the HTTP proxy server.
Note: You are not recommended to change any of the aforementioned parameters. Modify them only if
you are dead certain of your actions (for example, you have received the corresponding information from
Parallels).
39
Configuring Parallels Virtuozzo Containers 4.7
vzreport Configuration File
The /etc/vzreport.conf file is used by the vzreport utility to submit a problem report to the
Parallels support team.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Description
SUBMIT_URI The Uniform Resource Identifier (URI) of the Parallels support server to be
used to receive and gather your problem reports.
COLLECTOR_SCRIPT The path to the file on your Node where the information on your problems
reports is collected. This is the same data that is sent to the Parallels
support server.
HTTP_PROXY The hostname or the IP address of the HTTP proxy server through which
your problem report will be sent to the Parallels support team.
HTTP_PROXY_USER The user name used by the HTTP proxy server for your authentication.
HTTP_PROXY_PASSWORD The password of the user specified in the HTTP_PROXY_USER parameter
and used for your authentication by the HTTP proxy server.
Not all the possible parameters should be necessarily present in this file. In fact, all the parameters
are optional except for the SUBMIT_URI parameter which should be specified to tell the
vzreport utility where to send your problem report.
40
Configuring Parallels Virtuozzo Containers 4.7
Kernel Parameters
There is a number of kernel limits that should be set for the Parallels Virtuozzo Containers software
to work correctly. Parallels Virtuozzo Containers is shipped with a tuned /etc/sysctl.conf file.
Understanding what parameters were changed is essential for running the required number of
Containers. Below is the contents of the /etc/sysctl.conf file as shipped with Parallels
Virtuozzo Containers:
# On the Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# TCP Explict Congestion Notification
#net.ipv4.tcp_ecn = 0
# ARP thresholds. First one is num_ve x 3 + 512
# second one is 2 times first one
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh3 = 4096
# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
Notice that some parameters of the kernel configuration depends on the maximum number of
Containers you plan to run. In the default configuration file, these numbers were calculated under
the assumption the maximum Container number is 512. If you plan to run another number of
Containers, it is recommended to recalculate net.ipv4.neigh.default.gc_thresh2 and
net.ipv4.neigh.default.gc_thresh3 parameters as three per Container plus 128…512.
Keep the second parameter twice as great as the first one.
To apply the changes issue the following command:
# sysctl -p
Besides, it makes sense to set net.ipv4.tcp_use_sg to 0, since corresponding
Scatter/gather IO” feature is not supported by the venet device, used in Parallels Virtuozzo
Containers networking.
It is also worth mentioning that normally you should have forwarding turned on since the Node
forwards packets destined to or originated from Containers.
41
Configuring Parallels Virtuozzo Containers 4.7
Offline Management Configuration Files
The offline management configuration files located in the /etc/vzredirect.d directory define
various modes of Container offline management by Container administrators. One configuration file
describes one offline management mode. In the current Parallels Virtuozzo Containers version, two
files are accessible: vzpp.conf and vzpp-plesk.conf. The first file defines the Container
offline management by means of Parallels Power Panel, and the second one - by means of the
same Power Panel with an integrated Plesk control panel.
There are two parameters in each of the files. They are presented on separate lines in the following
format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Description Example
PORT This port must be entered in the address line of an
Internet browser after the Container IP address when
managing the Container by means of Parallels Power
Panel or the Plesk control panel.
PORT=8443
DST_VEID The ID of the Container where the requests coming to
the specified port will be redirected.
DST_VEID=1
42
Configuring Parallels Virtuozzo Containers 4.7
vzlmond Configuration File
The /etc/vzlmond.conf file defines the configuration parameters for the vzlmond daemon
used to periodically check and log the state of your Node. The gathered logs can then used by the
vzstatrep utility to generate statistic reports and graphics on their basis and to send these
reports and graphics to the Node administrator's e-mail address(es). Detailed information on the
vzstatrep utility is provided in the vzstatrep subsection (p. 164).
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Name Description Default Value
STATS_VMSTAT_PERIOD The periodicity, in seconds, with which the
vmstat utility is run on the Node and its
output is saved to log files in the directory
specified as the value of the LOGS_DIR
parameter. The vmstat output contains
information on the Node kernel threads,
virtual memory, disks, traps, and CPU activity.
For more information on vmstat, see its man
pages.
480
STATS_FULLDUMP_PERIOD The period, in seconds, at the end of which
the complete statistics on the Node resources
consumption is gathered and logged to the
directory specified as the value of the
LOGS_DIR parameter. As distinct from the
vmstat output, this statistics represents a
snapshot of the files contents from the /proc
directory on the Node and contains
information on virtually every Node resource:
the environment of a certain process, the
state and configuration of the CPU(s), the
number of I/O ports on the Node and their
configuration, etc. Keep in mind that the
amount of disk space needed to store this
information may be considerable (about 0,5
Kb per Container). However, you are
recommended to set the period to no more
than 10 minutes to regularly check and log
the current Node state and resources
consumption.
480
STATS_NET_PERIOD The period, in seconds, after which the Node
network statistics is collected and logged to
the directory specified as the value of the
LOGS_DIR parameter. The network statistics
is gathered separately for each network
interface on the Node (e.g.
eth0
,
eth1
).
480
LOGS_DIR The name of the directory on the Node where
the gathered statistics is to be stored.
/var/log/vzstat
43
Configuring Parallels Virtuozzo Containers 4.7
All the aforementioned parameters are set to their default values during the Parallels Virtuozzo
Containers installation; so, you do not have to additionally edit any parameter in the
/etc/vzlmond.conf file to start gathering your Node statistics.
44
Configuring Parallels Virtuozzo Containers 4.7
vzstat Configuration File
This file (/etc/vzstat.conf) lists a number of CPU-, memory-, and disk-related parameters
used by the vzstat utility. The values assigned to these parameters denote either the warning or
the error level for the vzstat utility to start displaying these parameters either in the yellow color
(the warning level has been hit) or in the red color (the error level has been hit). Moreover, if a
parameter has hit the error level, the CRIT warning is displayed instead of OK after the name of the
corresponding subsystem (CPU, Memory, Swap, Net, or Disks).
The table below provides information on the name and the description of all these parameters, on
whether they denote the warning or the error level, whether the real parameter value has to be
higher or lower than this level in order to invoke an alert, and on the parameters default values:
Parameter Description Default
Value
Alert
When
Alert Type
LOAD_AVG Load average. 30 Higher Warning
PROC_RUN Number of running processes. 20 Higher Warning
PROC_UNINT Number of uninterruptable
processes (in “D” state).
20 Higher Warning
CPU_IDLE CPU idle time, in percent. 10 Lower Warning
CPU_SYS CPU system time, in percent. 50 Higher Warning
CPU_LAT_MAX_WARN Scheduling latency, in milliseconds
(maximum over 5 sec period).
750 Higher Warning
CPU_LAT_MAX_ERR Scheduling latency, in milliseconds
(maximum over 5 sec period).
1000 Higher Error
CPU_LAT_AVG_WARN Scheduling latency, in milliseconds
(5 sec average).
500 Higher Warning
CPU_LAT_AVG_ERR Scheduling latency, in milliseconds
(5 sec average).
750 Higher Error
MEM_LAT_MAX_WARN Memory allocation latency, in
milliseconds (maximum over 5 sec
period).
300 Higher Warning
MEM_LAT_MAX_ERR Memory allocation latency, in
milliseconds (maximum over 5 sec
period).
500 Higher Error
MEM_LAT_AVG_WARN Memory allocation latency, in
milliseconds (5 sec average).
250 Higher Warning
MEM_LAT_AVG_ERR Memory allocation latency, in
milliseconds (5 sec average).
400 Higher Error
MEM_ZONE_ACT_INACT_FREE_WARN Size of available memory (free +
active + inactive pages), in
percent.
8 Lower Warning
MEM_ZONE_ACT_INACT_FREE_ERR Size of available memory (free +
active + inactive pages), in
percent.
4 Lower Error
45
Configuring Parallels Virtuozzo Containers 4.7
MEM_ZONE_ACT_INACT_FREE_ABS_WARN Size of available memory (free +
active + inactive pages), in MB.
4 Lower Warning
MEM_ZONE_ACT_INACT_FREE_ABS_ERR Size of available memory (free +
active + inactive pages), in MB.
2 Lower Error
MEM_ZONE_ORDER_GT_0 Number of pages which are
gathered in blocks with order > 0.
For example, if current memory
distribution looks like: 3*1 1*2 3*4
5*8 .... Then number of pages
with order>0 is 1*2 + 3*4 + 5*8 +
...
100 Lower Warning
SWAP_FREE_WARN Free swap space, in percent. 75 Lower Warning
SWAP_FREE_ERR Free swap space, in percent. 50 Lower Error
SWAP_IN_WARN Swap-in activity, in Mb/sec. 0.5 Higher Warning
SWAP_IN_ERR Swap-in activity, in Mb/sec. 1 Higher Error
SWAP_OUT_WARN Swap-out activity, in Mb/sec. 0.5 Higher Warning
SWAP_OUT_ERR Swap-out activity, in Mb/sec. 1 Higher Error
SWAP_LAT_MAX_WARN Swap-in latency, in milliseconds
(maximum over 5 sec period).
750 Higher Warning
SWAP_LAT_MAX_ERR Swap-in latency, in milliseconds
(maximum over 5 sec period).
1000 Higher Error
SWAP_LAT_AVG_WARN Swap-in latency, in milliseconds (5
sec average).
500 Higher Warning
SWAP_LAT_AVG_ERR Swap-in latency, in milliseconds (5
sec average).
750 Higher Error
DISK_FREE_INODES_WARN Free inodes on the disk, in
percent.
20 Lower Warning
DISK_FREE_INODES_ERR Free inodes on the disk, in
percent.
5 Lower Error
DISK_FREE_SPACE_WARN Free disk space, in percent. 20 Lower Warning
DISK_FREE_SPACE_ERR Free disk space, in percent. 5 Lower Error
CT_FAILCNT_DELTA Number of failed UBC resource
allocations for a particular
Container between vzstat
screen updates (any resource type
counts).
1 Higher Error
46
Configuring Parallels Virtuozzo Containers 4.7
vzrmond Configuration File
This file (/etc/vzrmond.conf) is the configuration file for the vzrmond daemon which is running
on the Monitor Node and provides the remote monitoring of Nodes registered in it and the sending
of alerts to the specified e-mail addresses. It also allows you to use external applications for
sending alerts (e.g. via ICQ or SMS). The file lists a number of parameters some of which have
values that should be provided by the user (from HOSTS through CUSTOM_LIST). These values are
included in double quotes and separated by spaces from each other. The remaining parameters
have default values that may be altered by the user. They are not included in quotes.
Parameter Description Default value
HOSTS The list of hosts to be monitored
delimited by spaces. Both hostnames
and IP addresses are allowed.
“”
EMAIL_ADDRESSES E-mail addresses to receive the alerts.
Must be separated by spaces.
“”
EMAIL_NOTIFICATIONS The types of notifications to be sent to
the specified e-mail address(es).
SYSTEM_UP SYSTEM_DOWN
DISK_OK
DISK_BAD
INODES_NORM
INODES_HIGH
HDDBUSY_NORM
HDDBUSY_HIGH
SSH_UP
SSH_DOWN
VZSTAT_OK
VZSTAT_BAD
LOADAVG_NORM
LOADAVG_HIGH
UNINT_NORM UNINT_HIGH
MEMLATM_NORM
MEMLATM_HIGH
MEMLATA_NORM
MEMLATA_HIGH
CPULATM_NORM
CPULATM_HIGH
CPULATA_NORM
CPULATA_HIGH
SWAPIN_NORM
SWAPIN_HIGH
SWAPOUT_NORM
SWAPOUT_HIGH
CUSTOM_ACTION The program to send alerts of a
customized type (e.g. via ICQ or SMS).
“”
47
Configuring Parallels Virtuozzo Containers 4.7
CUSTOM_LIST Options passed as the command-line
parameters of the program specified by
CUSTOM_ACTION. Must be separated
by spaces.
“”
POLL_PERIOD Periodicity of checking up the registered
Nodes, in seconds.
15
CHK_MAX_FAILS After this number of unsuccessful
attempts to reach a Node, the “Node is
dead” alert is sent.
4
LOAD_AVG The average number of processes on
the Node. When this value is exceeded,
an alert is sent.
30
PROC_UNINT The number of uninterruptable sleeping
processes (in the “D” state). When this
value is exceeded, an alert is sent.
20
CPU_LAT_MAX_ERR The maximal process scheduling
latency, in milliseconds. When this value
is exceeded, an alert is sent.
1000
CPU_LAT_AVG_ERR The average process scheduling
latency, in milliseconds. When this value
is exceeded, an alert is sent.
750
MEM_LAT_MAX_ERR The maximal memory allocation latency,
in milliseconds. When this value is
exceeded, an alert is sent.
500
MEM_LAT_AVG_ERR The average memory allocation latency,
in milliseconds. When this value is
exceeded, an alert is sent.
400
SWAP_IN_ERR The swap in activity, in Mb/s. When this
value is exceeded, an alert is sent.
1.0
SWAP_OUT_ERR The swap out activity, in Mb/s. When
this value is exceeded, an alert is sent.
1.0
DISK_FREE_INODES_ERR The percentage of free disk inodes.
When the actual value becomes less
than this value, an alert is sent.
5
DISK_FREE_SPACE_ERR The percentage of free disk space.
When the actual value becomes less
than this value, an alert is sent.
5
To be able to begin monitoring a Node, you should provide the valid values for the HOSTS and
EMAIL parameters. If you wish to use an external program for sending alerts about the Node state,
you should install in on the Monitor Node and provide its name and options in the
CUSTOM_ACTION and CUSTOM_LIST parameters. The alert message text will be sent as the
standard input for the specified program.
You should increase the value of the POLL_PERIOD parameter together with the increase in the
number of monitored Nodes not to create an overload on the Monitor Node. The parameters
related to the scheduling latency, memory allocation latency, and swap in/out activity serve to have
an alert generated if the system’s performance plummets due to the abnormal values of these
parameters.
48
Configuring Parallels Virtuozzo Containers 4.7
Do not forget to restart the vzrmond daemon after you have edited this configuration file.
49
Configuring Parallels Virtuozzo Containers 4.7
vzstatrep Configuration File
The vzstatrep.conf configuration file located in the /etc directory on the Monitor Node is
used by the vzstatrep utility while trying to generate statistic reports and graphics on the Node
resource consumption and to send them to your e-mail address. This file has a number of lines in
the following format:
<parameter_name>="parameter_value"
Below is a list of available parameters:
Name Description
NODES The IP address or hostname of the Node whose logs are to be analyzed. You
can set several Nodes for being processed with the help of the vzstatrep
utility and separate them by spaces. If no Node is specified, the logs of the local
server (i.e. of the Monitor Node itself) are analyzed.
STATS_EMAIL The e-mail address to send the generated statistic reports and graphics to. You
can specify several e-mail addresses and separate them by commas or spaces.
GNUPLOT The path to the gnuplot utility on the Monitor Node. By default, the utility is
located in the /usr/bin directory; however, you may specify another directory
for its location (e.g. /etc/mydir/gnuplot). gnuplot is used by the
vzstatrep utility to present the Node resources consumption in the graphical
form. The resources whose graphics are to be generated should be set as the
values of the STATS_PLOT parameter. For detailed information on the gnuplot
utility, see its man pages.
MUTT The path to the mutt utility on the Monitor Node. By default, the utility is located
in the /usr/bin directory; however, you may specify another directory for its
location (e.g. /etc/mydir/mutt). mutt is used by the vzstatrep utility to
send the generated statistic reports and graphics in the form of attached files via
e-mail. For detailed information on the
mutt
utility, see its man pages.
LOGS_DIR The path to the directory on the Node where vzstatrep will search for the logs
generated by the vzlmond daemon and containing the information on the Node
resources consumption. By default, the /var/log/vzstat directory is used. If
you have changed the directory where vzlmond stores the gathered
information, you should specify the full path to this directory as the value of this
parameter (e.g. LOGS_DIR=/my_logs/vzstat).
STATS_PLOT Specify the resources parameters whose graphics are to be generated by means
of the gnuplot utility. You can specify several resources and separate them by
spaces. Currently, you can create graphics for the following parameters:
ve_sum: the information on the CPU usage for all Containers on the
Node.
ve_top: the information on the CPU usage for 5 Containers with
the highest CPU consumption.
loadavg: the average number of active processes for the past 1, 5,
and 15 minutes. Active processes can be running, i.e. currently
executed by the CPU, or runnable, i.e. waiting in the run queue for
the CPU.
io
: the amount of data read from and written to all devices on the
50
Configuring Parallels Virtuozzo Containers 4.7
Node, in kilobytes per second.
mem: the total memory consumption on the Node.
ints: the number of interrupts and context switches on the Node
per second.
cpu: the information on the CPU load on the Node.
net: the network information for each network interface on the
Node.
forks: the number of copies of all processes made on the Node
during one second.
By default, all the aforementioned resources except for ve_sum are plotted.
To start analyzing the logs, creating the Node statistic reports and graphics, and receiving e-mail
messages with these reports and graphics, you should specify the NODES and STATS_EMAIL
parameters in the /etc/vzstatrep.conf file. All the other parameters are automatically set
during the vzrmon package installation on the Monitor Node.
51
Configuring Parallels Virtuozzo Containers 4.7
Backup Configuration File
This file (/etc/vzbackup.conf) is in the same format as the global Parallels Virtuozzo
Containers configuration file and per-Container configuration files. All the parameters define the
global backup settings, but some of them may be overridden by the per-Node configuration file, if
the latter exists. Still, other parameters may be further overridden in the configuration file of a
particular Container.
All-Node parameters:
Parameter Description Default value
BACKUP_DIR The backup directory, i.e. the directory where
backups are stored.
/vz/backup
BACKUP_TYPE The backup type. Among the supported types are
"plain full (F)", "full (I)", and "incremental (i)". The
default is incremental. If it is impossible to do an
"incremental" backup, a "full" backup will be made.
i
BACKUP_NODES The hostname of the Node whose Containers are
to be backed up. You can specify several
hostnames of your Nodes and separate them by
spaces. If you wish to back up Containers residing
on the Backup Node itself, you should specify its
hostname as the value of this parameter.
BACKUP_MAX_CHLD The maximal number of Nodes to back up in
parallel for non-periodic backups.
1
BACKUP_MAX_CHLD_CRON The maximal number of Nodes to back up in
parallel for periodic backups.
3
BACKUP_NOTIFY_EMAIL The e-mail addresses where to send notifications
about the backing up.
BACKUP_COMPRESS Specifies whether the Containers are to be
compressed when being backed up, and with what
compression algorithm. When backing up
Containers residing on Parallels Virtuozzo
Containers 4.7 Hardware Nodes, you can set this
option to one of the following values:
C0: in this case the Container backup is
created without any compression. Using
this level of compression, you may greatly
reduce the backup creation time;
however, the size of the resulting backup
file may significantly increase as compared
to other compression levels.
C1: in this case the Container backup is
created with a normal level of
compression.
C2: in this case the Container backup is
created with the high level of
compression. The size of the resulting
none
52
Configuring Parallels Virtuozzo Containers 4.7
backup file is smaller than that of the
backup file compressed in the 'normal'
and 'none' modes; however, it takes
longer to create the backup file.
C3: in this case the Container backup is
created with the maximal level of
compression. The size of the resulting
backup file is the smallest and the time of
the backup creation - the longest.
CRON_BACKUP Specifies whether the backing up is performed as a
cron job. If set to "yes", the values of the
BACKUP_KEEP_MAX and BACKUP_LOADAVG_MAX
parameters in the given file are taken into
consideration. This parameter can be overridden by
the -p or -j command line switch of the
vzbackup utility.
no
Per-Node parameters:
Parameter Description Default value
BACKUP_SSH_OPTS Options which are passed to ssh when it is used.
On Parallels Virtuozzo Containers 4.7 Hardware
Nodes, this option is relevant only for the vzbackup
and vzrestore utilities when they are run in the
compatibility mode.
-c blowfish
BACKUP_VESTOP Defines whether the Containers are to be stopped
before their backing up. If set to –s, the Containers are
stopped by default, otherwise, they are not stopped.
On Parallels Virtuozzo Containers 4.7 Hardware
Nodes, this option is relevant only for the vzbackup
and vzrestore utilities when they are run in the
compatibility mode.
BACKUP_EXCL_VES Defines those Containers that are to be excluded from
the backup list. Container IDs must be given here.
BACKUP_LOADAVG_MAX The maximal loadavg with which backing up is
allowed. This parameter is effective only if the -p
option is specified with the vzbackup utility.
On Parallels Virtuozzo Containers 4.7 Hardware
Nodes, this option is relevant only for the vzbackup
and vzrestore utilities when they are run in the
compatibility mode.
10
BACKUP_FINISH_TIME The time when the backing up should be stopped and
delayed until the next execution, e.g. when running
backup scripts at 4am, one can require the backup to
be finished before 7am. The backup will continue from
the last Container at the next execution. The format is:
"HH:MM". This parameter is effective only if the -L
option is specified with the
vzbackup
utility.
none
BACKUP_LIMIT_TIME The number of hours after which the backing up
should be stopped and delayed until the next
none
53
Configuring Parallels Virtuozzo Containers 4.7
execution. The format is: "
HH
". This parameter is
effective only if the -L option is specified with the
vzbackup
utility.
Per-Container parameters
Parameter Description Default Value
BACKUP_CHAIN_LEN An incremental backup parameter. After this
number of incremental backups, a full
backup is performed.
On Parallels Virtuozzo Containers 4.7
Hardware Nodes, this option is relevant only
for the vzbackup and vzrestore utilities
when they are run in the compatibility mode.
7
BACKUP_CHAIN_DAYS An incremental backup parameter. After this
number of days a full backup is performed.
On Parallels Virtuozzo Containers 4.7
Hardware Nodes, this option is relevant only
for the vzbackup and vzrestore utilities
when they are run in the compatibility mode.
7
BACKUP_KEEP_MAX The number of backups to store. Only full
and plain full backups are accounted. If a
regular backup is being performed that
exceeds this number, the oldest backup is
automatically deleted. This parameter is
effective only if the -p option is specified with
the vzbackup utility. If there is no -p option,
the number of backups to store is not limited
whatever the value of this parameter.
On Parallels Virtuozzo Containers 4.7
Hardware Nodes, this option is relevant only
for the vzbackup and vzrestore utilities
when they are run in the compatibility mode.
3
If you want to rewrite the per-Node parameters for a particular Hardware Node, you should create
a new configuration file named <node>.conf and put it to the backup directory (defined by the
BACKUP_DIR parameter in the global backup configuration file.
54
Configuring Parallels Virtuozzo Containers 4.7
vzrhnproxy Configuration File
This file (/etc/vz/pkgproxy/rhn.conf) is the configuration file for vzrhnproxy - a special
utility which can be used on any RHEL-based server (e.g. RHEL 4 or 5, Fedora Core 5 or , CentOS
4 or 5) to create RHN (Red Hat Network) Proxy Servers allowing you to effectively manage the RPM
packages included in the RHEL 4 and 5 OS EZ templates.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Name Description
REDHAT_LOGIN The user name for logging in to Red Hat Network.
REDHAT_PASSWORD The password of the user specified as the value of the REDHAT_LOGIN
parameter.
HTTP_PROXY The hostname or the IP address and the port number of the HTTP proxy
server, if you use any to connect to the Internet.
HTTP_PROXY_USER The user name used by the HTTP proxy server for your authentication.
HTTP_PROXY_PASSWORD The password of the user specified in the HTTP_PROXY_USER
parameter and used for your authentication by the HTTP proxy server.
EMAIL The destination of all tracebacks.
PRE_DOWNLOAD The names of the packages to be downloaded when running the
vzrhnproxy update command. The names of the packages listed as
the value of this parameter should correspond to the names of real
packages in the RHEL repository in Red Hat Network and can be
specified as regular expressions (e.g. perl.*).
55
Configuring Parallels Virtuozzo Containers 4.7
vzpkgproxy Configuration File
This file (/etc/vzpkgproxy/vzpkgproxy.conf) is the configuration file for vzpkgproxy - a
special utility which can be used to create special caching proxy servers allowing you to efficiently
manage your OS and application EZ templates.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Name Description
REPO_DIR The path to the directory on the proxy server where the local repository created
on the basis of the cached packages is to be stored.
By default, this directory has the path of /var/www/html/download.
CACHE_DISABLE The IP addresses of the hosts to be excluded from the caching process. It
means that the packages requested by Nodes and received from these hosts
will not be cached on the proxy server.
By default, the proxy server is configured to cache all packages from all hosts
on external networks.
56
Configuring Parallels Virtuozzo Containers 4.7
vztt Configuration File
This file (/etc/vztt/vztt.conf) is the configuration file used by the vzpkg utility when
managing OS and application EZ templates.
The parameters in this file are presented on separate lines in the following format:
<parameter_name>=<parameter_value>
The table below describes these parameters:
Parameter Name Description
VZTT_PROXY The IP address or hostname of the caching proxy server to be used by the
vzpkg tool for managing OS and application EZ templates.
HTTP_PROXY The IP address or hostname of the HTPP proxy server address, if you use
this server.
HTTP_PROXY_USER The user name used by the HTTP proxy server for your authentication.
HTTP_PROXY_PASSWORD The password of the user specified in the HTPP_PROXY_USER parameter
and used for your authentication by the HTTP proxy server.
METADATA_EXPIRE Defines the period of time, in seconds, in the course of which the
downloaded software packages in the vzpkg cache are regarded as 'not
obsolete'. During this time, the vzpkg utility searches for the EZ template
packages in the local cache only (without checking the remote repositories
set for EZ templates). By default, this period is set to 86400 seconds (24
hours).
EXCLUDE List of comma-separated packages that are not to be installed or updated
during the vzpkg execution. The package names should correspond to
the name of real packages in the repository and can contain file globs (e.g.
*
and
?
).
Managing Parallels Virtuozzo Containers Scripts
This section provides information on Parallels Virtuozzo Containers scripts used to automate and
perform some operations and procedures within your system.
57
Configuring Parallels Virtuozzo Containers 4.7
Overview
Along with Parallels Virtuozzo Containers configuration files responsible for the Parallels Virtuozzo
Containers system configuration, there are a number of scripts allowing you to customize the
Container behavior in different ways. These are the following scripts:
Script Name Description
/vz/private/<CT_ID>/scripts/<ac
tion>
Container private action scripts. These scripts allow to run
user-defined actions on particular events. The currently defined
actions are start, stop, mount, unmount.
/etc/vz/conf/dists/scripts/
<script>
Scripts to be executed on performing certain Container-related
operations (e.g. on adding a new IP address to the Container).
These operations should be specified in the corresponding
Linux distribution configuration file.
/usr/sbin/vzagent_ctl The Parallels Agent start/stop script.
/etc/rc.d/init.d/srvcontrol The Parallels Agent start/stop script; it runs inside the Service
Container.
/etc/rc.d/init.d/vz The Parallels Virtuozzo Containers start/stop script. This script
is responsible for proper Parallels Virtuozzo Containers startup
and shutdown procedures, including Parallels Virtuozzo
Containers modules loading and Container start/stop
procedures.
58
Configuring Parallels Virtuozzo Containers 4.7
Parallels Virtuozzo Containers Action Scripts
There might be situations when you need to do additional actions when a particular Container is
started or stopped. For example, if you want to be able to access the Node file system (or part of it)
from Container 101, then you can bind mount it inside the Container manually from the Node.
However, after you restart the Container, your mount disappears, and you should manually type the
mount command again.
Parallels Virtuozzo Containers allows you to automate procedures like the above by using
Parallels Virtuozzo Containers action scripts. There are six action scripts defined in the
current version of Parallels Virtuozzo Containers:
global
mount
This script runs immediately after vzctl mounts the Container private area. The Container itself
is not yet running and the script is running in the Node context.
mount This script runs immediately after the global mount script. The Container is still not running, and
the scripts is called in the Node context.
start After vzctl has started a Container, it runs the Container start script. The script is running
already in the Container context.
stop This script runs before the Container is stopped, in the Container context.
umount After the Container has been already stopped, the umount script is executed, and the script
runs in the Node context.
global
umount
This script runs when vzctl is about to dismount the Container private area. It also runs in the
Nodecontext.
It is important to understand how vzctl handles exit codes of action scripts. If exit code is non-
zero, then vzctl will try to undo the action for the mount and start scripts. In other words, if the
start script returns an error, then vzctl will stop Container, and if one of the mount scripts fails,
then vzctl will dismount the Container private area. Please note that in this case vzctl will not
execute the stop and umount scripts at all.
Caution: When executing vzctl start, both mount and start scripts run. However, if the start
script fails then neither stop nor umount scripts will run. As a result, vzctl might be unable to
dismount the Container private area, if you set up additional mounts in the mount scripts and dismount
them in the umount scripts.
The situation with the umount and stop scripts is similar. If a script returns an error, then the action will
not be taken. Be careful since this allows to create Containers that are not stoppable by vzctl.
The global scripts are named vps.mount and vps.umount and located in the /etc/vz/conf
directory on the Node. These scripts are called when any Container on the Node is started or
stopped. So, you should include in these scripts those commands that are common for all
Containers and leave Container-specific commands for the scripts belonging to a particular
Container. Container-specific action scripts are located in the /vz/private/CT_ID/scripts
directory and have the mount, start, stop, and umount names. For example, the scripts
specific for Container 101 will have the following names:
59
Configuring Parallels Virtuozzo Containers 4.7
/vz/private/101/scripts/mount
/vz/private/101/scripts/start
/vz/private/101/scripts/stop
/vz/private/101/scripts/umount
For the mount and umount scripts, the environment passed is the standard environment of the
parent (i.e. vzctl) with two additional variables: $VEID and $VE_CONFFILE. The first one holds
the ID of the Container being mounted (started, stopped, dismounted), and the second one holds
the full path to the Container configuration file. It is probably a bit redundant. Parallels introduced
both variables for convenience. You can use the following fragment of the code in bash scripts to
get access to additional Container information like $VE_PRIVATE or $VE_ROOT locations:
#!/bin/bash
#
# This script sources Container configuration files in the same
# order as vzctl does
# if one of these files does not exist then something is
# really broken
[ -f /etc/sysconfig/vz ] || exit 1
[ -f $VE_CONFFILE ] || exit 1
# source both files. Note the order, it is important
. /etc/vz/vz.conf
. $VE_CONFFILE
The start and stop scripts are performed in the Container context. If these scripts call any
external commands, these commands are taken from the Container itself. Also note that the
start script runs before any Container tasks (including init), thus the /proc file system is not
mounted inside the Container at this moment therefore, applications using an information from
/proc may be not functional.
Parallels Virtuozzo Containers is shipped with a number of command line tools. This chapter
documents the utilities, which are supported in Parallels Virtuozzo Containers. For every utility, all
available command-line options and switches are described.
In This Chapter
Matrix of Parallels Virtuozzo Containers Command Line Utilities ............................... 61
vzctl ....................................................................................................................... 64
vzlist ...................................................................................................................... 83
vzquota .................................................................................................................. 89
Licensing Utilities .................................................................................................... 94
Migration Utilities .................................................................................................... 97
Backing-Up Utilities ................................................................................................ 102
EZ Template Management Utilities .......................................................................... 108
Supplementary Tools .............................................................................................. 137
CHAPTER 3
Parallels Virtuozzo Containers Command-
Line Interface
61
Parallels Virtuozzo Containers Command-Line Interface
Matrix of Parallels Virtuozzo Containers
Command Line Utilities
The table below contains the full list of Parallels Virtuozzo Containers command-line utilities.
General utilities are intended for performing day-to-day maintenance tasks:
vzctl Utility to control Containers.
vzlist Utility to view a list of Containers existing on the Node with additional information.
vzquota Utility to control Parallels Virtuozzo Containers disk quotas.
Licensing utilities allow you to install a new license, view the license state, generate a license
request for a new license:
vzlicview Utility to display the Parallels Virtuozzo Containers license status and parameters.
vzlicload Utility to manage Parallels Virtuozzo Containers licenses on the Node.
vzlicupdate Utility to activate the Parallels Virtuozzo Containers installation,
update the Parallels Virtuozzo Containers licenses installed on the
Node, or transfer the Parallels Virtuozzo Containers license from
the Source Node to the Destination Node.
Container migration tools allow to migrate Containers between Nodes or within one Node:
vzmigrate Utility for migrating Containers from one Node to another.
vzmlocal Utility for the local cloning or moving of the Containers.
vzp2v Utility to migrate a physical server to a Container on the Node.
Container backup utilities allow to back up and restore the Container private areas, configuration
files, action scripts, and quota information:
vzbackup Utility to back up Containers.
vzrestore Utility to restore backed up Containers.
vzabackup Utility to back up Nodes and their Containers. As distinct from vzbackup, this
utility requires the Parallels Agent software for its functioning.
vzarestore Utility to restore backed up Nodes and Containers. As distinct from vzrestore,
this utility requires the Parallels Agent software for its functioning.
Template management tools allow the template creation, maintenance and installation of
applications into a Container:
vzpkg Utility to manage OS and application EZ templates either inside your Containers
or on the Hardware Node itself.
vzmktmpl Utility to create OS and application EZ templates.
vzveconvert Utility to convert Containers based on standard templates to EZ template-based
Containers.
62
Parallels Virtuozzo Containers Command-Line Interface
vzpkgproxy Utility to create caching proxy servers for handling OS and application EZ
templates.
vzrhnproxy Utility to create RHN proxy servers for handling the packages included in the
RHEL 4 and RHEL 5 OS EZ templates.
vzpkgls Utility to get a list of templates available on the Hardware Node and in Containers.
vzpkginfo Utility to get the information on any template installed on the Hardware Node.
vzpkgcreat Create a new package set from binary RPM or DEB files.
vzpkgadd Utility to add a new template to a Container.
vzpkglink Utility to replace real files inside a Container with symlinks to these very files on
the Node.
vzpkgrm Utility to remove a template from a Container.
vzpkgcache Update a set of preinstalled Container archives after new template installation.
Supplementary tools perform a number of miscellaneous tasks in the Hardware Node and
Container context:
vzup2date Utility to update your Parallels Virtuozzo Containers software and templates.
vzup2date-mirror Utility to create local mirrors of the Parallels Virtuozzo Containers official
repository.
vzfsutil Utility for the VZFS optimization and consistency checking.
vzcache Utility to gain extra disk space by caching the files identical in different
Containers.
vzsveinstall Utility to create the Service Container on the Hardware Node.
vzsveupgrade Utility to update the packages inside the Service Container.
vzps and vztop Utilities working as the standard ps and top utilities, with Container-related
functionality added.
vzsetxinetd Utility to switch some services between a standalone and xinetd-dependent
modes.
vzdqcheck Print file space current usage from quota’s point of view.
vzdqdump and
vzdqload
Utilities to dump the Container user/group quota limits and grace times from the
kernel or the quota file or for loading them to a quota file.
vznetstat Utility that prints network traffic usage statistic by Containers.
vzcpucheck Utility for checking CPU utilization by Containers.
vzmemcheck Utility for checking the Hardware Node and Container current memory
parameters.
vzcalc Utility to calculate resource usage by a Container.
vzcheckovr Utility to check the current system overcommitment and safety of the total
resource control settings.
vzstat Utility to monitor the Hardware Node and Container resources consumption in
real time.
vzpid Utility that prints Container id the process belongs to.
vzsplit Utility to generate Container configuration file sample, “splitting” the Hardware
Node into equal parts.
63
Parallels Virtuozzo Containers Command-Line Interface
vzcfgscale Utility to scale the Container configuration.
vzcfgvalidate Utility to validate Container configuration file correctness.
vzstatrep Utility to analyze the logs collected by vzlmond and to generate statistics
reports on the basis of these logs (in the text and graphical form).
vzreport Utility to draw up a problem report and to automatically send it to the Parallels
support team.
vzhwcalc Utility to scan the main resources on any Linux server and create a file where
this information will be specified.
vzveconvert Utility to convert the Containers based on Parallels standard OS templates to the
EZ template-based ones.
vznetcfg Utility to manage network devices on the Hardware Node.
vzmtemplate Utility to migrate the installed OS and application templates from the one
Hardware Node to another.
64
Parallels Virtuozzo Containers Command-Line Interface
vzctl
vzctl is the primary tool for Container management. To use it, you have to log in to the Node as
the root user. The syntax of vzctl is:
vzctl [--quiet | --verbose] command CT_ID
vzctl --version
vzctl --help
Where command can be one of the following:
create Creates a new Container.
delete
destroy
Deletes a Container.
mount Mounts the Container private area and executes the Container mount script.
umount Unmounts the Container private area and executes the unmount script.
start Starts a Container.
stop Stops a Container.
restart Restarts a Container.
status Displays the Container status.
set Sets Container parameters: resource control settings, hostname, IP addresses, and so
on.
unset Removes Container parameters (resource control settings, IP addresses, and so on)
from the configuration file.
enter Logs in to a Container without knowing its root password.
exec
exec2
Runs arbitrary commands in a Container without logging in to it.
recover
reinstall
Recovers the original state of the Container system and application files.
quotaon Turns the disk quota on for a Container.
quotaoff Turns the disk quota off for a Container.
quotainit Initializes the disk quota for a Container with the parameters taken from the Container
configuration file.
suspend Saves the state of a running Container in a dump file.
resume Restores a Container from its dump file.
convert Converts legacy Containers to support the new Parallels Virtuozzo Containers directory
layout.
runscript Runs shell scripts in a Container.
Verbosity options can be used with any of the above commands:
--verbose
Sets the log level to its maximum possible value.
65
Parallels Virtuozzo Containers Command-Line Interface
--quiet Disables logging to the screen and to the log file.
You can also pass to vzctl one of the following options:
--version Displays the vzctl package version currently installed on the Node.
--help Displays the usage information about
vzctl
.
66
Parallels Virtuozzo Containers Command-Line Interface
vzctl create
This command is used to create a new Container. It has the following syntax:
vzctl create <CT_ID> {--pkgset name [--pkgver ver] | [--ostemplate name]}
[options]
With this command, you can create regular Containers. A unique Container ID is required for this
command.
Note: Container IDs from 1 to 100 are reserved for internal Parallels Virtuozzo Containers needs. Do not
use IDs from 1 to 100 for Containers.
Command options are as follows:
--ostemplate name OS EZ template to use for creating the Container. If omitted, this value is
taken from the DEF_OSTEMPLATE parameter in the global Parallels
Virtuozzo Containers configuration file.
--config name Container sample configuration file to use for creating the Container.
Sample configuration files are located in /etc/vz/conf and have
names in the format ve-<name>.conf-sample. The sample
configuration files usually have a number of resource control limits for the
Container and some application templates to be added to the Container
immediately upon its creation. If you skip this option and the default
configuration file name is not specified in the global Parallels Virtuozzo
Containers configuration file, you will have to set resource control
parameters for the Container using the
vzctl set
command.
--private path Path to the Container private area. This option is used to override default
path to private area from the /etc/vz/vz.conf configuration file
(VE_PRIVATE variable). The argument can contain $VEID string which
will be replaced by numeric Container ID value.
--root path Path to the mount point of the Container root directory. This option is
used to override default path to Container root directory from the
/etc/vz/vz.conf configuration file (VE_ROOT variable). The argument
can contain $VEID string which will be replaced by numeric Container ID
value.
--ipadd addr[/mask] IP address and subnet mask to assign to the Container. If you omit this
option, you can set an IP address for the Container later using the
vzctl
set
command.
--hostname name Hostname to assign to the Container. If you omit this option, you can
assign a hostname to the Container later using the vzctl set
command.
--name name Name to assign to the Container. Like IDs, names can be used to
perform Container-related operations.
--description desc Container description. You cat type any text you consider reasonable. If
the text contains space characters, enclose in in quotation marks.
--skip_app_templates Do not install the application templates specified in the Container sample
configuration file.
--pkgset name OS standard template to use for creating the Container. If omitted, this
value is taken from the global Parallels Virtuozzo Containers configuration
67
Parallels Virtuozzo Containers Command-Line Interface
file.
--pkgver ver Particular version of OS standard template. If omitted, the latest available
version is used.
vzctl delete and vzctl destroy
These commands are used to delete a Container, which is no longer needed, from the Node. The
syntax of the commands is as follows:
vzctl delete <CT_ID>
vzctl destroy <CT_ID>
When executed, vzctl delete/vzctl destroy physically removes all the files located in the
Container private area (specified as the VE_PRIVATE variable in the Container configuration file)
and renames the Container configuration file in /etc/vz/conf from <CT_ID>.conf to
<CT_ID>.conf.destroyed. It also renames Container action scripts, if any, in a similar manner.
These commands do not take any additional arguments and requires the Container to be stopped
and its private area to be dismounted.
vzctl mount and vzctl umount
These commands take no additional arguments:
vzctl mount <CT_ID>
vzctl umount <CT_ID>
The first command mounts the Container private area to the Container root directory
(/vz/root/<CT_ID> on the Node) without starting it. Normally, you do not have to use this
command as the vzctl start command mounts the Container private area automatically.
The vzctl umount command unmounts the Container private area. Usually, there is no need in
using this command either because vzctl stop unmounts the Container private area
automatically.
68
Parallels Virtuozzo Containers Command-Line Interface
vzctl start, vzctl stop, vzctl restart, and vzctl status
These four commands have the same syntax and take no obligatory arguments:
vzctl start <CT_ID|name> [--wait]
vzctl stop <CT_ID|name> [--fast]
vzctl restart <CT_ID|name>
vzctl status <CT_ID|name>
The first command is used to start a Container. It will set up all network interfaces inside the
Container, initialize the Container quota, if needed, start the init process inside the Container,
and exit. You can also make the vzctl start command wait for all the necessary startup
processes to complete and the Container to boot into the default runlevel by passing the --wait
option to this command.
When starting a Container, vzctl executes a number of helper scripts located in the
/vz/private/<CT_ID>/scripts (the first and last scripts in the table) and /etc/vz/conf (all
the other scripts in the table) directories, namely (in the order of execution):
mount Optional Container mount script. If it exists, then it is executed immediately after
mounting the Container private area. If it exits with a non-zero status, then vzctl
dismounts the Container private area and returns the error.
vz-start This script sets up IP traffic accounting for the Container.
vz-net_add This script creates the necessary ARP entries and sets up the necessary routing
entries for Container IP addresses.
ve-alias_add This script configures the network interfaces inside the Container.
ve-veconfig This script is called by vzctl to set a hostname and DNS search domains inside
the Container.
ve-quota If the second-level (per user/group) quota is turned on, then vzctl calls this script
to form the correct /etc/mtab file inside the Container.
start Optional Container start script. If it exists, then it is executed in the context of a just
started Container.
vzctl stop shuts the Container down. If the Container is not down after a two-minute timeout
due to an error in an application, for example, vzctl will forcibly kill all the processes inside the
Container. To avoid waiting for two minutes in case of a corrupted Container, you may use the --
fast option with this command. The normal shutdown sequence of vzctl stop is described
below in the order of execution:
stop Optional Container stop script. If it exists, then it is executed in the context of the
Container prior to any other actions. If it exits with non-zero status, then vzctl
does not stop the Container.
umount Optional Container unmount script. If it exists, then it is executed after stopping the
Container but before dismounting its private area.
vz-stop This script deletes routing and IP traffic accounting for the Container.
69
Parallels Virtuozzo Containers Command-Line Interface
You should use action scripts (mount/umount and start/stop) if you would like to carry out
some actions upon the Container startup/shutdown. However, there might be situations when you
have to modify other scripts documented above. In this case it is strongly suggested that you
create a separate script containing all your modifications and add an invocation of this script to
shipped scripts. This will facilitate upgrades to future Parallels Virtuozzo Containers versions.
The vzctl restart <CT_ID> command consecutively performs the stopping and starting of
the corresponding Container.
The vzctl status command shows the current Container state. It outputs the following
information: whether the Container private area exists, whether it is mounted and whether the
Container is running as in the example below:
# vzctl status 101
VEID 101 exist mounted running
70
Parallels Virtuozzo Containers Command-Line Interface
vzctl set
This command is used for setting Container parameters. It has the following syntax:
vzctl set <CT_ID> <option> <value> [--save]
An optional –-save switch, if specified, tells vzctl to save changes into the Container
configuration file /etc/vz/conf/<CT_ID>.conf. Practically all Container settings can be
changed dynamically without the necessity to reboot the Container. The exceptions are –-
onboot, –-quotaugidnum, --capability, --private, and --root.
The options specified in this file can be subdivided into the following categories: miscellaneous,
networking, and resource management parameters.
Note: In Parallels Virtuozzo Containers, you can also use the vzctl set command to specify a number
of parameters for the Node itself. Currently, these parameters include: --cpuunits, --numproc, --
numtcpsock, --numothersock, --vmguarpages, --kmemsize, --tcpsndbuf, --tcprcvbuf,-
-othersockbuf, --dgramrcvbuf, --oomguarpages, --lockedpages, --shmpages, --
privvmpages, --numfile, --numflock, --numpty, --numsiginfo, and --dcachesize. Any of
these parameters can be set by indicating 0 as the value of <CT_ID>.
Miscellaneous options:
--onboot yes|no This setting requires the –-save switch. If you set it to
“yes” than Parallels Virtuozzo Containers will
automatically start this Container on next system startup.
Note: If "yes" is specified as the value of this
parameter in the 0.conf file, all Node system
management parameters are set on the Node
boot to the values indicated in this file.
--offline_management yes|no Enabling/disabling the direct managing of the Container
through a common Internet browser by means of
Parallels Power Panels and the Plesk control panel (as
defined by the OFFLINE_SERVICE parameter in the
global or Container configuration file).
--offline_service service_name Defines whether the Container can be managed by
means of Parallels Power Panel or Plesk or both. Valid
only if the OFFLINE_MANAGEMENT parameter is set to
"yes". The names of the available services can be taken
from the file names (excluding the .conf extension) in
the
/etc/vzredirect.d
directory on the Node.
--userpasswd user:password This setting creates a new user with the specified
password in the Container, or changes the password of
an already existing user. This command modifies not the
Container configuration file, but the /etc/passwd and
/etc/shadow files inside the Container. In case the
Container root is not mounted, it is automatically
mounted to apply the changes and then unmounted.
71
Parallels Virtuozzo Containers Command-Line Interface
--noatime yes|no Sets the noatime flag (do not update inode access
times) on the Container file system. The default is yes for
a Class 1 Container, and
no
otherwise.
--devnodes device:r|w|rw|none Lets the Container access the specified devices in the
specified mode - read-only, write-only, or read-write - or
denies any access.
For example: --devnodes hda1:rw
The device must be present in the Container /dev
directory, otherwise, a new device is automatically
created.
--netdev_add name Moves the specified network device from the Node to the
Container.
For example: --netdev_add eth0
--netdev_del name Moves the specified network device from the given
Container to the Node.
--capability name:on|off Specifies capabilities inside the Container. Setting the
following capabilities is allowed: AC_OVERRIDE,
AC_READ_SEARCH, CHOWN, FOWNER, FSETID,
IPC_LOCK, IPC_OWNER, KILL, LEASE,
LINUX_IMMUTABLE, MKNOD, NET_ADMIN,
NET_BIND_SERVICE, NET_BROADCAST, NET_RAW,
SETGID, SETPCAP, SETUID, SYS_ADMIN, SYS_BOOT,
SYS_CHROOT, SYS_MODULE, SYS_NICE, SYS_PACCT,
SYS_PTRACE, SYS_RAWIO, SYS_RESOURCE,
SYS_TIME
,
SYS_TTY_CONFIG
.
--features name:on|off Enables/disables the support for the following
functionality inside the Container:
nfs: mounting NFS shares
ipip: creating IPIP tunnels
sit: using the Simple Internet Transition (SIT)
mechanisms
ppp: using the PPP protocol
ipgre: creating IP-GRE tunnels
bridge: using bridges to connect virtual
Ethernet devices
nfsd
: running an NFS-kernel-space server
--root path
This setting does NOT move the root mount point of your
Container to a new path. It simply overrides the
VE_ROOT
parameter in the Container configuration file.
--private path This setting does NOT move the private area of your
Container to a new path. It simply overrides the
VE_PRIVATE parameter in the Container configuration
file. You should use this option only if you have manually
moved the Container private area to a new place and
want to update the Container configuration file.
72
Parallels Virtuozzo Containers Command-Line Interface
--setmode restart|ignore This option tells the utility either to restart or not restart
the Container after applying any parameters requiring
that the Container be rebooted for them to take effect.
--disabled yes|no If set to yes, disables the Container making it impossible
to start the Container once it was stopped. The disabled
Container can be started by passing the --force
option to
vzctl set
.
--name An arbitrary name assigned to the Container. This name
can be used, along with the Container ID, to refer to the
Container while performing certain Container-related
operations on the Node. Follow the following rules while
specifying the Container name:
The name should contain the A-Z, a-z, 0-9,
\, -, and _ symbols only.
If the name consists of two or more words, it
should be quoted (e.g. "My Container 101").
--description This option allows you to set the description for the
Container.
Note: You are allowed to use only symbols in
the 'A -z' and '0-9' ranges in your descriptions.
--bindmount_add
[src:]dst[,nosuid,noexec,nodev]
Mounts a source directory (src) located on the Node to
a destination directory (dst) inside the Container. If the
source directory is not specified, mounts the directory to
the /vz/root/CT_ID directory.
Additional options that can be used with --
bindmount_add are the following:
noexec. Do not allow execution of any
binaries on the mounted directory.
nodev. Do not interpret character or block
special devices on the mounted directory.
nosuid. Do not allow set-user-identifier or set-
group-identifier bits to take effect.
--bindmount_del dst|all Removes the mount point created by using the --
bindmount_add option from the Container.
Resource management settings control the amount of resources a Container can consume. If the
setting has bar:lim after it than this setting requires specifying both barrier and limit values
separated by colons.
--applyconfig name This option lets you set the resource parameters for the
Container not one by one, but by reading them from the
Container sample configuration file. All Container sample
configuration files are located in the /etc/vz/conf
directory and are named according to the following pattern:
ve-<name>.conf-sample, so you should specify only
the <name> part of the corresponding sample name after
the
--applyconfig
option. Note that the names of
73
Parallels Virtuozzo Containers Command-Line Interface
sample configuration files cannot contain spaces. The
--
applyconfig option applies all the parameters from the
specified sample file to the given Container, except for the
OSTEMPLATE, TEMPLATES, VE_ROOT, VE_PRIVATE,
HOSTNAME, IP_ADDRESS, TEMPLATE, NETIF parameters
(if they exist in the configuration sample file).
-p, --numproc bar:lim Number of processes and threads allowed. Upon hitting
this limit, the Container will not be able to start new process
or thread. In this version of Parallels Virtuozzo Containers,
the limit shall be set to the same value as the barrier.
--numtcpsock bar:lim 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. In this version of Parallels Virtuozzo
Containers, the limit shall be set to the same value as the
barrier.
--numothersock bar:lim 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. In this version of Parallels Virtuozzo
Containers, the limit shall be set to the same value as the
barrier.
-e, --numiptent bar:lim Number of IP packet filtering entries.
--vmguarpages bar:lim 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. In
this version of Parallels Virtuozzo Containers, the limit shall
be set to the same value as the barrier.
-k, --kmemsize bar:lim 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.
--tcpsndbuf bar:lim 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.
-b, --tcprcvbuf bar:lim 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.
--othersockbuf bar:lim Total size in bytes of UNIX-domain socket buffers, UDP and
other datagram protocol send buffers.
--dgramrcvbuf bar:lim Total size in bytes of receive buffers of UDP and other
datagram protocols.
--oomguarpages bar:lim 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. In this version of Parallels Virtuozzo
Containers, the limit shall be set to the same value as the
74
Parallels Virtuozzo Containers Command-Line Interface
barrier.
-l, --lockedpages bar:lim Memory not allowed to be swapped out (locked with the
mlock()
system call), in 4-Kb pages.
--shmpages bar:lim Total size of shared memory (including IPC, shared
anonymous mappings and tmpfs objects), allocated by
processes of a particular Container, in 4 Kb pages.
--privvmpages bar:lim 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.
-n, --numfile bar:lim Number of files opened by all Container processes. In this
version of Parallels Virtuozzo Containers, the limit shall be
set to the same value as the barrier.
-f, --numflock bar:lim Number of file locks created by all Container processes.
-t, --numpty bar:lim Number of pseudo-terminals. For example, ssh session,
screen, xterm application consumes pseudo-terminal
resource. In this version of Parallels Virtuozzo Containers,
the limit shall be set to the same value as the barrier.
-i, --numsiginfo bar:lim Number of siginfo structures (essentially this parameter
limits size of signal delivery queue). In this version of
Parallels Virtuozzo Containers, the limit shall be set to the
same value as the barrier.
-x, --dcachesize bar:lim 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.
--cpuunits units CPU weight. This is a positive integer number that defines
how much CPU time the Container can get as compared to
the other Containers running on the server. The larger the
number, the more CPU time the Container can receive.
Possible values range from 8 to 500000. If this parameter is
not set, the default value of 1000 is used.
--cpulimit percent|megahertz CPU limit, in percent or megahertz (MHz), the Container is
not allowed to exceed. By default, the limit is set in
percent. To set the limit in MHz, specify "m" after the value.
Note: If the server has 2 processors, the total
CPU time equals 200%.
--cpus num If the Node has more than one CPU installed, this option
allows you to set the number of virtual CPUs to be available
to the Container.
--cpumask num|all CPU affinity mask. This mask defines the CPUs on the
server that can be used to handle the processes running in
the Container. The CPU mask can be specified as both
separate CPU index numbers (1,2,3) and CPU ranges (2-
4,5-7).
75
Parallels Virtuozzo Containers Command-Line Interface
--nodemask num|all The NUMA node mask defining a NUMA node to bind the
Container to. Once you set the mask, the processes
running in the Container will be executed only on the CPUs
that belong to the specified NUMA node.
--diskspace bar:lim 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 specified by the --
quotatime setting.
--diskinodes bar:lim 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 specified by the --quotatime setting.
--quotatime seconds The grace period of the disk quota. It is defined in seconds.
A Container is allowed to temporary exceed barrier values
for disk space and disk inodes limits for not more than the
period specified with this setting.
Specifying -1 as the value of this setting makes the grace
period last 'infinitely'.
--quotaugidlimit num This parameter defines the maximum aggregate number of
user IDs and group IDs for which disk quota inside the
given Container will be accounted. If set to 0, the UID and
GID quota will be disabled.
When managing the quotaugidlimit parameter, keep in mind
the following:
Enabling per-user and per-group quotas for a
Container requires restarting the Container.
If you delete a registered user but some files
with their ID continue residing inside your
Container, the current number of ugids (user
and group identities) inside the Container will
not decrease.
If you copy an archive containing files with
user and group IDs not registered inside your
Container, the number of ugids inside the
Container will increase by the number of these
new IDs.
--ioprio num The Container priority for disk I/O operations. The allowed
range of values is 0-7. The greater the priority, the more
time the Container has for writing to and reading from the
disk. The default Container priority is 4.
--iolimit num The bandwidth a Container is allowed to use for its disk
input and output (I/O) operations. By default, the limit is set
in megabytes per second. However, you can use the
following suffixes to use other measurement units:
G: sets the limit in gigabytes per second.
K: sets the limit in kilobytes per second.
76
Parallels Virtuozzo Containers Command-Line Interface
B: sets the limit in bytes per second.
In the current version of Parallels Virtuozzo Containers, the
maximum I/O bandwidth limit you can set for a Container is
2 GB per second.
--iopslimit num The maximum number of disk input and output operations
per second a Container is allowed to perform.
--rate dev:class:Kbits If traffic shaping is turned on, then this parameter specifies
bandwidth guarantee for the Container. The format is
dev:class:Kbits where dev is the network device to
count traffic on, class is the network class (group of IP
addresses) and the last parameter is traffic bandwidth.
--ratebound yes|no If set to “yes”, the bandwidth guarantee is also the limit for
the Container and the Container cannot borrow the
bandwidth from the TOTALRATE bandwidth pool.
--physpages The amount of RAM that can be used by the processes of a
Container, in 4-KB pages. You can use the following
suffixes to set RAM in other measurement units:
G in gigabytes
Min megabytes
K in kilobytes
B
in bytes
--ram The amount of RAM that can be used by the processes of a
Container, in bytes. You can use the following suffixes to
set RAM in other measurement units:
G in gigabytes
M in megabytes
K in kilobytes
B
in bytes
--swappages The amount of swap space that can be used by the
Container for swapping out memory once the RAM is
exceeded, in 4-KB pages. You can use the following
suffixes to set swap in other measurement units:
G in gigabytes
M megabytes
K in kilobytes
B
in bytes
--swap The amount of swap space that can be used by the
Container for swapping out memory once the RAM is
exceeded, in bytes. You can use the following suffixes to
set swap in other measurement units:
G in gigabytes
M
megabytes
77
Parallels Virtuozzo Containers Command-Line Interface
K in kilobytes
B in bytes
--vm_overcommit Memory overcommit factor that defines the memory
allocation limit for a Container. The limit is calculated as
(RAM + SWAP) * factor
--reset_ub Resets the current values of all system parameters of the
Node to the ones set in the 0.conf file.
Network related settings allow you to set the hostname, the domain to search when a not fully
qualified domain name is used, the DNS server address and the IP addresses that Container can
use as well as to indicate those iptables modules that can be loaded to the Container:
--hostname name Sets the hostname to the specified name.
--ipadd addr Adds an IP address to a list of IP addresses the Container
can use and brings up the network interface with this
address inside the Container.
If used with the --ifname option, adds an IP address to
the specified Container virtual network adapter.
--ipadd addr/net_mask Assigns the IP address and network mask to the Container.
Note: You can assign network masks to
Containers operating in the venet0 networking
mode only if the USE_VENET_MASK parameter in
the Parallels Virtuozzo Containers configuration
file is set to yes.
--ipdel addr|all Allows you to revoke IP address from the Container. If “all”
is used instead of IP address than all IP addresses will be
revoked.
If used with the --ifname option, deletes an IP address
from the specified Container virtual network adapter.
--ext_ipadd addr Assigns the external IP address to the Container. External
IP addresses are considered valid IP addresses by the
venet0 adapter, though they are not set as alias
addresses inside Containers and are not announced via
Address Resolution Protocol (ARP). You can assign the
same external IP address to several Containers,
irrespective of whether they reside on the same or different
Hardware Nodes.
--ext_ipdel addr|all Removes the external IP address from the Container. To
delete all external IP addresses assigned to the Container,
specify --ext_ipdel all.
--nameserver addr The DNS server IP address for the Container.
If used with the --ifname option, sets the DNS server for
the specified Container virtual network adapter.
--searchdomain domain The DNS search domain for the Container. More than one
domain may be specified.
--iptables
module Only those
iptables
modules will be loaded to the given
78
Parallels Virtuozzo Containers Command-Line Interface
Container which are indicated.
The list of iptables modules are loaded to a Container is
determined by the list of iptables modules loaded on the
Node at the moment of the Container startup.
--netif_add name
[,mac,host_mac]
Creates a new veth virtual network adapter and assigns
the name of name to the Ethernet interface inside the
Container. Along with the Ethernet interface name inside
the Container, you can set the following parameters when
creating the veth adapter:
mac: the MAC address to be assigned to the
veth Ethernet interface inside the Container.
host_mac: the MAC address to be assigned to
the veth Ethernet interface on the Node.
Only the Ethernet interface name (name) is mandatory; all
the other parameters, if not specified, are automatically
generated by Parallels Virtuozzo Containers during the
veth
adapter creation.
--netif_del name Removes the veth virtual network adapter with the
specified name from the Container.
--ifname name Specifies the name of the veth virtual network adapter
whose settings are to be configured. This option can be
used along with one of the following options: --ipadd, --
ipdel, --nameserver, --gw, --network, --dhcp, --
mac
,
--host_mac
.
--mac MAC_Address The MAC address to be assigned to the veth virtual
Ethernet interface inside the Container. Should be used
along with the --ifname option.
--host_mac MAC_Address The MAC address to be assigned to the veth virtual
Ethernet interface on the Node. Should be used along with
the
--ifname
option.
--host_ifname name The name to be assigned to the veth virtual Ethernet
interface on the Node. Should be used along with the --
ifname
option.
--network network_ID Connects the veth virtual network adapter to the bridge
associated with the specified network ID. Should be used
along with the --ifname option.
You can also use this option to disconnect the veth virtual
network adapter from the bridge. To this effect, you should
specify
""
after the option.
--dhcp yes|no Defines the IP assignment type for the veth virtual network
adapter:
yes enables the dynamic IP address allocation
for the Container.
no turns off the dynamic IP address allocation for
the Container.
Should be used along with the --ifname option.
79
Parallels Virtuozzo Containers Command-Line Interface
--gw addr Set the default gateway for the veth virtual network
adapter. Should be used along with the --ifname option.
vzctl unset
This command is used to remove Container parameters from its configuration file
(/etc/vz/conf/<CT_ID>.conf). It has the following syntax:
vzctl unset <CT_ID> <setting_name> --save
Depending on the parameter for which the command is executed, vzctl unset can:
Either delete the information on the specified parameter from the Container configuration file
without making any changes to the Container configuration (e.g. if executed with the --root or
--private parameter).
Or delete the information on the specified parameter from the Container configuration file and
make the corresponding changes to the Container configuration (e.g. disable the offline
management if executed with the --offline_management parameter or forbid the
Container to start on the Node boot if executed with the --onboot parameter).
This command can be used with the same parameters as vzctl set. You can view detailed
information on all the parameters in the previous subsection.
vzctl exec, vzctl exec2, and vzctl enter
These commands are used to run arbitrary commands in a Container being authenticated as root
on the Node. The syntax of these commands is as follows:
vzctl { exec|exec2 } <CT_ID|name> <command>
vzctl enter <CT_ID|name>
where command is a string to be executed in the Container. If command is specified as-” then the
commands for execution will be read from the standard input until the end of file or “exit” is
encountered.
The difference between exec and exec2 is the exit code. vzctl exec returns 0 in case vzctl
has been able to launch the command and does not take into account the exit code of the
command itself. vzctl exec2 returns the exit code of the command executed in the Container.
When using exec or exec2, you should remember that the shell parses the command-line and, if
your command has shell meta-characters in it, you should escape or quote them.
vzctl enter is similar to vzctl exec /bin/bash. The difference between the two is that
vzctl enter makes the shell interpreter believe that it is connected to a terminal. As such, you
receive a shell prompt and are able to execute multiple commands as if you were logged in to the
Container.
80
Parallels Virtuozzo Containers Command-Line Interface
vzctl recover and vzctl reinstall
These commands are used to restore the original state of Container system and application files (to
be more precise, of VZFS symlinks in the Container private area to system and application
templates) if the Container gets broken for some reason. These are restored to the state as they
were at the time when the Container was created and/or when other applications were added to
the Container afterwards.
The difference between these two commands lies in the way the symlinks are restored. Whereas
the vzctl recover command simply rewrites the original symlinks to the Container private area
(leaving the user files intact), the vzctl reinstall command creates a new private area for the
Container and re-writes the Container from scratch using its configuration files (thus retaining the
Container IP address, hostname, resource control parameters, and all the other settings). The
contents of the Container old private area are then copied to the /old directory in the new private
area, to retain the user files.
The syntax of these commands is as follows:
vzctl recover <CT_ID> [options]
vzctl reinstall <CT_ID> [options]
The available options are listed below:
Option Description
--resetpwdb Removes the Container user database and creates a clean database as for any
new installation.
--skipbackup Does not save the contents of the old private area to the /old directory. Can
be used with the
vzctl reinstall
command only.
--scripts script1
script2 ...
Indicates the scripts to be executed during the Container reinstallation. These
scripts are used to customize your application templates inside the new
Container and bring them to the same state they were inside the old Container.
By default, all available scripts are executed.
--listscripts Lists the scripts that will be executed during the Container reinstallation to
customize your application templates inside the new Container.
--desc Displays the description of the scripts that will be executed during the
Container reinstallation. Should be used together with the --listscripts
option.
Note: If any of the Container application templates cannot be added to the Container in a normal way,
the reinstallation process will fail. This may happen, for example, if an application template was added to
the Container using the --force option of the vzpkgadd command.
81
Parallels Virtuozzo Containers Command-Line Interface
vzctl quotaon, vzctl quotaoff, and vzctl quotainit
These commands turn the quota on or off for the particular Container; the vzctl quotainit
command forces the quota to be initialized for the Container, i.e. its disk space and inodes
recalculated. The Container ID must be specified after these commands with no additional options:
vzctl quotaon <CT_ID>
vzctl quotaoff <CT_ID>
vzctl quotainit <CT_ID>
When the quota is turned on or initialized for the specified Container, the quota settings are taken
from the Container configuration file. If you wish to change these settings, you should use the
vzctl set command.
vzctl suspend and vzctl resume
The vzctl suspend command is used to save the state of a running Container. It has the
following syntax:
vzctl suspend <CT_ID>
During the vzctl suspend execution, the current Container state is saved to a special dump file
and the Container itself is stopped. The created dump file is saved to the Dump file in the
/vz/private/CT_ID/dump directory on the Node (or in the directory specified as the value of
the DUMPDIR parameter in the Parallels Virtuozzo Containers global file).
The vzctl resume command is used to restore the Container from its dump file created with the
vzctl suspend command. It has the following syntax:
vzctl resume <CT_ID>
When executed, vzctl resume searches for the Dump file in the /vz/private/CT_ID/dump
directory on the Node and restores the Container from this file.You can restore the Container dump
file on the Source Node, i.e. on the Node where this Container was running before its dumping, or
transfer the dump file to another Node and restore it there.
Note: Before restoring a Container from its dump file, make sure that the file system on the Destination
Node is identical to that at the moment of the Container dumping. Otherwise, the Container restoration
may fail.
82
Parallels Virtuozzo Containers Command-Line Interface
vzctl convert
The vzctl convert command is used to convert legacy Containers to the new Parallels
Virtuozzo Containers directory layout. It has the following syntax:
vzctl convert <CT_ID|name>
To execute the command, you should specify only the ID of the Container you wish to convert.
Keep in mind that this Container should be stopped.
In the old layout, the Container-related files are dispersed over the whole Node file system. In the
new layout, the Container-related files are stored in the /vz/private/CT_ID directory. When
executed, vzctl convert collects all the Container-related files dispersed over the Hardware
Node file system into the /vz/private/CT_ID directory.
vzctl runscript
The vzctl runscript command is used to run shell scripts in Containers. For example, you
can add this command to scripts you use to perform customization or configuration tasks in the
Container context. The syntax of vzctl runscript is as follows:
vzctl runscript <CT_ID> <script_path>
The command requires the following input parameters:
The ID of the Container where you want to run the script.
The full path to the script on the Node.
If you execute the command for a running Container, it just jumps into the Container and runs the
specified script there. If, however, you run the command for a stopped Container, the sequence of
operations is slightly different: Once vzctl enters the Container, it mounts the root (/) filesystem,
and then executes the script. Notice that in this case only the following instances are running in the
Container:
a process for the vzctl session
the script
processes initiated by the script
83
Parallels Virtuozzo Containers Command-Line Interface
vzlist
The vzlist utility is used to list the Containers existing on the given Node together with additional
information about these Containers. The output and sorting of this information can be customized
as needed. The utility has the following syntax:
vzlist [-a] [-S] [-o parameter[.specifier] \
[,parameter[.specifier]...]] [-s [-]parameter[.specifier]] \
[-H] [-h hostname_pattern] [CT_ID ...] [-n] [-N name_pattern] \
[CT_ID [CT_ID ...]|-1]
vzlist -L
Here follows the description of available options:
Option Description
-a, --all Lists all the Containers existing on the Node. By default, only
running Containers are shown.
-S, --stopped Lists only stopped Containers.
-o parameter[.specifier] This option is used to display only particular information about the
Containers. The parameters and their specifiers that can be used
after the -o option are listed in the following subsection. To display
a number of parameters in a single output, they should be
separated with commas, as is shown in the synopsis above.
-s, --sort
[-]parameter[.specifier]
Sorts the Containers in the list by the specified parameter. If "-" is
given before the name of the parameter, the sorting order is
reversed.
-h, --hosthame
hostname_pattern
Displays only those Containers that correspond to the specified
hostname pattern. The following wildcards can be used: *,?, and
[].
Note: The last wildcard should be escaped to avoid shell
interpretation.
-H, --no-header Do not display column headers.
CT_ID Displays only the Container with the specified ID. Several Container
IDs separated with a space can be specified. If -1 is given as the
Container ID, the utility lists only IDs of the Containers existing on
the Node, with no additional information.
-n, --name If used without any parameters, displays information on all the
Containers on the Node together with their names. If you indicate
the Container ID after this option, displays information including the
Container name on the specified Container only.
-N, --name_filter
name_pattern
Displays only the Container that corresponds to the specified name
pattern.
-i, --netif
<interface_name>
Displays the Container whose veth virtual Ethernet interface name
on the Node corresponds to the specified name pattern.
-d, --description
desc_pattern
Displays only the Container whose description corresponds to the
specified pattern.
84
Parallels Virtuozzo Containers Command-Line Interface
-L, --list Lists all the parameters available to be used with the
-o
option.
85
Parallels Virtuozzo Containers Command-Line Interface
vzlist Output Parameters and Their Specifiers
Almost any parameter that can be used after the -o and -s switches of the vzlist utility can be
specified by the "dot+letter" combination following the parameter and denoting one of the following
things:
Specifier Description
.m The maximal registered usage of the corresponding resource by the given Container.
.b The barrier on using the corresponding resource set for the given Container.
.l The limit on using the corresponding resource set for the given Container.
.f The number of times the system has failed to allocate the corresponding resource for the
given Container.
.s The soft limit on using the corresponding resource set for the given Container.
.h The hard limit on using the corresponding resource set for the given Container.
The following parameters are available for using with the utility:
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
86
Parallels Virtuozzo Containers Command-Line Interface
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, TCPRCVB The total size (in bytes) of receive buffers for
TCP sockets. Amount of kernel memory
87
Parallels Virtuozzo Containers Command-Line Interface
.l, .f 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 Parallels
Virtuozzo Containers reporting tools consider
one 1 GHz PIII Intel processor to be equivalent
to 50,000 CPU units.
88
Parallels Virtuozzo Containers Command-Line Interface
cpumask none CPUMASK The CPU affinity mask defining which CPUs on
the Node can be used to handle the processes
running in the Container. The CPU mask can be
specified as both separate CPU index numbers
(1,2,3) and CPU ranges (2-4,5-7).
nodemask none NODEMASK The NUMA node mask defining a NUMA node
to bind the Container to. Once you set the
mask, the processes running in the Container
will be executed only on the CPUs that belong
to the specified NUMA node.
ioprio none IOPRIO The disk input/output priority level set for the
Container. The higher the Container I/O priority
level, the more time the Container will get for its
disk I/O activities as compared to the other
Containers on the server. The default I/O
priority level is set to 4. Possible values are from
o to 7.
iolimit none IOLIMIT The bandwidth a Container is allowed to use for
its disk input and output (I/O) operation, in
bytes per second.
iopslimit none IOPSLIMIT The maximum number of disk input and output
operations per second a Container is allowed to
perform.
If a parameter that can be used with a specifier is used without any specifier in the command-line,
the current usage of the corresponding resource is shown by default.
89
Parallels Virtuozzo Containers Command-Line Interface
vzquota
This command is used to configure and see disk quota statistics for Containers. vzquota is also
used to turn on the possibility of using per-user/group quotas inside the Container. It allows you to
configure per-user or per-group quota inside the Container as well. vzctl uses vzquota
internally to configure quotas and you usually do not have to use vzquota except for checking the
current quota statistics. The syntax of vzquota command is as follows:
vzquota [options] command <CT_ID> [command-options]
General options available to all vzquota commands are:
-v Verbose mode. Causes vzquota to print debugging messages about its progress. You can give up
to two
–v
switches to increase verbosity.
-q Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are
displayed.
Parallels Virtuozzo Containers quota works on a file system sub-tree or area. If this area has
additional file systems mounted to its subdirectories, the quota will not follow these mount points.
When you initialize quota, you specify the file system sub-tree starting point for the quota. Quota
keeps its current usage and settings for a Container in the /var/vzquota/quota.<CT_ID> file.
Any quota file has a special flag, which indicates whether the file is “dirty”. The file is dirty when its
content can be inconsistent with that of real quota usage. On the Container startup, quota will be
re-initialized if the Node was incorrectly brought down (for example power switch was hit). This
operation may noticeably increase the Container startup time.
For both the disk and inodes usage, Parallels Virtuozzo Containers allows you to set soft and hard
limits as well as an expiration time. Upon reaching a soft limit, Parallels Virtuozzo Containers starts
the expiration time counter. When the time is expired, the quota will block the subsequent disk
space or inode allocation requests. The hard limit cannot be exceeded.
vzquota understands the following commands:
init Before you can use quota, the current disk space and inode usage should be counted. For
the init command, you must specify all the limits as well as the file tree where you want
to initialize the quota.
drop Removes the quota file.
on Turns on quota accounting on the specified quota ID.
off Turns off quota accounting on the specified quota ID.
setlimit Allows you to change quota limits for the running quota.
setlimit2 Set the second-level quota parameters.
stat Shows quota statistics for the running quota.
show Shows quota usage from the quota file.
90
Parallels Virtuozzo Containers Command-Line Interface
vzquota init
This command is used for counting the current usage of disk space and inodes. It has the following
syntax:
vzquota [options] init <CT_ID> [command-options]
The following options are understood by the vzquota init command:
-s, --sub-quotas 1|0 Optional. If the value used is 1 than per user/group quota is
enabled in the Container. By default, user/group quotas are
disabled.
-b, --block-softlimit num Required. Disk quota block soft limit amount of 1 Kb blocks
allowed for the Container to use. This limit can be exceeded by
the Container for the time specified by block expiration time (see
below). When expiration time is off, the Container cannot
allocate more disk space even if the hard limit is not yet
reached.
-B, --block-hardlimit num Required. Specifies disk quota block hard limit in 1 Kb blocks.
This limit cannot be exceeded by the Container.
-e, --block-exptime time Required. Expiration time for excess of the block soft limit. Time
can be specified in two formats:
dd:hh:mm:ss For example: 30 - 30 seconds;
12:00 - 12 minutes; 20:15:11:00 - 20 days, 15 hours,
11 minutes
xxA, where A - h/H(hour); d/D(day); w/W(week);
m/M(month); y/Y(year)
For instance: 7D - 7 days; 01w - 1 week; 3m 3
months
-i, --inode-softlimit num Required. Inodes soft limit amount of inodes allowed for the
Container to create. This limit can be exceeded by the Container
for the time specified by inode expiration time (see below). When
expiration time is off the Container cannot create more inodes
even if hard limit is not yet reached.
-I, --inode-hardlimit num Required. Specifies inodes hard limit. This limit cannot be
exceeded by the Container.
-n, --inode-exptime time Required. Expiration time for excess of the inode soft limit. Time
can be specified in two formats:
dd:hh:mm:ss For example: 30 - 30 seconds;
12:00 - 12 minutes; 20:15:11:00 - 20 days, 15 hours,
11 minutes
xxA, where A - h/H(hour); d/D(day); w/W(week);
m/M(month); y/Y(year)
For instance: 7D - 7 days; 01w - 1 week; 3m 3
months
-p path Required. Specifies the path to the Container private area.
-c quota_file Optional. Specifies the file to write output of counted disk space
and inodes as well as limits. If omitted, the default
91
Parallels Virtuozzo Containers Command-Line Interface
/var/vzquota/quota.<
CT_ID
>
file is used.
vzquota drop
Removes the quota file. The syntax of this command is:
vzquota [options] drop <CT_ID> [-f] [-c quota_file]
The command checks whether the quota is running for a given Container and if it is, exits with
error. An optional –f switch can be given to override this behavior and drop quota even if it is
running. You can also override the path to the quota file to be dropped with an optional c switch.
vzquota on and vzquota off
These commands are used to turn quota on and off. Their syntax is as follows:
vzquota [options] on <CT_ID> [command-options]
vzquota [options] off <CT_ID> [-f] [-c quota_file]
vzquota off turns the quota off for the file system tree specified in quota file given with an
optional –c switch. If this switch is omitted, the default /var/vzquota/quota.<CT_ID> file is
used. This command exits with error if for some reason quota file cannot be accessed and usage
statistics could be lost. You can override this behavior by giving an optional –f switch.
vzquota on accepts the following options:
-s, --sub-quotas 1|0 Optional. If the value used is 1 then per user/group quota is
enabled in the Container. By default user/group quotas are
disabled.
-u, --ugid-limit num Optional. Specifies the maximum number of user and group IDs
for which usage statistics will be counted in this Container. If this
value is 0, user/group quota will not be accounted. The default
value is 0.
-p path Required. Specifies the path to the Container private area.
-f This option forces recalculation of quota usage even if the quota
file does not have dirty flag set on.
-c quota_file Optional. Specifies the file to write output of counted disk space
and inodes as well as limits. If omitted, the default
/var/vzquota/quota.<CT_ID> file is used.
-b, --block-softlimit num
-B, --block-hardlimit num
-e, --block-exptime time
-i, --inode-softlimit num
-I, --inode-hardlimit num
-n, --inode-exptime
time
These options are optional for the vzquota on command.
They are described in the vzquota init subsection.
92
Parallels Virtuozzo Containers Command-Line Interface
vzquota setlimit
This command updates limits for the running quota. It requires at least one limit to be specified. It
also updates the corresponding quota file with new settings. The syntax of this command is:
vzquota [options] setlimit <CT_ID> [command-options]
Command options can be:
-u, --ugid-limit num Optional. Specifies the maximum number of user and group IDs
for which usage statistics will be counted in this Container. If this
value is 0, user/group quota will not be accounted. Default value
is 0.
-b, --block-softlimit num
-B, --block-hardlimit num
-e, --block-exptime time
-i, --inode-softlimit num
-I, --inode-hardlimit num
-n, --inode-exptime
time
These options are optional for the vzquota on command.
However, at least one of these options or -u, --ugid-limit
num must be specified. These options are described in the
vzquota init subsection.
-c quota_file Optional. Specifies the file where to write output of the counted
disk space and inodes as well as limits. If omitted, the default
/var/vzquota/quota.<CT_ID> file is used.
vzquota setlimit2
This command updates the second-level quota parameters for the running quota. It updates the
corresponding quota file with new settings. The syntax of this command is:
vzquota [options] setlimit <CT_ID> [command-options]
You can use the following command options with vzquota setlimit2:
-u, --ugid-limit num Optional. Specifies the maximum number of user and group IDs
for which usage statistics will be counted in this Container. If this
value is 0, user/group quota will not be accounted. Default value
is 0.
-b, --block-softlimit num
-B, --block-hardlimit num
-e, --block-exptime time
-i, --inode-softlimit num
-I, --inode-hardlimit num
-n, --inode-exptime time
These options are optional for the vzquota on command.
These options are described in the vzquota init subsection.
-c quota_file Optional. Specifies the file where to write output of the counted
disk space and inodes as well as limits. If omitted, the default
/var/vzquota/quota.<CT_ID> file is used.
93
Parallels Virtuozzo Containers Command-Line Interface
vzquota stat and vzquota show
These commands are used for querying quota statistics. The syntax is as below:
vzquota [options] show <CT_ID> [-t] [-f] [-c quota_file]
vzquota [options] stat <CT_ID> [-t] [-c quota_file]
The difference between the vzquota stat and vzquota show commands is that the first one
reports usage from the kernel while the second one reports usage as written in the quota file.
However, by default vzquota stat updates the file with the last kernel statistics. If you do not
want to update the quota file, add the –f switch to the command.
You can specify an alternative location to the quota file with the c quota_file switch.
Otherwise, the default /var/vzquota/quota.<CT_ID> file will be used.
To add information on user/group quota to the above commands output, use the –t command line
switch.
A typical output of the vzquota stat command is shown below:
# vzquota stat 101 -t
resource usage softlimit hardlimit grace
1k-blocks 113856 2097152 2097152
inodes 42539 200000 220000
User/group quota: on,active
Ugids: loaded 33, total 33, limit 100
Ugid limit was exceeded: no
User/group grace times and flags:
type block_exp_time inode_exp_time hex_flags
user 0
group 0
User/group objects:
type ID resource usage softlimit hardlimit grace status
user 0 1k-blocks 113672 0 0 loaded
user 0 inodes 42422 0 0 loaded
This output is suppressed for the sake of simplicity. As can be seen, Container 101 has the same
soft and hard limits for disk space and Container can occupy up to 2 Gb of disk space. The current
usage is 113 Mb. There are 42,539 inodes used by the Container, it has soft limit of 200,000
inodes and hard limit is set to 220,000. The empty grace column shows that grace period is
started neither for inodes nor for disk space.
Per user/group quota is turned on and up to 100 users and groups are counted by the quota.
Currently, there are 33 users and groups found in the Container and statistics for root is shown.
There are no limits set from within the Container, and the current usage for root is 42,422 inodes
and 113 Mb of disk space.
94
Parallels Virtuozzo Containers Command-Line Interface
Licensing Utilities
This section describes the utilities you can muse to manage Parallels Virtuozzo Containers licenses.
vzlicload
This utility is used to manage Parallels Virtuozzo Containers licenses on your Node. It has the
following syntax:
vzlicload [options]
The utility accepts the following options:
-p, --product-key Installs the Parallels Virtuozzo Containers license on the Node.
-f, --license-file
<file_path>
The full path to the license file containing the license to be installed
on the Node.
-r, --remove Removes the license with the specified serial number from the
Node. You can find out the license serial number using the
vzlicview utility (see the vzlicview subsection (p. 96) for
details).
-i, --stdin Makes
vzlicload
use standard input as a license.
-h, --help Prints the usage help and exits.
95
Parallels Virtuozzo Containers Command-Line Interface
vzlicupdate
This utility can be used to perform the following license-related operations:
Activate your Parallels Virtuozzo Containers installation using a special activation code.
Update the currently installed license on the Node.
Transfer the license installed on the Source Node with the help of an activation code to the
Destination Node.
The vzlicupdate utility has the following syntax:
vzlicupdate [options]
The utility accepts the following options:
-a, --activate
activation_code
Activates the Parallels Virtuozzo Containers installation using the
specified activation code. To successfully complete this task, your Node
must be connected to the Internet.
-t, --transfer Transfers the license activated with the activation code from the Source
Node to the Destination Node. Should be run along with the -a option
on the Destination Node, i.e. on the Node where you are planning to
transfer the license.
-s, --server
hostname[:port]
The hostname of the Parallels Key Authentication (KA) server responsible
for updating Parallels Virtuozzo Containers licenses, activating Parallels
Virtuozzo Containers installations, and transferring licenses from the
Source Node to the Destination Node. If not specified, the
ka.parallels.com hostname is used.
-n, --no-check Updates the license currently installed on the Node even if it is still valid.
-v, --verbose Sets the log level to its maximum possible value.
-h, --help
Prints the utility usage and exits.
When executed without any options, vzlicupdate updates the license currently installed on the
Node. However, you can use the options listed in the table above to complete other license-related
tasks.
96
Parallels Virtuozzo Containers Command-Line Interface
vzlicview
This utility displays the license contents along with the license status information. It has the
following syntax:
vzlicview [options]
The following options can be used with this utility:
-p, --product-key
<key_number>
Displays the license information contained in the specified
Parallels Virtuozzo Containers product key.
-f, --license-file <file> Displays the license information from the specified Parallels
Virtuozzo Containers license file.
-i, --stdin Makes vzlicview use standard input as a license and display
its information.
-h, --help Displays the utility usage and exits.
When executed without any options, the utility returns the contents and status of the license
currently installed on the Node. The utility can report the following statuses for Parallels Virtuozzo
Containers licenses:
ACTIVE The license installed on the Node is valid and active.
VALID
The license the utility parses is valid and can be installed on the Node.
EXPIRED The license has expired and, therefore, could not be installed on the Node.
GRACED The license has been successfully installed on the Node, but it has expired and is currently
on the grace period (i.e. it is active till the end of the grace period).
INVALID The license is invalid (for example, because of the Node architecture mismatch) or
corrupted.
In the compatibility mode (i.e. for Virtuozzo 3.0 and 3.0 SP1 license files), the following statuses can
be reported:
ACTIVE The license file is valid and has been successfully loaded into the kernel.
VALID The license file contains a valid license for this Hardware Node; however, no license is
loaded into the kernel.
INVALID The license file is invalid (for example, because of the Hardware Node ID mismatch) or
corrupted.
GRACED The license file has been successfully loaded into the kernel; however, it has expired and is
currently on the grace period (i.e. it is active till the end of the grace period).
EXPIRED The license file matches the Hardware Node ID but has expired and, therefore, could not be
loaded into the kernel.
UNKNOWN No Parallels Virtuozzo Containers support has been detected in the running kernel.
INACTIVE The license file the utility parses is valid; however, another license is currently active in the
kernel.
97
Parallels Virtuozzo Containers Command-Line Interface
Migration Utilities
vzmigrate
This command is used for moving Containers to another system with minimal or zero downtime. It
has the following syntax:
vzmigrate [options] Destination_Server {Container_list}
{CT_list} is a list of <CT_ID>[:<new_CT_ID>] pairs. A new Container ID parameter is
needed in case both the Source Node (the one where you run the vzmigrate command) and the
Destination Node have a Container with the ID of <CT_ID>. You can specify multiple Containers at
once for migration.
The following options can be used with vzmigrate:
-s, --nostart Do not attempt to start the Container on the Destination Node
after its successful migration if the Container was running on the
Source Node prior to the migration. This option does not have any
effect if the Container was not running on the Source Node.
-r, --remove-area yes|no This option takes precedence of the REMOVEMIGRATED setting
from the global configuration file. If “yes” is specified, then the
Container private area and configuration file will be deleted after
successful migration. If “no” is specified, the private area and
configuration file will be left on the Source Node and have the
.migrated
suffix appended to them.
-f, --nodeps
[=[all][,cpu_check]
[,disk_space]
[,technologies]
[,license][,rate]]
During its execution, vzmigrate performs a number of checks
on the Destination Node (e.g. it verifies that all OS and application
templates required for the Container are present on the
Destination Node) and if some checks fail, exits with an error. This
option allows you to bypass all checks and migrate the Container.
If you specify this option for a running Container, the Container will
not be automatically started on the Destination Node. You should
manually start it after adding the missing templates.
You can additionally use one or several of the following
parameters with this option:
all: do not perform any checks on the Destination
Node.
cpu_check: do not check the CPU capabilities of the
Destination Node.
disk_space: do not check the amount of disk space
on the Destination Node.
technologies: do not check a set of technologies
provided by the Parallels Virtuozzo Containers kernel on
the Destination Node (see the description of the
TECHNOLOGIES parameter in the Container
Configuration File (p. 23) subsection for details).
98
Parallels Virtuozzo Containers Command-Line Interface
license: do not check the license installed on the
Destination Node.
rate: do not check the value of the RATE parameter in
the Parallels Virtuozzo Containers global file.
-b, --batch Normally, you do not have to specify this option. It is used by
Parallels Virtuozzo Containers scripts and changes the screen
output to a computer-parsable form.
--ssh=<ssh_options> Additional options to be passed to ssh while connecting to the
Destination Node.
Note: Do not specify the Destination Node hostname
as an option of --ssh.
--keep-dst Do not remove the 'synched' Container private area on the
Destination Node if some error occurred during the m