Parallels Server Bare Metal 5.0 Reference Guide

Add to my manuals
246 Pages

advertisement

Parallels Server Bare Metal 5.0 Reference Guide | Manualzz

Parallels Server Bare Metal

5.0

Command-Line Reference Guide

Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.

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

Introduction ............................................................................................................... 8

About Parallels Server Bare Metal 5.0 .............................................................................. 9

About This Guide .......................................................................................................... 10

Organization of This Guide .................................................................................................... 11

Documentation Conventions ................................................................................................. 11

Formatting Legend ........................................................................................................ 13

Getting Help .................................................................................................................. 14

Feedback ...................................................................................................................... 15

Managing Parallels Server Bare Metal 5.0.............................................................. 16

Parallels Server Bare Metal Configuration Files ............................................................... 17

Global Parallels Server Bare Metal Configuration File ............................................................. 19

Container Configuration File ................................................................................................... 26

Linux Distribution Configuration Files ..................................................................................... 34

Network Classes Definition File .............................................................................................. 36

vzup2date Configuration File ................................................................................................. 37

vzup2date-mirror Configuration File ....................................................................................... 38

vzvpn Configuration File ......................................................................................................... 41

vzreport Configuration File ..................................................................................................... 42

Kernel Parameters ................................................................................................................. 43

Offline Management Configuration Files ................................................................................. 44

vzlmond Configuration File ..................................................................................................... 45

vzstat Configuration File......................................................................................................... 47

vzrmond Configuration File .................................................................................................... 49

vzstatrep Configuration File ................................................................................................... 52

Backup Configuration File ...................................................................................................... 54

vzrhnproxy Configuration File ................................................................................................. 57

vzpkgproxy Configuration File ................................................................................................ 58

vztt Configuration File ............................................................................................................ 59

Parallels Server Bare Metal Scripts................................................................................. 59

Overview ............................................................................................................................... 60

Contents

Container Action Scripts ........................................................................................................ 61

Virtual Machine Action Scripts ............................................................................................... 63

Parallels Server Bare Metal Utilities ................................................................................ 63

prlsrvctl .................................................................................................................................. 64

vzup2date ............................................................................................................................. 81

vzup2date-mirror ................................................................................................................... 88

vzlicload ................................................................................................................................ 89

vzlicupdate ............................................................................................................................ 90

vzlicview ................................................................................................................................ 91

vznetcfg ................................................................................................................................. 92

vzreport ................................................................................................................................. 93

vzstatrep ............................................................................................................................... 94

pstat ...................................................................................................................................... 95

Managing Containers ............................................................................................ 102

Matrix of Parallels Server Bare Metal Command-Line Utilities ........................................ 103

pctl ............................................................................................................................. 105

pctl create ........................................................................................................................... 107

pctl delete and pctl destroy ................................................................................................. 108

pctl start, pctl stop, pctl restart, and pctl status ................................................................... 109

pctl mount and pctl umount ................................................................................................ 110

pctl set ................................................................................................................................ 111

pctl unset ............................................................................................................................ 120 pctl exec, pctl exec2, and pctl enter .................................................................................... 120

pctl recover and pctl reinstall ............................................................................................... 121

pctl quotaon, pctl quotaoff, and pctl quotainit ..................................................................... 122 pctl suspend and pctl resume ............................................................................................. 122

pctl runscript ....................................................................................................................... 123

vzlist ........................................................................................................................... 124

vzlist Output Parameters and Their Specifiers ...................................................................... 126

vzquota ....................................................................................................................... 130

vzquota init .......................................................................................................................... 131

vzquota drop ....................................................................................................................... 132 vzquota on and vzquota off ................................................................................................. 132

vzquota setlimit ................................................................................................................... 133 vzquota setlimit2 ................................................................................................................. 133

Contents

vzquota stat and vzquota show ........................................................................................... 134

Migration Utilities ......................................................................................................... 135 pmigrate .............................................................................................................................. 135

vzmigrate ............................................................................................................................. 139

vzmlocal .............................................................................................................................. 141

vzp2v................................................................................................................................... 142

Backing-Up Utilities ..................................................................................................... 143

pbackup .............................................................................................................................. 144

prestore ............................................................................................................................... 146

EZ Template Management Utilities ............................................................................... 148

vzpkg install template .......................................................................................................... 149 vzpkg update template ........................................................................................................ 149

vzpkg remove template ....................................................................................................... 150

vzpkg list ............................................................................................................................. 151

vzpkg info ............................................................................................................................ 153

vzpkg status ........................................................................................................................ 156

vzpkg install ......................................................................................................................... 157

vzpkg update ...................................................................................................................... 159

vzpkg remove ...................................................................................................................... 160

vzpkg link ............................................................................................................................ 161

vzpkg create cache ............................................................................................................. 162

vzpkg update cache ............................................................................................................ 163

vzpkg remove cache ........................................................................................................... 164

vzpkg localinstall .................................................................................................................. 165

vzpkg localupdate ............................................................................................................... 166

vzpkg upgrade .................................................................................................................... 167

vzpkg fetch .......................................................................................................................... 168

vzpkg clean ......................................................................................................................... 169

vzpkg update metadata ....................................................................................................... 170

vzmktmpl ............................................................................................................................. 171

vzpkgproxy .......................................................................................................................... 175

vzrhnproxy ........................................................................................................................... 176

Supplementary Tools................................................................................................... 178 vzfsutil ................................................................................................................................. 178

vzcache ............................................................................................................................... 180

Contents

vzps and vztop .................................................................................................................... 181

vzsetxinetd .......................................................................................................................... 182

vzdqcheck ........................................................................................................................... 183

vzdqdump and vzdqload ..................................................................................................... 184

vznetstat .............................................................................................................................. 185 vzcpucheck ......................................................................................................................... 185

vzmemcheck ....................................................................................................................... 186 vzcalc .................................................................................................................................. 186 vzcheckovr .......................................................................................................................... 186

vzpid ................................................................................................................................... 187 vzsplit .................................................................................................................................. 187

vzcfgscale ........................................................................................................................... 188

vzcfgvalidate ........................................................................................................................ 189

vzhwcalc ............................................................................................................................. 190

vzmtemplate ........................................................................................................................ 191

Managing Virtual Machines ................................................................................... 192 pctl ............................................................................................................................. 192

pctl backup ......................................................................................................................... 193

pctl backup-delete .............................................................................................................. 194

pctl backup-list .................................................................................................................... 195

pctl capture ......................................................................................................................... 196 pctl clone ............................................................................................................................. 196

pctl enter ............................................................................................................................. 197 pctl exec .............................................................................................................................. 197

pctl list ................................................................................................................................. 198

pctl pause, suspend, resume .............................................................................................. 199

pctl problem-report ............................................................................................................. 200

pctl restore .......................................................................................................................... 201 pctl set ................................................................................................................................ 201

pctl snapshot....................................................................................................................... 221

pctl snapshot-delete ............................................................................................................ 222 pctl snapshot-list ................................................................................................................. 222

pctl snapshot-switch ........................................................................................................... 223

pctl start, stop, reset ........................................................................................................... 224

General Syntax .................................................................................................................... 225

Contents

pctl create ........................................................................................................................... 226

pctl delete ........................................................................................................................... 227

pctl migrate ......................................................................................................................... 228

pctl mount ........................................................................................................................... 229

pctl register, unregister ........................................................................................................ 230

pctl server ........................................................................................................................... 231 pctl umount ......................................................................................................................... 231

pmigrate ..................................................................................................................... 232

pbackup ..................................................................................................................... 235

prestore ...................................................................................................................... 236

prl_disk_tool ................................................................................................................ 237

pnetstat ...................................................................................................................... 239

prl_convert .................................................................................................................. 240

Glossary ................................................................................................................. 241

Index ...................................................................................................................... 243

C

H A P T E R

1

Introduction

In This Chapter

About Parallels Server Bare Metal 5.0 ..................................................................... 9

About This Guide ................................................................................................... 10

Formatting Legend ................................................................................................. 13

Getting Help ........................................................................................................... 14

Feedback ............................................................................................................... 15

Introduction

About Parallels Server Bare Metal 5.0

Parallels Server Bare Metal 5.0 allows you to simultaneously run Parallels virtual machines and

Containers on a single server. With Parallels Server Bare Metal, you can efficiently use your server's hardware resources by sharing them among multiple virtual machines and Containers.

Parallels Server Bare Metal is installed directly on the server hardware and does not need any operating system for its functioning. Once it is installed, Parallels Server Bare Metal allows you to create virtual machines and Containers and manage them using the following tools:

Command-line interface (CLI). The command-line interface comprises a set of Parallels command-line utilities that you can use to manage virtual machines and Containers both locally and remotely.

Parallels Management Console. Parallels Management Console is a remote management tool for Parallels Server Bare Metal with a graphical user interface. You can use this tool to manage servers and Parallels virtual machines residing on them.

Note: In this version of Parallels Server Bare Metal, you cannot use Parallels Management Console to create and manage Parallels Containers.

Graphically, a server with the Parallels Server Bare Metal software installed can be represented as follows:

9

Introduction

About This Guide

This guide is a complete reference on all Parallels Server Bare Metal configuration files and command-line utilities. It familiarizes you with the way to configure Parallels Server Bare Metal to meet your requirements and to perform various tasks by using the corresponding command-line utilities.

The primary audience for this guide is anyone who is looking for an explanation of a particular configuration option, needs help for a particular command, or is seeking for a command to perform a certain task.

10

Introduction

Organization of This Guide

Chapter 1, Introduction, gives an overview of the Parallels Server Bare Metal product and this guide.

Chapter 2, Managing Parallels Server Bare Metal 5.0, provides instructions on Parallels Server

Bare Metal configuration files, scripts, and command-line utilities.

Chapter 3, Managing Containers, describes Parallels Server Bare Metal command-line utilities that can be used for managing your Containers.

Chapter 4, Managing Virtual Machines, focuses on Parallels Server Bare Metal utilities that can used for managing your virtual machines.

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

Special Bold

Type of Information

Titles of chapters, sections, and subsections.

Example

Items you must select, such as menu options, command buttons, or items in a list.

Go to the Resources tab.

Read the Basic Administration chapter.

11

Introduction

Italics

Monospace

Preformatted

Monospace Bold

Key+Key

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

.

The names of commands, files, and directories.

Use vzctl start to start a Container.

On-screen computer output in your command-line sessions; source code in XML, C++, or other programming languages.

Saved parameters for Container

101

What you type, as contrasted with on-screen computer output.

# rpm –V virtuozzo-release

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.

12

Introduction

Formatting Legend

Format

Bold

Italic

Between square brackets.

Example: [--name name]

Meaning

Parameters that the user must type exactly as shown.

Parameter values that the user must supply.

Optional parameters.

Between curly brackets and/or separated by pipe (|).

Examples:

ID|name

{

-o name|-d name}

Parameter followed by the same parameter in brackets with ellipses.

Example: name[,name...]

Set of choices from which the user must choose only one.

Parameters that can be repeated more than once in the same command line.

13

Introduction

Getting Help

In addition to this guide, there are a number of other resources available for Parallels Server Bare

Metal which can help you use the product more effectively. These resources include:

Manuals:

Parallels Server Bare Metal 5.0 Installation Guide. This guide provides detailed information on installing Parallels Server Bare Metal on your server, including the pre-requisites and the stages you shall pass.

Getting Started With Parallels Server Bare Metal 5.0

. This guide provides basic information on how to install Parallels Server Bare Metal on your server, create new Containers and virtual machines, and perform main operations on them. As distinct from the Parallels Server

Bare Metal 5.0 Installation Guide, it does not contain detailed description of all the operations needed to install and set Parallels Server Bare Metal to work (e.g. installing

Parallels Server Bare Metal in the text mode).

Parallels Server Bare Metal 5.0 User's Guide. This guide provides comprehensive information on Parallels Server Bare Metal covering the necessary theoretical conceptions as well as all practical aspects of working with the product. However, it does not deal with the process of installing and configuring your system.

Parallels Server 4 Templates Management Guide. This guide is meant to provide complete information on Parallels templates - an exclusive Parallels technology allowing you to efficiently deploy standard Linux applications inside your Containers and to greatly save the physical server resources (physical memory, disk space, etc.).

Deploying Clusters in Parallels-Based Systems. This guide describes the process of creating

Parallels failover and GFS clusters using the Red Hat Cluster Suite (RHCS) software.

Help systems:

Getting Started with Parallels Management Console. This help system provides information on how to start working in Parallels Management Console. You will learn how to install this application on your computer, connect to a physical server running Parallels Server Bare

Metal, and perform the basic operations on your virtual machines.

Parallels Management Console User's Guide. This help system provides detailed information on Parallels Management Console - a graphical user interface tool for managing physical servers and their virtual machines.

14

Introduction

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/ ).

15

C

H A P T E R

2

Managing Parallels Server Bare Metal 5.0

This chapter provides instructions on configuration files, scripts, and command-line utilities that can used to configure the settings related to the Parallels Server Bare Metal software and the Parallels server.

In This Chapter

Parallels Server Bare Metal Configuration Files ........................................................ 17

Parallels Server Bare Metal Scripts .......................................................................... 59

Parallels Server Bare Metal Utilities .......................................................................... 63

Managing Parallels Server Bare Metal 5.0

Parallels Server Bare Metal Configuration Files

This section explains what configuration parameters Parallels Server Bare Metal 5.0 has and how they affect the product behavior.

There are a number of files responsible for the Parallels Server Bare Metal system configuration.

Most of the files are located in the /etc directory on the Parallels server. However, some configuration files are stored on the Backup Node, in a Container, or on a dedicated server. If a configuration file is located in a place other than the Parallels server, we point clearly the exact position where it can be found.

A list of configuration files is presented in the table below:

/etc/vz/vz.conf

/etc/vz/conf/<CT_ID>.conf

The Parallels Server Bare Metal global configuration file. This file keeps system-wide settings, affecting

Container and template default location, global network settings, and so on.

The private configuration file owned by a Container numbered <CT_ID>. The file keeps Container specific settings – its resource management parameters, location of private area, IP address, and so on.

/etc/vz/conf/ve-<name>.conf.sample

/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 Server Bare Metal action scripts and depend on the Linux version the given

Container is running.

/etc/vz/conf/networks_classes

The definition of network classes, used by traffic shaping and bandwidth management in Parallels

Server Bare Metal.

/etc/sysconfig/vzup2date/vzup2date.conf

This file specifies the default connection parameters for the vzup2date utility.

/<path>/<name>.conf

Sample files, containing a number of default

Container configurations, which may be used as a reference for Container creation. The following samples are shipped with Parallels Server Bare

Metal: basic, cpanel, confixx, slm.plesk, slm.256MB

, slm.512MB, slm.1024MB, slm.2048MB

. You may also create your new samples customized for your own needs.

This configuration file specifies the default connection parameters for the vzup2datemirror

utility. It should be located on the computer where you are planning to run vzup2date-mirror

.

17

Managing Parallels Server Bare Metal 5.0

/etc/cron.d/vereboot

/etc/vzvpn/vzvpn.conf

/etc/vzreport.conf

/etc/sysctl.conf

/etc/vzredirect.d/*.conf

/etc/vzlmond.conf

/etc/vzstat.conf

/etc/vzstatrep.conf

/etc/vzbackup.conf

/etc/vz/pkgproxy/rhn.conf

/etc/vzpkgpoxy/vzpkgproxy.conf

/etc/vztt/vztt.conf

The configuration file for the cron daemon. Using this file, Parallels Server Bare Metal emulates the

“reboot” command working inside a Container.

The configuration file used to define the parameters for establishing a private secure channel to the

Parallels support team server.

The configuration file used to define the parameters for sending your problem report to the Parallels support team.

Kernel parameters. Parallels Server Bare Metal adjusts a number of kernel sysctl parameters and modifies the default /etc/sysctl.conf file.

These files define the offline management modes for controlling Containers by their administrators.

This configuration file defines the parameters used by the vzlmond daemon to collect information on the main Parallels server resources consumption.

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.

This configuration file is located on the Monitor

Node and used by the vzstatrep utility when generating statistic reports and graphics on the

Parallels server resource consumption and sending these reports to the server administrator.

The global configuration file residing on the Backup

Node and determining the global backup settings for Containers.

Note that the settings in this file do not apply to virtual machines.

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.

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.

This configuration file is used by the vzpkg utility when managing OS and application EZ templates.

18

Managing Parallels Server Bare Metal 5.0

Global Parallels Server Bare Metal Configuration File

Parallels Server Bare Metal 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 Server

Bare Metal 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 the parameters defined in this version of Parallels Server Bare Metal.

Global parameters

Parameter

VIRTUOZZO

HTTP_PROXY

ACTIONLOGDIR

LOCKDIR

REMOVEMIGRATED

Description

This can be either “yes” or “no”. Parallels Server

Bare Metal System V startup script checks this parameter. If set to “no”, then Parallels Server

Bare Metal 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 server.

Default value yes

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

Server Bare Metal 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).

-

This is the directory where pctl keeps a log of its actions in the format suitable for Parallels Server

Bare Metal statistics daemon hwcoll.

/vz/actionlog

Actions on a Container should be serialized, since two simultaneous operations on the same

Container may break its consistency. Parallels

Server Bare Metal keeps lock files in this directory in order to serialize access to one Container.

/vz/lock

Specifies whether the private area and the configuration file of the Container moved to a new server with the vzmigrate command should be destroyed on the Source Server (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

19

Managing Parallels Server Bare Metal 5.0

VE0CPUUNITS

CPU weight designated for the server 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".

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 server is considered as the CPU limit. Upon exceeding the

BURST_CPU_AVG_USAGE

limit, the

BURST_CPULIMIT

limit is applied to the given

Container. vzpp-plesk vzpp disabled

BURST_CPULIMIT

VEFORMAT

This parameter can be redefined by the

BURST_CPU_AVG_USAGE

parameter set in the

Container configuration file.

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.

Determines the VZFS version to be applied to all

Containers that will be created on the given server: vz4

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.

VZMOUNTS

Defines the partitions which will be automatically mounted by the /etc/init.d/vz script after the server 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 server, and having the

/vz

20

Managing Parallels Server Bare Metal 5.0

IPV6 noauto

flag set for them in this file.

Defines whether the IPv6 support is enabled on the Parallels server. yes

Logging parameters affect the pctl utility logging behavior.

Parameter

LOGGING

LOGFILE

LOG_LEVEL

Description

This parameter defines whether pctl should log its actions.

File where pctl logs its actions.

There are three levels of logging defined in the current version of Parallels Server Bare Metal.

Default value yes

/var/log/vzctl.log

0

The table below describes the possible values of the LOG_LEVEL parameter and their meanings:

Log level

0

1

2

Information to be logged

Actions of pctl on Containers like start, stop, create, destroy, mount, umount.

Level 1 logs events, calls to pctl helper scripts located in /etc/vz/conf (such as vzstart

and vz-stop) and situations when the init process of the Container is killed on

Container stop after timeout.

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

DISK_QUOTA

VZFASTBOOT

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

This option determines the Container quota reinitialization procedure when the server is booted after an incorrect shutdown. If set to "no", the disk quota is reinitialized for each

Container during the server startup and only then are the

Containers started, which results in a long server and

Containers booting time. When set to "yes", the Container quota reinitialization procedure depends on the Container quota files state: no

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 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 server 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 server and Containers downtime after the incorrect server shutdown.

21

Managing Parallels Server Bare Metal 5.0

SLM parameters allow you to control the amount of memory consumed by the Containers:

Note: In Parallels Containers 4.6, the SLM system was superseded by the new VSwap memory management scheme, and the SLM parameters are left for compatibility reasons only.

Parameter

SLM

Description Default value

If set to "yes", the SLM modules are loaded to the server. It means that the slmmemorylimit parameter is supported and can be used to manage the amount of memory consumed by every

Container on the server. yes

Note: After changing this parameter, restart the

Parallels Server Bare Metal service for the changes to take effect.

SLMPATTERN

Defines the SLM pattern rules for grouping the processes running inside Containers on the server.

The default rules are set in the

/etc/vzslm.d/default.conf

file on the server. default

Network traffic parameters define whether you want to account bandwidth consumed by

Containers and whether you want to limit bandwidth available to Containers:

Parameter

TRAFFIC_SHAPING

BANDWIDTH

TOTALRATE

RATE

Description

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. If you want to use this feature, TRAFFIC_ACCOUNTING should be set to “yes” as well.

Default value no

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

This parameter sets the 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

This parameter is the 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 eth0:1:8

22

Managing Parallels Server Bare Metal 5.0 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.

Template parameters allow to configure the template area location.

Parameter

TEMPLATE

Description

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.

Default value

/vz/template

Container default parameters either affect new Container creation or represent Container parameters that can be overridden in the Container configuration file:

Parameter

VE_ROOT

VE_PRIVATE

CONFIGFILE

DEF_OSTEMPLATE

IPTABLES

VE_ENVIRONMENT

Description

This is a path to the Container root directory where the private area is mounted.

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.

The default configuration file sample to be used for the Container creation; it may be overridden with the --config option of the pctl create command.

The default OS template to be used for the

Container creation; it may be overridden with the -

-pkgset

command-line option for pctl create

.

Default value

/vz/root/CT_ID

/vz/private/CT_ID basic fedora-core-7

Only those iptables modules will be loaded to the Containers hosted on the server which are indicated as the value of this parameter and only if they are loaded on the server itself as well.

Additional environment variables to be passed to the Container init process. Should be provided as any number of name=value pairs separated by spaces. ip_tables ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length

Container validation and overcommitment parameters define whether the Container configuration should be validated and the server overcommitment checked on a Container startup:

Parameter

VE_VALIDATE_ACTION

Description

Defines whether the

Container configuration should be validated when a

Container is started. If this parameter is set to

“warning”, a warning is

Default value none

23

Managing Parallels Server Bare Metal 5.0

OVERCOMMITMENT_ACTION

OVERCOMMITMENT_LEVEL_LOWMEM

OVERCOMMITMENT_LEVEL_MEMSWAP 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.

Defines whether the server 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

The percentage of committed memory residing at lower addresses and directly accessed by the kernel.

120

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

1000 OVERCOMMITMENT_LEVEL_ALLOCMEM_T

OT

The number shows how much memory the applications are allowed to allocate in comparison with the capacity of the system.

24

Managing Parallels Server Bare Metal 5.0

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 Server Bare Metal settings:

Parameter

VZWDOG

VZPRIVRANGE

DUMPDIR

Description

Defines whether the vzwdog module is loaded on Parallels Server

Bare Metal startup. This module is responsible for catching messages from the kernel. It is needed if you configure the serial

Monitor Server for Parallels Server Bare Metal.

Default value no

Defines the ID range for the Containers that are allowed to access the <servere> ID stored in the /proc/vz/hwid file.

1 100

The directory where the Container dump file created by means of the pctl suspend command is to be stored.

/vz/private/C

T_ID/dump

25

Managing Parallels Server Bare Metal 5.0

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 Server Bare Metal, you can also configure a number of settings for the server 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:

VERSION

ONBOOT

Specifies the Parallels Server Bare Metal version the configuration file applies to. "2" relates to Parallels Server Bare Metal version 4 and later.

Specifies whether the Container should be started automatically on system startup. Parallels Server Bare Metal 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 server system management parameters are set on the server boot to the values indicated in this file.

OFFLINE_MANAGEMENT

OFFLINE_SERVICE

ALLOWREBOOT

Overrides the OFFLINE_MANAGEMENT parameter from the global configuration file.

Overrides the OFFLINE_SERVICE parameter from the global configuration file.

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

OSTEMPLATE

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.

The name of the OS template that was used for creating the Container. You do not have to change this parameter; pctl will set it for you upon calling the pctl 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.

26

TEMPLATES

VE_ROOT

VE_PRIVATE

VE_ENVIRONMENT

TECHNOLOGIES

DISABLED

DESCRIPTION

NAME

Managing Parallels Server Bare Metal 5.0

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 server, and the pctl 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 pctl 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.

Overrides the VE_ROOT parameter from the global configuration file.

Overrides the VE_PRIVATE parameter from the global configuration file.

Overrides the VE_ENVIRONMENT parameter from the global configuration file.

Determines a set of technologies which should be provided by the Parallels

Server Bare Metal kernel for Container operation. 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).

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 pctl set command.

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.

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 Containerrelated operation on the server. 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").

27

Managing Parallels Server Bare Metal 5.0

ORIGIN_SAMPLE

The configuration sample the Container was based on when created.

CONFIG_CUSTOMIZED

UUID

VEFORMAT

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".

The Container unique identifier. This identifier is used by certain Parallels

Server Bare Metal utilities during their execution.

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 pctl set command and the corresponding option name (in the lower case, e.g. --kmemsize for KMEMSIZE, etc.). See the

Managing Containers 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 server with 2 GB memory). If the barrier and limit fields are in use, ranges for both thresholds are given.

CPU parameters:

Parameter

CPUUNITS

CPULIMIT

Description Typical value

CPU weight. This is a positive integer number that defines how much CPU time the Container can get as compared to the other virtual machines and 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.

250…1000

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

BURST_CPU_AVG_

USAGE

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 server.

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 server is considered as the CPU limit. Upon exceeding the BURST_CPU_AVG_USAGE limit, the

BURST_CPULIMIT

limit is applied to the Container. This disabled

28

Managing Parallels Server Bare Metal 5.0 parameter redefines the BURST_CPU_AVG_USAGE parameter set in the Parallels Server Bare Metal configuration file.

BURST_CPULIMIT

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 Server Bare Metal configuration file.

Disk parameters:

DISKSPACE

DISKINODES

QUOTATIME

QUOTAUGIDLIMIT

IOPRIO

System parameters:

Total size of disk space that can be consumed by the

Container, in 1 Kb blocks.

Total number of disk inodes (files, directories, symbolic links) the Container can allocate.

204800…10485760-

204800…11534340

80000…400000-

88000…440000

0…604800

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'.

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.

0…500

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.

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

29

Managing Parallels Server Bare Metal 5.0

NUMPROC

AVNUMPROC

NUMTCPSOCK

NUMOTHERSOCK

VMGUARPAGES

KMEMSIZE

TCPSNDBUF

TCPRCVBUF

OTHERSOCKBUF

DGRAMRCVBUF

OOMGUARPAGES

LOCKEDPAGES

SHMPAGES

Number of processes and threads allowed. Upon hitting this limit, Container will not be able to start a new process or thread.

40…400

0…NUMPROC 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.

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

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

1725…107520

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.

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

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.

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

159744…5365760-

262144…10458760

Total size of UNIX-domain socket buffers, UDP and other datagram protocols send buffers.

61440…1503232-

163840…4063232

Total size of receive buffers of UDP and other datagram protocols.

32768…262144

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

Memory not allowed to be swapped out (locked with the mlock()

system call), in pages (one page is 4 Kb).

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

4…4096

512…16384

Size of private (or potentially private) memory, allocated

3072…151200PRIVVMPAGES

30

NUMFILE

NUMFLOCK

NUMPTY

NUMSIGINFO

DCACHESIZE

PHYSPAGES

NUMIPTENT

MEMINFO

Managing Parallels Server Bare Metal 5.0 by an application. Memory that is always shared among different applications is not included in this resource parameter.

Number of files opened by all Container processes.

3450…1612800

512…8192

Number of file locks created by all Container processes.

50…200 – 60…220

Number of pseudo-terminals. For example, the ssh session, screen, the xterm application consumes pseudo-terminal resources.

Number of siginfo structures (essentially this parameter limits the size of signal delivery queue).

4…64

256…512

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

Total size of RAM used by processes. This parameter is used for accounting purposes only. 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 for all Containers corresponds to the total number of pages used in the system by all accounted users.

Not limited

The number of IP packet filtering entries.

12…128

Customizes the output of the

/proc/meminfo

virtual file inside the

Container and sets it to one of the following modes:

• none

(non-virtualized ). In this case running the cat /proc/meminfo

command inside the

Container will display information about physical memory on the server (total, used, free, shared, etc.), in kilobytes.

• pages:num

(virtualized in pages). Setting the

/proc/meminfo

output to this mode allows you to specify what amount of total memory will be displayed while running the cat

/proc/meminfo

command inside the

Container.

• privvmpages:num

(virtualized in

privvmpages). Setting the /proc/meminfo output to this mode also allows you to arbitrarily specify the amount of total memory to be displayed while running the cat

/proc/meminfo

command inside the

31

Managing Parallels Server Bare Metal 5.0

Container. As distinct from the previous mode, the amount of memory to be shown in this mode is calculated on the basis of the value of the PRIVVMPAGES parameter set in the

Container configuration file.

VSwap parameters:

PHYSPAGES

SWAP

Amount of RAM that can be used by the processes of a

Container, in 4-KB pages.

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 + SWAP) * factor

.

1.5

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

IP_ADDRESS

NAMESERVER

SEARCHDOMAIN

NETDEV

IPTABLES

NETIF

If this parameter is specified, then pctl 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.

This is the list of IP addresses, which can be used on Container network interfaces.

This list is an argument of the Container start call and it is impossible to assign 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.

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.

DNS search domains for the Container. More than one domain can be specified.

The names of physical network adapters that have been moved from the server to the given Container.

Overrides the IPTABLES parameter from the Parallels Server Bare Metal global configuration file.

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 server.

• 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.

32

Managing Parallels Server Bare Metal 5.0

RATE

RATEBOUND

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”.

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 server.

BACKUP_CHAIN_LEN

An incremental backup parameter. After this number of incremental backups, a full backup is performed.

7

BACKUP_CHAIN_DAY

S

An incremental backup parameter. After this number of days a full backup is performed.

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.

3

33

Managing Parallels Server Bare Metal 5.0

Linux Distribution Configuration Files

Some Parallels Server Bare Metal utilities (e.g. pctl) 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 Server Bare Metal uses special distribution configuration files located in the /etc/vz/conf/dists directory on the server.

There are a number of distribution configuration files shipped with Parallels Server Bare Metal by default (centos.conf, fedora-core.conf, gentoo.conf, etc.). To view all configuration files available on your Parallels Server Bare Metal, 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. fedoracore-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 Server Bare Metal, 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: pctl start CT_ID pctl set CT_ID --ipadd <ip_address> pctl 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: pctl set CT_ID --ipdel <ip_address> pctl 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: pctl set CT_ID --hostname <name>

34

Managing Parallels Server Bare Metal 5.0

• 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: pctl 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: pctl 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: pctl 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 server on executing the following command: pctl 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 server and executed on performing the aforementioned operations on the Containers. After an operation has been initiated, the pctl 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, pctl 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.

35

Managing Parallels Server Bare Metal 5.0

Network Classes Definition File

In Parallels Server Bare Metal, 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 Server Bare Metal 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 “matchingeverything” rule of Class 1. Class 0 has a special meaning and defines the IP ranges for which no accounting is done (this server 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

36

Managing Parallels Server Bare Metal 5.0

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 Server Bare Metal 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

Server

Description

The URL used for the connection.

Example https://vzup2date.

parallels.com

User

The user name for accessing the update server.

Password

The password for accessing the update server.

HTTP_PROXY

The proxy server address, if you use this server.

HTTP_PROXY_U

SER

HTTP_PROXY_P

ASSWORD

LocalReposit oryDir

LogFile user1 sample http://192.168.1.20

The user name used by the HTTP proxy server for your authentication. peter

The password of the user specified in the

HTPP_PROXY_USER

parameter and used for your authentication by the HTTP proxy server.

2wed45r

The path to the local directory on the server where the downloaded Parallels Server Bare Metal updates are stored. By default, the /vz/vzup2date directory is used.

/vz/vzup2date

/var/log/vzup2date.log

The path to the log file on the server containing the information on Parallels Server Bare Metal updates.

By default, the /var/log/vzup2date.log file is used.

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.

37

Managing Parallels Server Bare Metal 5.0

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 Server Bare Metal 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

User

Password

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

The user name for accessing the update server. user1

As a rule, this parameter is set automatically and does not need to be modified.

The password for accessing the update server. sample

HTTP_PROXY

HTTP_PROXY_USER

The proxy server address, if you use this server. http://192.168.1.20

The user name used by the HTTP proxy server for your authentication. peter

HTTP_PROXY_PASSWO

RD

As a rule, this parameter is set automatically and does not need to be modified.

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

/var/www/html

The local directory where the mirror is to be located and all the required packages are to be stored after the execution of vzup2datemirror

. 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).

38

Managing Parallels Server Bare Metal 5.0

Releases

MirrorName

The list of comma-separated Parallels

Server Bare Metal releases or OS templates names. The format of this parameter is different for different types of updates: i386/5

For system updates, you should set it in the arch/Parallels

Server Bare Metal_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 Server Bare Metal official repository to your local mirror.

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 Server Bare Metal system updates to the servers 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

Server Bare Metal 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 servers. The parameters that can be specified in this section are described in the table below:

39

Managing Parallels Server Bare Metal 5.0

Parameter

CU

TU

MU

Description

The maximum version of Parallels Server Bare Metal kernel updates for the specified architecture/release pair. All Parallels Server Bare Metal kernel updates having higher versions and downloaded to your local mirror will be invisible for the vzup2date utility that you will run on the servers in your local network.

The maximum version of Parallels Server Bare Metal 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 servers in your local network.

Enables (yes) or disables (no) the vzup2date utility to download the next major version update of the Parallels Server Bare Metal software.If this parameter or the whole updates approval mechanism section is omitted, major updates are available to the vzup2date utility by default.

40

Managing Parallels Server Bare Metal 5.0

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

REMOTE_HOST

REMOTE_PORT

STARTTMO

INACTIVE

Description

Mandatory. The hostname or the IP address of the Parallels support server.

Mandatory. The port number of the Parallels support server to be used for establishing a virtual private network (VPN).

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.

Mandatory. The time of inactivity, in seconds, after which the connection between your server and the Parallels support server will be closed.

PING

PING_EXIT

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.

Mandatory. The time, in seconds, after a lapse of which the connection between your server 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 server 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 server.

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 server 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).

41

Managing Parallels Server Bare Metal 5.0

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

COLLECTOR_SCRIPT

HTTP_PROXY

HTTP_PROXY_USER

The Uniform Resource Identifier (URI) of the Parallels support server to be used to receive and gather your problem reports.

The path to the file on your server where the information on your problems reports is collected. This is the same data that is sent to the

Parallels support server.

The hostname or the IP address of the HTTP proxy server through which your problem report will be sent to the Parallels support team.

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.

42

Managing Parallels Server Bare Metal 5.0

Kernel Parameters

There is a number of kernel limits that should be set for the Parallels Server Bare Metal software to work correctly. Parallels Server Bare Metal 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 Server

Bare Metal:

# On the server 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 Server Bare

Metal networking.

It is also worth mentioning that normally you should have forwarding turned on since the server forwards packets destined to or originated from Containers.

43

Managing Parallels Server Bare Metal 5.0

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 Server Bare Metal 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

PORT

DST_VEID

Description

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.

The ID of the Container where the requests coming to the specified port will be redirected.

Example

PORT=8443

DST_VEID=1

44

Managing Parallels Server Bare Metal 5.0

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 server. 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 server administrator's e-mail address(es). Detailed information on the vzstatrep

utility is provided in the vzstatrep subsection

(p. 94).

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

STATS_VMSTAT_PERIOD

STATS_FULLDUMP_PERIOD

STATS_NET_PERIOD

LOGS_DIR

Description

The period, in seconds, at the end of which the complete statistics on the server 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 server and contains information on virtually every server resource: the environment of a certain process, the state and configuration of the CPU(s), the number of I/O ports on the server 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 server state and resources consumption.

Default Value

The periodicity, in seconds, with which the vmstat

utility is run on the server 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 server kernel threads, virtual memory, disks, traps, and CPU activity.

For more information on vmstat, see its man pages.

480

480

The period, in seconds, after which the server 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 server (e.g. eth0, eth1).

480

The name of the directory on the server where the gathered statistics is to be stored.

/var/log/vzstat

45

Managing Parallels Server Bare Metal 5.0

All the aforementioned parameters are set to their default values during the Parallels Server Bare

Metal installation; so, you do not have to additionally edit any parameter in the

/etc/vzlmond.conf

file to start gathering your server statistics.

46

Managing Parallels Server Bare Metal 5.0

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 Alert Type

LOAD_AVG

PROC_RUN

PROC_UNINT

CPU_IDLE

CPU_SYS

CPU_LAT_MAX_WARN

CPU_LAT_MAX_ERR

CPU_LAT_AVG_WARN

CPU_LAT_AVG_ERR

MEM_LAT_MAX_WARN

MEM_LAT_MAX_ERR

MEM_LAT_AVG_WARN

MEM_LAT_AVG_ERR

MEM_ZONE_ACT_INACT_FREE_WARN

MEM_ZONE_ACT_INACT_FREE_ERR

Description

Load average.

Number of running processes.

Default

Value

30

20

Number of uninterruptable processes (in “D” state).

CPU idle time, in percent.

CPU system time, in percent.

20

10

50

Scheduling latency, in milliseconds

(maximum over 5 sec period).

750

Scheduling latency, in milliseconds

(maximum over 5 sec period).

1000

Scheduling latency, in milliseconds

(5 sec average).

500

Scheduling latency, in milliseconds

(5 sec average).

750

Memory allocation latency, in milliseconds (maximum over 5 sec period).

300

Memory allocation latency, in milliseconds (maximum over 5 sec period).

500

250 Memory allocation latency, in milliseconds (5 sec average).

Memory allocation latency, in milliseconds (5 sec average).

Size of available memory (free + active + inactive pages), in percent.

Size of available memory (free + active + inactive pages), in percent.

400

8

4

Alert

When

Higher

Higher

Higher

Lower

Higher

Higher

Higher

Higher

Higher

Higher

Higher

Higher

Higher

Lower

Lower

Warning

Warning

Warning

Warning

Warning

Warning

Error

Warning

Error

Warning

Error

Warning

Error

Warning

Error

47

Managing Parallels Server Bare Metal 5.0

MEM_ZONE_ACT_INACT_FREE_ABS_WARN

MEM_ZONE_ACT_INACT_FREE_ABS_ERR

MEM_ZONE_ORDER_GT_0

SWAP_FREE_WARN

SWAP_FREE_ERR

SWAP_IN_WARN

SWAP_IN_ERR

SWAP_OUT_WARN

SWAP_OUT_ERR

SWAP_LAT_MAX_WARN

SWAP_LAT_MAX_ERR

SWAP_LAT_AVG_WARN

SWAP_LAT_AVG_ERR

DISK_FREE_INODES_WARN

DISK_FREE_INODES_ERR

DISK_FREE_SPACE_WARN

DISK_FREE_SPACE_ERR

CT_FAILCNT_DELTA

Size of available memory (free + active + inactive pages), in MB.

4

Size of available memory (free + active + inactive pages), in MB.

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 +

...

Free swap space, in percent.

Free swap space, in percent.

Swap-in activity, in Mb/sec.

Swap-in activity, in Mb/sec.

Swap-out activity, in Mb/sec.

Swap-out activity, in Mb/sec.

Swap-in latency, in milliseconds

(maximum over 5 sec period).

Swap-in latency, in milliseconds

(maximum over 5 sec period).

2

100

1000

Swap-in latency, in milliseconds (5 sec average).

Swap-in latency, in milliseconds (5 sec average).

500

750

Free inodes on the disk, in percent.

Free inodes on the disk, in percent.

Free disk space, in percent.

Free disk space, in percent.

20

5

Number of failed UBC resource allocations for a particular

Container between vzstat screen updates (any resource type counts).

1

20

5

75

50

0.5

1

0.5

1

750

Lower Warning

Lower

Lower

Error

Warning

Lower

Lower

Higher

Higher

Higher

Higher

Higher

Warning

Error

Warning

Error

Warning

Error

Warning

Higher Error

Higher Warning

Higher Error

Lower

Lower

Lower

Lower

Higher

Warning

Error

Warning

Error

Error

48

Managing Parallels Server Bare Metal 5.0

vzrmond Configuration File

This file (/etc/vzrmond.conf) is the configuration file for the vzrmond daemon which is running on the Monitor Server and provides the remote monitoring of servers 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

HOSTS

Default value

“”

EMAIL_ADDRESSES

EMAIL_NOTIFICATIONS

Description

The list of hosts to be monitored delimited by spaces. Both hostnames and IP addresses are allowed.

E-mail addresses to receive the alerts.

Must be separated by spaces.

The types of notifications to be sent to the specified e-mail address(es).

“”

CUSTOM_ACTION

The program to send alerts of a customized type (e.g. via ICQ or SMS).

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

“”

49

Managing Parallels Server Bare Metal 5.0

CUSTOM_LIST

POLL_PERIOD

CHK_MAX_FAILS

LOAD_AVG

PROC_UNINT

CPU_LAT_MAX_ERR

CPU_LAT_AVG_ERR

MEM_LAT_MAX_ERR

MEM_LAT_AVG_ERR

SWAP_IN_ERR

SWAP_OUT_ERR

DISK_FREE_INODES_ERR

DISK_FREE_SPACE_ERR

Options passed as the command-line parameters of the program specified by

CUSTOM_ACTION

. Must be separated by spaces.

“”

Periodicity of checking up the registered servers, in seconds.

15

4

After this number of unsuccessful attempts to reach a server, the “Server is dead” alert is sent.

The average number of processes on the server. When this value is exceeded, an alert is sent.

30

The number of uninterruptable sleeping processes (in the “D” state). When this value is exceeded, an alert is sent.

20

1000

The maximal process scheduling latency, in milliseconds. When this value is exceeded, an alert is sent.

750

The average process scheduling latency, in milliseconds. When this value is exceeded, an alert is sent.

500

The maximal memory allocation latency, in milliseconds. When this value is exceeded, an alert is sent.

400

The average memory allocation latency, in milliseconds. When this value is exceeded, an alert is sent.

The swap in activity, in Mb/s. When this value is exceeded, an alert is sent.

1.0

The swap out activity, in Mb/s. When this value is exceeded, an alert is sent.

1.0

The percentage of free disk inodes.

When the actual value becomes less than this value, an alert is sent.

5

5

The percentage of free disk space.

When the actual value becomes less than this value, an alert is sent.

To be able to begin monitoring a server, 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 server state, you should install in on the Monitor Server 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 servers not to create an overload on the Monitor Server. 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.

50

Managing Parallels Server Bare Metal 5.0

Do not forget to restart the vzrmond daemon after you have edited this configuration file.

51

Managing Parallels Server Bare Metal 5.0

vzstatrep Configuration File

The vzstatrep.conf configuration file located in the /etc directory on the Monitor Server is used by the vzstatrep utility while trying to generate statistic reports and graphics on the server 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

NODES

STATS_EMAIL

GNUPLOT

MUTT

LOGS_DIR

STATS_PLOT

Description

The IP address or hostname of the server whose logs are to be analyzed. You can set several servers for being processed with the help of the vzstatrep utility and separate them by spaces. If no server is specified, the logs of the local server (i.e. of the Monitor Server itself) are analyzed.

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.

The path to the gnuplot utility on the Monitor Server. 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 server 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.

The path to the mutt utility on the Monitor Server. 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.

The path to the directory on the server where vzstatrep will search for the logs generated by the vzlmond daemon and containing the information on the server 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).

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 server.

• 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

52

Managing Parallels Server Bare Metal 5.0 server, in kilobytes per second.

• mem

: the total memory consumption on the server.

• ints

: the number of interrupts and context switches on the server per second.

• cpu

: the information on the CPU load on the server.

• net

: the network information for each network interface on the server.

• forks

: the number of copies of all processes made on the server during one second.

By default, all the aforementioned resources except for ve_sum are plotted.

To start analyzing the logs, creating the server 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 Server.

53

Managing Parallels Server Bare Metal 5.0

Backup Configuration File

This file (/etc/vzbackup.conf) is in the same format as the global Parallels Server Bare Metal 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-server configuration file, if the latter exists. Still, other parameters may be further overridden in the configuration file of a particular

Container.

Note: The backup settings in the /etc/vzbackup.conf file do not apply to virtual machines. To configure the backup parameters of virtual machines, use the prlsrvctl utility.

All-server parameters:

Parameter

BACKUP_DIR

BACKUP_TYPE

BACKUP_NODES

BACKUP_MAX_CHLD

BACKUP_MAX_CHLD_CRON

BACKUP_NOTIFY_EMAIL

BACKUP_COMPRESS

Description

The backup directory, i.e. the directory where backups are stored.

Default value

/vz/backup

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

The hostname of the server whose Containers are to be backed up. You can specify several hostnames of your servers and separate them by spaces. If you wish to back up Containers residing on the Backup server itself, you should specify its hostname as the value of this parameter.

The maximal number of servers to back up in parallel for non-periodic backups.

The maximal number of servers to back up in parallel for periodic backups.

1

3

The e-mail addresses where to send notifications about the backing up.

Specifies whether the Containers are to be compressed when being backed up, and with what compression algorithm. When backing up

Containers, you can set this option to one of the following values: none

• 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.

54

Managing Parallels Server Bare Metal 5.0

CRON_BACKUP

• C2

: in this case the Container backup is created with the high level of compression. The size of the resulting 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.

This parameter can be overridden by the -Cg, -Cb,

-Cn

command-line options of the vzbackup utility.

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-server parameters:

Parameter

BACKUP_SSH_OPTS

BACKUP_VESTOP

BACKUP_EXCL_VES

BACKUP_LOADAVG_MAX

BACKUP_FINISH_TIME

BACKUP_LIMIT_TIME

Description

Options which are passed to ssh when it is used.

Default value

-c blowfish

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.

Defines those Containers that are to be excluded from the backup list. Container IDs must be given here.

The maximal loadavg with which backing up is allowed. This parameter is effective only if the -p option is specified with the vzbackup utility.

10 none

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

The number of hours after which the backing up should be stopped and delayed until the next 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

55

Managing Parallels Server Bare Metal 5.0

BACKUP_CHAIN_LEN

An incremental backup parameter. After this number of incremental backups, a full backup is performed.

7

BACKUP_CHAIN_DAYS

An incremental backup parameter. After this number of days a full backup is performed.

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.

3

If you want to rewrite the per-server parameters for a particular Parallels server, you should create a new configuration file named server.conf and put it to the backup directory (defined by the

BACKUP_DIR

parameter in the global backup configuration file.

56

Managing Parallels Server Bare Metal 5.0

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

REDHAT_LOGIN

REDHAT_PASSWORD

HTTP_PROXY

HTTP_PROXY_USER

HTTP_PROXY_PASSWORD

EMAIL

PRE_DOWNLOAD

Description

The user name for logging in to Red Hat Network.

The password of the user specified as the value of the REDHAT_LOGIN parameter.

The hostname or the IP address and the port number of the HTTP proxy server, if you use any to connect to the Internet.

The user name used by the HTTP proxy server for your authentication.

The password of the user specified in the HTTP_PROXY_USER parameter and used for your authentication by the HTTP proxy server.

The destination of all tracebacks.

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.*).

57

Managing Parallels Server Bare Metal 5.0

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

REPO_DIR

CACHE_DISABLE

Description

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.

The IP addresses of the hosts to be excluded from the caching process. It means that the packages requested by servers 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.

58

Managing Parallels Server Bare Metal 5.0

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

VZTT_PROXY

HTTP_PROXY

HTTP_PROXY_USER

HTTP_PROXY_PASSWORD

METADATA_EXPIRE

EXCLUDE

Description

The IP address or hostname of the caching proxy server to be used by the vzpkg

tool for managing OS and application EZ templates.

The IP address or hostname of the HTPP proxy server address, if you use this server.

The user name used by the HTTP proxy server for your authentication.

The password of the user specified in the HTPP_PROXY_USER parameter and used for your authentication by the HTTP proxy server.

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).

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 ?).

Parallels Server Bare Metal Scripts

This section provides information on scrips you can use in Parallels Server Bare Metal 5.0.

59

Managing Parallels Server Bare Metal 5.0

Overview

Along with Parallels Server Bare Metal configuration files responsible for the Parallels Server Bare

Metal system configuration, there are a number of scripts allowing you to customize the behavior of

Containers and virtual machines in different ways. These are the following scripts:

Script Name

/vz/private/CT_ID/scripts/scrip t_name

Description

Container action scripts. These scripts allow you to run userdefined actions on particular events. The currently defined actions are start, stop, mount, unmount.

/etc/vz/conf/dists/scripts/

<script>

/etc/rc.d/init.d/vz

/etc/vmprivate/VM_Name/scripts/ script_name

Scripts to be executed on performing certain Container-related operations (e.g., when adding a new IP address to the

Container). These operations should be specified in the corresponding Linux distribution configuration file.

The Parallels Server Bare Metal start/stop script. This script is responsible for proper Parallels Server Bare Metal startup and shutdown procedures, including modules loading and

Container start/stop procedures.

Virtual machine actions scripts. These scripts allow you to run user-defined actions on particular events. The currently defined actions are start and stop.

60

Managing Parallels Server Bare Metal 5.0

Container 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 server file system (or part of it) from Container 101, then you can bind mount it inside the Container manually from the server.

However, after you restart the Container, your mount disappears, and you should manually type the mount

command again.

Parallels Server Bare Metal allows you to automate procedures like the above by using action

scripts. There are six action scripts defined in the current version of Parallels Server Bare Metal: global mount mount start stop

This script runs immediately after pctl mounts the Container private area. The Container itself is not yet running and the script is running in the server context.

This script runs immediately after the global mount script. The Container is still not running, and the scripts is called in the server context.

After pctl has started a Container, it runs the Container start script. The script is running already in the Container context.

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 server context. global umount

This script runs when pctl is about to dismount the Container private area. It also runs in the servercontext.

It is important to understand how pctl handles exit codes of action scripts. If exit code is nonzero, then pctl will try to undo the action for the mount and start scripts. In other words, if the start

script returns an error, then pctl will stop Container, and if one of the mount scripts fails, then pctl will dismount the Container private area. Please note that in this case pctl will not execute the stop and umount scripts at all.

Caution: When executing pctl start, both mount and start scripts run. However, if the start script fails then neither stop nor umount scripts will run. As a result, pctl 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 pctl.

The global scripts are named vps.mount and vps.umount and located in the /etc/vz/conf directory on the server. These scripts are called when any Container on the server 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:

• /vz/private/101/scripts/mount

61

Managing Parallels Server Bare Metal 5.0

• /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. pctl) 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 pctl 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 information from

/proc

may be not functional.

62

Managing Parallels Server Bare Metal 5.0

Virtual Machine Action Scripts

In Parallels Server Bare Metal 5.0, you can create custom scripts and configure them to run when you start or stop virtual machines. The following custom scripts are currently supported:

prestart: this script is executed before a virtual machine is started.

poststart: this script is executed after a virtual machine is started.

prestop: this script is executed before a virtual machine is stopped.

poststop: this script is executed after a virtual machine is stopped.

Action scripts specific for virtual machines must be placed to the /scripts subdirectory in the virtual machine's home directory. For example, assuming that you created the MyVM virtual machine in the default directory, the paths to the scripts must be as follows:

• /vz/vmprivate/MyVM/scripts/prestart

• /vz/vmprivate/MyVM/scripts/poststart

• /vz/vmprivate/MyVM/scripts/prestop

• /vz/vmprivate/MyVM/scripts/poststop

The information to scripts is passed using the UUID and VM_HOME variables, where UUID is the ID of the virtual machine that is started or stopped and VM_HOME is the full path to the virtual machine directory.

Parallels Server Bare Metal Utilities

This section provides information on utilities that can be used to manage Parallels Server Bare

Metal parameters.

63

Managing Parallels Server Bare Metal 5.0

prlsrvctl

General Syntax

The prlsrvctl command-line utility is used to perform management tasks on the Parallels server and Parallels Server Bare Metal. The tasks include getting the Parallels Server Bare Metal information, modifying its preferences, installing a license, obtaining statistics and problem reports, and some others.

Syntax prlsrvctl command [options] [-l,--login user[:passwd]@server[:port]]

Parameters

Name command options

-l, --login

user

passwd

server:port

Description

The name of the command to execute.

Command options. See individual commands for available options.

Connect to the remote Parallels server and execute a command on it. If this parameter is omitted, the command will be executed on the local server.

The name of the user used to log in to the remote server.

The user password. If the password is omitted, you will be prompted to enter it.

The remote server IP address or hostname and port number, If port number is omitted, the default port will be used.

Remarks

To display help, enter prlsrvctl on the command-line without any parameters.

Links

Legend

(p. 13)

64

Managing Parallels Server Bare Metal 5.0

prlsrvctl info

Displays the Parallels server and Parallels Server Bare Metal configuration information.

Syntax prlsrvctl info

Remarks

The information returned by the info command includes the following:

Server ID and hostname.

Parallels Server Bare Metal version number.

Default directory for storing virtual machine files.

Parallels Server Bare Metal memory limits.

Parallels Server Bare Metal minimum allowable security level.

Default directory for storing virtual machine backups.

Parallels Server Bare Metal license information.

Server hardware configuration information.

Other miscellaneous info.

Links

General Syntax

(p. 64),

Legend

(p. 13)

65

Managing Parallels Server Bare Metal 5.0

prlsrvctl install-license

Installs the Parallels Server Bare Metal license on the Parallels server.

Syntax prlsrvctl install-license -k,--key key [-n,--name name] [-c,--company name]

Parameters

Name

-k, --key key

Description

License key.

-n, --name name

License user name.

-c,--company name

License company name.

Links

General Syntax

(p. 64),

Legend

(p. 13)

prlsrvctl net

The prlsrvctl net command allows to create and configure Parallels virtual networks. The following subsections describe how to perform individual virtual network configuration tasks.

66

Managing Parallels Server Bare Metal 5.0 net add

The prlsrvctl net add command is used to create a new virtual network.

Syntax prlsrvctl net add vnetwork_id [-i,--ifname if] [-m,--mac mac_address]

[

-t,--type bridged|host-only]

[

-d,--description description]

Parameters

Name vnetwork_id

-i,--ifname

if

-m,--mac

mac_address

-t,--type

value

Description

A user-defined name that will identify the new virtual network.

The name of a physical network adapter on the Parallels server to which this virtual network should be bound.

The MAC address of a virtual network adapter on the Parallels server to which this virtual network should be bound.

The type of the virtual network to create. Possible values are:

• bridged

. A virtual machine and Container connected to this type of virtual network appears as an independent computer on the network.

• host_only

(default). A virtual machine and

Container connected to this type of virtual network can access only the Parallels server and the virtual machines and Containers connected to the same virtual network.

A user-defined description of the virtual network.

-d,--description

description

--ip-scope-start IP_address

--ip-scope-end IP_address

Sets the start and end IP addresses for the DHCP pool. The virtual machines and Containers connected to the network you are creating will automatically receive their IP addresses from this

DHCP pool.

Links

General Syntax

(p. 64),

Legend

(p. 13)

67

Managing Parallels Server Bare Metal 5.0 net set

The prlsrvctl net set command is used to modify an existing virtual network.

Syntax prlsrvctl net set vnetwork_id [-i,--ifname if] [-m,--mac mac_address]

[

-t,--type bridged|host-only]

[

-d,--description description]

[

-n, --name new_name]

Parameters

Name vnetwork_id

-i,--ifname

if

-m,--mac

mac_address

-t,--type

-d,--description

description

-n, --name

new_name

Description

The name of the virtual network to modify.

The name of a physical network adapter on the Parallels server to which this virtual network should be bound.

The MAC address of a virtual network adapter on the Parallels server to which this virtual network should be bound.

The type of the virtual network to create. Possible values are:

• bridged

. A virtual machine and Container connected to this type of virtual network appears as an independent computer on the network.

• host_only

. A virtual machine and Container connected to this type of virtual network can access only the Parallels server and the virtual machines and Containers connected to the same virtual network.

A user-defined description of the virtual network.

A new name for the virtual network. Use this parameter if you would like to rename the virtual network.

Links

General Syntax

(p. 64),

Legend

(p. 13)

68

Managing Parallels Server Bare Metal 5.0 net del

The prlsrvctl net del command is used to delete an existing virtual network.

Syntax prlsrvctl net del vnetwork_id

Parameters

Name vnetwork_id

Links

General Syntax

(p. 64),

Legend

(p. 13)

net list

The prlsrvctl net list command lists the existing virtual networks.

Syntax

Description

The name of the virtual network to delete. prlsrvctl net list

Links

General Syntax

(p. 64),

Legend

(p. 13)

69

Managing Parallels Server Bare Metal 5.0

prlsrvctl problem-report

Generates a problem report and displays it on the screen.

Syntax prlsrvctl problem-report

Parameters

The command accepts no parameters.

Remarks

The command collects technical data about Parallels Server Bare Metal and the Parallels server and displays the report on the screen (the output can also be piped to a file). The report can then be directed to the Parallels technical support for analysis.

Links

General Syntax, Legend

(p. 13)

70

Managing Parallels Server Bare Metal 5.0

prlsrvctl set

Allows you to modify Parallels Server Bare Metal preferences.

Syntax prlsrvctl set [--mem-limit auto|size]

[

-s,--min-security-level low|normal|high]

[

-c,--cep on|off]

[

--mng-settings allow|deny]

[{

--device device --assignment host|vm}]

[

--backup-storage user[[:passwd]@server[:port]]]

[

--backup-path path]

[

--default-encryption-plugin plugin-id] |

[

--reset-default-encryption-plugin]

[

--verbose-log on|off] [--cluster-mode on|off]

Parameters

Name

--mem-limit

-s,--min-security-level

-c,--cep

--mng-settings

Description

Sets the upper limit of the memory size that can be reserved for use by virtual machines. The following options are available:

• auto

-- if this option is used, the memory size will be calculated automatically.

• size

-- user-defined memory size, in megabytes.

The lowest allowable security level that can be used to connect to the Parallels server. The following options are available:

• low

-- plain TCP/IP (no encryption).

• normal

-- most important data is sent and received using SSL over TCP/IP (user credentials during login, guest OS clipboard, etc.) Other data is sent and received using plain TCP/IP with no encryption.

• high

-- all of the data is sent and received using SSL.

Enables/disables the participation in the Customer

Experience Program (CEP). The following options are available:

• on

-- enables CEP.

• off

-- disables CEP.

Allows to grant or deny permission to new users to modify

71

Managing Parallels Server Bare Metal 5.0

--device

device --assignment

--backup-storage

Parallels Server Bare Metal preferences. By default, only administrators of the host OS can modify Parallels Server

Bare Metal preferences. When a new user profile is created (this happens when a user logs in to the Parallels server for the first time), he/she will be granted or denied this privilege based on the default setting. This parameter allows you to set that default setting. Please note that this parameter only affects new users (the users that will be created in the future). The profiles of the existing users will not be modified.

Allows to set the assignment mode for the specified VTd device. The following options are available:

• host

-- assign the device to the Parallels server.

• vm

-- assign the device to virtual machines.

The default backup server where to store virtual machine backups.

The name of the user on the backup server.

The user password.

The backup server IP address or hostname.

user

passwd

server

port

--backup-path

path

The port number. If omitted, the default port number is used.

The name and path of the default directory on the backup server where to store virtual machine backups.

--default-encryption-plugin plugin-

id

Set the default encryption plug-in that will be used to encrypt virtual machines.

--reset-default-encryption-plugin

Reset the encryption plug-in settings. Virtual machines will be encrypted using the built-in encryption module.

--verbose-log on|off

Turns the verbose output the command on or off.

--cluster-mode on|off

Turns the cluster mode on or off.

Links

General Syntax, Legend

(p. 13)

72

Managing Parallels Server Bare Metal 5.0

prlsrvctl shutdown

Shuts down the Parallels Server Bare Metal component responsible for managing virtual machines and Containers. No operations on virtual machines and Containers are possible.

Syntax prlsrvctl shutdown [-f,--force]

Parameters

Name

-f, --force

Description

Specifies whether the shutdown operation should be forced. If one or more virtual machines and Containers are running, clients are connected, or some tasks are currently in progress, then forcing the shutdown will stop all processes automatically and will shut down the

Parallels Server Bare Metal component.

Links

General Syntax, Legend

(p. 13)

prlsrvctl statistics

Obtains Parallels Server Bare Metal statistics.

Syntax prlsrvctl statistics [-a, --all] [--loop] [--filter name]

Parameters

Name

-a, --all

Description

This parameter is not currently used.

--loop

--filter name

Subscribes to receive statistics on the periodic basis. Once you execute the command with this option, the statistics will be displayed in your console window every time a new set of values is collected. To unsubscribe, press the Enter key or Ctrl-C in your console window.

This parameter is not currently used.

Links

General Syntax, Legend

(p. 13)

73

Managing Parallels Server Bare Metal 5.0

prlsrvctl usb

The prlsrvctl usb command is used to permanently assign a USB device to a specific virtual machine. A permanently assigned USB device will be connected to the virtual machine automatically on server restart. This functionality works only with virtual machines (not Containers).

The following subcommands are available:

Subcommand usb list

(p. 75)

usb set

(p. 76)

usb del

(p. 76)

Description

Lists USB devices connected to the server together with the information about their virtual machine assignments for the current user.

Permanently assigns a USB device to the specified virtual machine.

Removes a previously created USB device assignment.

74

Managing Parallels Server Bare Metal 5.0 usb list

The prlsrvctl usb list command is used to obtain a list of USB devices connected to the physical server.

Syntax prlsrvctl usb list

Parameters

None

Returns

A list of USB devices in tabular format with the following columns:

Name -- the USB device name.

ID -- a string that uniquely identifies the USB devices on the physical server. The ID never changes even if the device is disconnected from the server and then reconnected again. Please note that if a device ID is listed in quotes, they are a part of the ID and must be included in other calls that use it as an input parameter.

VM UUID -- a universally unique ID of the virtual machine to which this USB device is permanently assigned. If a USB device is not assigned to any virtual machine, this column will be empty.

Links

General Syntax

(p. 64),

Legend

(p. 13)

75

Managing Parallels Server Bare Metal 5.0 usb set

The prlsrvctl usb set command is used to permanently assign a USB device to the specified virtual machine. A permanently assigned USB device will be connected to the virtual machine automatically on server restart. The USB device assignment is performed for the current user only. Other users may create their own USB device assignments. This functionality works only with virtual machines (not Containers).

Syntax prlsrvctl usb set usb_dev_id {vm_uuid | vm_name}

Parameters

Name usb_dev_id vm_uuid vm_name

Description

The USB device ID. To obtain the list of USB devices connected to the server use the usb list command

(p. 75).

The universally unique ID of the virtual machine to which to assign the USB device.

The virtual machine name.

Links

General Syntax

(p. 64),

Legend

(p. 13)

usb del

The prlsrvctl usb del command is used to remove a USB device assignment previously created with the usb set call

(p. 76). The USB device assignment is performed on the user level,

so if you remove an assignment, it will only be removed for the current user. Other users may have their own USB devices assignments, which will not be affected.

Syntax prlsrvctl usb del usb_dev_id

Parameters

Name usb_dev_id

Description

The USB device ID. To see the current USB device assignments for the current user use the usb list command

(p. 75).

Links

General Syntax

(p. 64),

Legend

(p. 13)

76

Managing Parallels Server Bare Metal 5.0

prlsrvctl user list

Displays the list of Parallels Server Bare Metal users (only those users are displayed who created at least one virtual machine and Container).

Syntax prlsrvctl user list [-o,--output name[,name...]]

Parameters

Name

-o,--output name

Description

Fields to include in the output. The following fields are available:

• name

-- User name.

• mng_settings

-- Indicates whether the user is allowed to modify Parallels Server Bare Metal preferences.

• def_vm_home

-- The user default virtual machine folder.

The fields must be specified using the lower case letters.

See Also prlsrvctl user set

(p. 78)

Links

General Syntax, Legend

(p. 13)

77

Managing Parallels Server Bare Metal 5.0

prlsrvctl user set

Allows to modify the profile of a Parallels Server Bare Metal user.

Syntax prlsrvctl user set name|uuid [--def-vm-home path]

[

--mng-settings allow|deny]

Parameters

Name name

Description

The user name. uuid

--def-vm-home path

--mng-settings

The user UUID (universally unique ID).

The default virtual machine and Container directory name and path.

Specifies whether the user should be allowed to modify Parallels Server

Bare Metal preferences. The available options are:

• allow

• deny

See Also prlsrvctl user list

(p. 77)

Links

General Syntax, Legend

(p. 13)

privnet

The prlsrvctl privnet command is used to manage IP private networks on Parallels Server.

78

Managing Parallels Server Bare Metal 5.0 add

The prlsrvctl privnet add command is used to create a new IP private network.

Syntax prlsrvctl privnet add private_network_id [-a,--ipadd addr[/mask]]

Parameters

Name

private_network_id

-a,--ipadd addr/mask

Description

User-defined private network ID.

Add an IP subnet to the private network. The network can have multiple subnets.

Links

General Syntax

(p. 64),

Legend

(p. 13)

set

The prlsrvctl privnet set command is used to modify an existing IP private network.

Syntax prlsrvctl privnet set private_network_id [-a,--ipadd addr[/mask]]

[

-d,--ipdel addr[/mask]]

Parameters

Name

private_network_id

-a,--ipadd

addr/mask

-d,--ipdel

addr/mask

Description

The private network ID.

Add an IP subnet to the private network. The network can have multiple subnets.

Delete the specified IP subnet from the private network.

Links

General Syntax

(p. 64),

Legend

(p. 13)

79

Managing Parallels Server Bare Metal 5.0 del

The prlsrvctl privnet del command is used to delete an IP private network from the

Parallels Server.

Syntax prlsrvctl privnet del private_network_id

Parameters

Name

private_network_id

Description

The ID of the private network to delete.

Links

General Syntax

(p. 64),

Legend

(p. 13)

list

The prlsrvctl privnet list command is used to obtain the list of IP private networks that exist on the Parallels Server.

Syntax prlsrvctl privnet list

Parameters

The command takes no parameters.

Links

General Syntax

(p. 64),

Legend

(p. 13)

80

Managing Parallels Server Bare Metal 5.0

vzup2date

The vzup2date utility is used to update your Parallels Server Bare Metal software and templates and keep them at the most recent version. It has the following syntax: vzup2date [-s|-z] [-m interactive] vzup2date [config_options] [-s|-z] -m {batch|messages} \

<command> [command_options] [filters] [update_IDs] vzup2date {-?|--help}

The vzup2date utility can be launched in two modes:

In the graphical mode: in this case vzup2date should be used with the -s and -z switches only or without any parameters at all. You can also specify the -m interactive switch to explicitly indicate that vzup2date is to be run in the graphical mode.

In the command-line mode containing two submodes: the batch submode and the messages submode. To run vzup2date in the command-line mode, you should specify either the -m batch

switch or -m messages switch for executing vzup2date in the batch or messages submodes, respectively. Both submodes are meant to update Parallels Server Bare Metal in the unattended mode and have the identical syntax; however, they are different in their output. The batch submode output is more user friendly than the messages submode one which is mostly suitable for machine processing.

The following options can be passed to vzup2date in both modes - graphical and command-line:

Name Description

-s, --system

-z

Used to check and, if necessary, download and install Parallels Server Bare

Metal system updates, i.e newest versions of the Parallels Server Bare Metal core and utilities. If the -s is omitted and the -t option is not specified either, the vzup2date utility looks for the Parallels Server Bare Metal system updates.

Used to check and, if necessary, download and install OS and application EZ templates. You should explicitly specify this option to make vzup2date look for EZ template updates.

81

Managing Parallels Server Bare Metal 5.0

Setting Connection Parameters

If you have not set the necessary connection parameters for the repository with Parallels Server

Bare Metal updates in the /etc/sysconfig/vzup2date/vzup2date.conf file on the server or wish to redefine any of them, you may specify the following options:

Name

-R,

--repository=path

--proxy=path

--local-path=path

--log-path=path

--save-config

Description

The URL used to connect to the repository with Parallels Server Bare Metal updates. The path value should be specified in the form of

[protocol://][user:password@]server[:port][/repository

_dir]

where:

• protocol

indicates what protocol is to be used while connecting to the update server (e.g. http or https).

• user:password

denotes the user name and password used to access the update server.

• server

is the IP address or the domain name where the update repository is located.

• port

denotes the port number of the update server used for establishing the connection.

• repository_dir

specifies the directory on the update server where the required Parallels Server Bare Metal updates are stored.

The proxy server address, if you use this server. The path value should be specified in the form of

[protocol://][user:password@]server[:port]

where

• protocol

indicates what protocol to use while connecting to the proxy server (e.g. http or https).

• user:password

denotes the user name and password used to log it to the proxy server.

• server

is the IP address or the domain name of the proxy server.

• port

specifies the port number of the proxy server used for establishing the connection.

The path to the local directory on the server where the downloaded Parallels

Server Bare Metal updates are stored.

The path to the log file on the server containing the information on Parallels

Server Bare Metal updates.

Use this option to save the specified parameters in the

/etc/sysconfig/vzup2date/vzup2date.conf

file on the server.

82

Managing Parallels Server Bare Metal 5.0

Available Commands

The commands that can be used with vzup2date in the command-line mode (i.e. while specifying either the -m batch switch or the -m messages switch) are given in the table below:

Name list show get install showconf

Description

Lists the updates matching the criteria specified in [filters] and

[update_IDs]. Detailed information on filters and update IDs is given below.

If no filters and update IDs are specified, all updates for the OS and application templates installed on the server are displayed.

Displays detailed information on the updates matching the criteria specified in

[filters], and [update_IDs]. If no filters and update IDs are specified, information on updates for all OS and application templates installed on the server is shown.

Checks and downloads Parallels Server Bare Metal updates matching the criteria specified in [filters], and [update_IDs] from the Parallels update server to the local directory on the server. The path to the local directory can be set either in the /etc/sysconfig/vzup2date/vzup2date.conf file or by specifying the --local-path option. If no filters and update IDs are specified, updates for all OS and application templates installed on the server are downloaded to the local directory.

Checks and, if necessary, downloads and installs Parallels Server Bare Metal updates matching the criteria specified in [filters], and [update_IDs]. If no filters and updates IDs are specified, updates for all OS and application templates on the server are downloaded and installed.

In some cases, you may need to update the vzup2date utility itself. To do this, pass the --self-update option to the vzup2date install command.

Shows the contents of the

/etc/sysconfig/vzup2date/vzup2date.conf

file on the server. install-self-update update_ID

Installs updates with the specified ID for the vzup2date utility. You may need to update vzup2date before you are able to get the latest Parallels

Server Bare Metal updates. To display the latest updates for vzup2date, you can use the vzup2date get command.

All the aforementioned commands (except for showconf and install-self-update) can be used with the following options:

Name

--cache

--nosignatures

--status-logfile=path

Description

If specified, vzup2date does not search the update server for the update packages that are already available in the local repository directory on the server. When used with the vzup2date install command, vzup2date does not check the integrity of the update files located in the local repository directory.

If specified, vzup2date does not validate digital signatures of the downloaded update packages.

The path to the status log file where the messages on Parallels Server Bare

Metal updates will be stored (e.g. /vz/vzup2date/my_file.log).

Without specifying this option, the messages are sent to stdout only. The option can be used in the messages submode only.

83

Managing Parallels Server Bare Metal 5.0

--status-logprog=path

The path to the status log program. This program should accept log messages sent to stdout. The option can be used in the messages submode only.

--status-log-id=ID

The ID assigned to the status log file and unique within the given system. This

ID will be used as the name of the log file with the .log extension created during the vzup2date command execution. By default, this file is located in the /vz/vzup2date/ipc directory on the server. The option can be used in the messages submode only.

Note: The vzup2date install command has a number of additional options described in the vzup2date install subsection

(p. 87).

84

Managing Parallels Server Bare Metal 5.0

Update Filters and Update IDs

The vzup2date utility allows you to specify what particular Parallels Server Bare Metal updates should be searched for on the update server, download the found updates, and install them on the server. This can be done by using special update filters or by explicitly specifying the update IDs.

You can also combine both methods to get the right updates for your Parallels Server Bare Metal installation.

The filters that can be used with vzup2date can be divided in two groups:

The filters used to update Parallels Server Bare Metal system files. They are presented in the table below:

Name Description

--major

--core

--tools

Selects the latest major update for your current Parallels Server Bare Metal installation. To see what latest update is available, you can use the vzup2date list

or vzup2date show commands. If you do not specify an update ID for the major Parallels Server Bare Metal update, your installation will be automatically updated to the latest Parallels Server Bare

Metal version available on the Parallels update server.

Bear in mind that the major Parallels Server Bare Metal release you are updating to might also already have available minor updates (i.e. updates for the Parallels Server Bare Metal core and tools). However, they will not be applied during the major Parallels Server Bare Metal update. Thus, to install the latest Parallels Server Bare Metal version and then to apply minor updates for it, you will need to launch the utility twice.

Selects updates available for your current Parallels Server Bare Metal core.

While working with the Parallels Server Bare Metal core updates, keep in mind the following:

Each Parallels Server Bare Metal release has its own set of core updates. Therefore, the update to the latest core version is possible only within the given Parallels Server Bare Metal release.

Core updates are cumulative, i.e. the updates with higher versions include the functionality of all previous core updates within the given Parallels Server Bare Metal release (e.g. the CU-

2.6.20

core update includes all functionality of CU-2.6.18,

CU-2.6.16

, etc.).

Only the updates for the core version currently installed in your system are shown. For example, if your system is running the 2.6 core version, all core updates for 2.6 will be shown.

Selects updates available for your current Parallels Server Bare Metal utilities.

While working with Parallels Server Bare Metal tools updates, keep in mind the following:

Each Parallels Server Bare Metal release has its own set of utility updates. Therefore, the update to the latest utility version is possible only within the given Parallels Server Bare Metal release.

As distinct from the Parallels Server Bare Metal core updates, utility updates are incremental, i.e. they include the new

85

Managing Parallels Server Bare Metal 5.0 functionality only.

The filters used to update EZ templates. These are the following filters:

Name

--update-os

Description

Selects updates for all OS templates installed on the server.

--all-os

--update-appfor=OS_List

--update-app

--all-appfor=OS_List

--all-app

--update

Selects all OS templates available on the Parallels update server.

Selects updates for all application templates included in the specified OS templates.

Selects updates for all application templates on the server.

Selects all application templates available on the update server for the specified OS templates.

Selects all application templates for all OS templates installed on the server.

Selects updates for all OS and application templates installed on the server.

86

Managing Parallels Server Bare Metal 5.0

vzup2date install

The vzup2date install command is used to install new OS and application templates on the server or to update any of the existing OS and application templates already installed on the server.

It has the following syntax: vzup2date [config_options] [-s|-t|-z] -m {batch|messages} install\

[options] [filters] [update_IDs]

Along with the options which are common for all vzup2date commands and described in the previous subsection, you can also use the following options with vzup2date install:

Name

--reboot

--loader-autoconfig

[=bootloader]

--self-update

--novzpkgcache

Description

Automatically reboots the server, if needed, after the Parallels Server Bare

Metal update completion. For example, the system reboot may be required in the case of updating the Parallels Server Bare Metal core or installing major updates on the server. If the option is omitted, the system will not reboot.

Automatically recognizes and reconfigures the Lilo and GRUB boot loaders after the Parallels Server Bare Metal update completion. You can explicitly specify what boot loader is to be reconfigured by specifying either GRUB or

Lilo

as the value of bootloader.

Automatically updates the vzup2date utility. If an updated version of vzup2date

is available, this version is downloaded and installed on the server at first. After that, the command is re-launched and the Parallels

Server Bare Metal system update is performed.

Do not run the vzpkgcache utility in case of standard OS templates and the vzpkg create cache utility in case of EZ OS templates. By default, a tarball (cache) is automatically created for every OS template or its update installed on the server by using the vzup2date install command.

87

Managing Parallels Server Bare Metal 5.0

vzup2date-mirror

The vzup2date-mirror utility is used to create local mirrors of the Parallels official repository storing the latest versions of the Parallels Server Bare Metal software and OS and application templates. The vzup2date-mirror utility has the following syntax: vzup2date-mirror [options] [local_repo_path]

You can pass the following options to vzup2date-mirror:

Name Description

-s, --system

Creates a local mirror of the repository storing the latest versions of the

Parallels Server Bare Metal core and utilities. It also can be used to update your existing local mirror.

-z, --eztemplates

Creates a local mirror of the repository storing the latest versions of OS and application EZ templates.

-c, --config

The full path to the configuration file that will be used by vzup2datemirror

on the step of connecting to the Parallels official repository and downloading new updates. If omitted, the utility uses the default vzup2date-mirror.conf

file which is located in the /etc/vzup2datemirror

directory. local_repo_path

If this option is not specified and the -z option is omitted, vzup2datemirror

will also make the repository mirror with Parallels Server Bare Metal system files.

The path to the repository mirror. If omitted, the utility uses the repository mirror whose location is defined in the vzup2date-mirror configuration file. Detailed information on vzup2date-mirror.conf is provided in the

Configuration File for vzup2date-mirror subsection

(p. 38).

-q, --quiet

Reports only errors during the vzup2date-mirror execution.

-D, --delete

--version

-h, --help, -?

Automatically deletes obsolete updates during the vzup2date-mirror execution.

Prints the utility version and exits.

Displays the utility usage and exits.

When executed, the vzup2date-mirror utility completes a number of tasks (connects to the

Parallels official repository, creates a special directory and downloads the specified Parallels Server

Bare Metal system or templates updates to this directory, etc.) resulting in building a local mirror of the Parallels official repository or some of its parts.

88

Managing Parallels Server Bare Metal 5.0

vzlicload

This utility is used to manage Parallels Server Bare Metal licenses on your server. It has the following syntax: vzlicload [options]

The utility accepts the following options:

-p, --product-key

-f, --license-file

<file_path>

-r, --remove

-i, --stdin

-h, --help

Installs the Parallels Server Bare Metal license on the server.

The full path to the license file containing the license to be installed on the server.

Removes the license with the specified serial number from the server. You can find out the license serial number using the vzlicview

utility (see the vzlicview subsection

(p. 91) for

details).

Makes vzlicload use standard input as a license.

Prints the usage help and exits.

89

Managing Parallels Server Bare Metal 5.0

vzlicupdate

This utility can be used to perform the following license-related operations:

Activate your Parallels Server Bare Metal installation using a special activation code.

Update the currently installed license on the server.

Transfer the license installed on the Source Server with the help of an activation code to the

Destination Server.

The vzlicupdate utility has the following syntax: vzlicupdate [options]

The utility accepts the following options:

-a, --activate activation_code

-t, --transfer

-s, --server

hostname[:port]

-n, --no-check

-v, --verbose

-h, --help

Activates the Parallels Server Bare Metal installation using the specified activation code. To successfully complete this task, your server must be connected to the Internet.

Transfers the license activated with the activation code from the Source

Server to the Destination Server. Should be run along with the -a option on the Destination Server, i.e. on the server where you are planning to transfer the license.

The hostname of the Parallels Key Authentication (KA) server responsible for updating Parallels Server Bare Metal licenses, activating Parallels

Server Bare Metal installations, and transferring licenses from the Source

Server to the Destination Server. If not specified, the ka.parallels.com

hostname is used.

Updates the license currently installed on the server even if it is still valid.

Sets the log level to its maximum possible value.

Prints the utility usage and exits.

When executed without any options, vzlicupdate updates the license currently installed on the server. However, you can use the options listed in the table above to complete other license-related tasks.

90

Managing Parallels Server Bare Metal 5.0

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>

-f, --license-file <file>

-i, --stdin

-h, --help

Displays the license information contained in the specified

Parallels Server Bare Metal product key.

Displays the license information from the specified Parallels Server

Bare Metal license file.

Makes vzlicview use standard input as a license and display its information.

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 server. The utility can report the following statuses for Parallels Server

Bare Metal licenses:

ACTIVE

VALID

EXPIRED

GRACED

INVALID

The license installed on the server is valid and active.

The license the utility parses is valid and can be installed on the server.

The license has expired and, therefore, could not be installed on the server.

The license has been successfully installed on the server, but it has expired and is currently on the grace period (i.e. it is active till the end of the grace period).

The license is invalid (for example, because of the server architecture mismatch) or corrupted.

91

Managing Parallels Server Bare Metal 5.0

vznetcfg

The vznetcfg utility is used to manage the following network devices on the server:

• physical and VLAN (Virtual Local Area Network) adapters

Virtual Networks (VNs) vznetcfg

has the following syntax: vznetcfg command

Where command can be one of the following:

Name net new <VN_name> net addif

<VN_name>|<interface_name>

Description

Creates a new Virtual Network with the name of <VN_name> on the server.

Connects a network device with the name of

<interface_name>

to the Virtual Network having the name of <VN_name>. You can join the following network devices to the Virtual Network:

• physical network interface cards (NICs) installed on the server

VLAN adapters bound to NICs on the server net delif

<interface_name> net change

<old_VN_name> <new_VN_name>

Disconnects a network device (either a NIC or a VLAN adapter) with the name of <interface_name> from the corresponding Virtual Network.

Changes the Virtual Network name from

<old_network_ID>

to <new_VN_name>. net del <VN_name>

Removes the Virtual Network with the name of <VN_name> from the server. vlan add <parent_interface>

<index_number>

Creates a new VLAN adapter, associates it with the VLAN ID of <index_number> (where <index_number> can be an arbitrary integer number to be used to uniquely identify the

VLAN among other VLANs on the server), and ties it to the

<parent_interface>

physical network adapter on the server. vlan del <vlan_adapter_name>

Removes the VLAN adapter with the name of

<vlan_adapter_name>

from the server. if list

Note: A VLAN adapter name is automatically generated by Parallels Server Bare Metal on the basis of the VLAN ID and the name of the physical adapter you specified during the VLAN adapter creation (e.g. eth0.1). You can find out the VLAN name using the vznetcfg if list command.

Lists detailed information on all network devices (NICs, VLAN adapters, etc.) available on the server.

92

Managing Parallels Server Bare Metal 5.0 net list init all down all

Displays detailed information on the Virtual Networks currently existing on the server.

Initializes all interfaces (e.g. VLANs and bridges) listed in the

/etc/vz/vznet.conf

file on the server. You may wish to make use of this command when creating startup scripts.

Disables all interfaces (e.g. bridges and VLANs) listed in the

/etc/vz/vznet.conf

file on the server.

vzreport

vzreport

is used to compile a problem report and to automatically send it to the Parallels support team. It has the following syntax: vzreport [options]

The following command-line options can be used with the vzreport utility:

Name

-h, --help

-q, --quiet

-p, --progress

-n, --name name

-c, --company company

-e, --email e-mail_address

-s, --subject subject

-m, --description problem_description

Description

Print usage information.

Quiet mode. Print error messages only.

Causes vzreport to print additional information on its progress.

The name of the person submitting the problem report.

The name of the company where the person is working.

The e-mail address to be used to contact the person generating the problem report.

The main subject of the problem report.

Additional information which, in your opinion, can help solve the problem.

When launched without any options, the vzreport utility starts in the full screen mode; however, you can force it to run in the command line mode by specifying an option containing either your contact information (e.g. -n denoting your name) or the problem report description (e.g. -m used to provide additional information on your problem). Moreover, if you have specified at least one option with your contact information and/or problem description, you should also indicate all the other options.

93

Managing Parallels Server Bare Metal 5.0

vzstatrep

vzstatrep

is run on the Monitor Server and used to analyze the logs collected by the vzlmond daemon on one or more servers to generate statistic reports and graphics on the basis of the gathered logs, and to send these reports and graphics to the server administrator's e-mail address(es). The vzstatrep utility has the following syntax: vzstatrep [options]

The following command-line options can be passed to vzstatrep:

Name

--plot

Description

Generate graphics for the resources parameters specified as the values of the

STATS_PLOT

parameter in the /etc/vzstatrep.conf file on the Monitor

Server.

--sendmail

--sendmailto mail

Send the statistic report and graphics to the e-mail address specified as the value of this option. You can set several e-mail addresses and separate them by spaces. If the --sendmail option is omitted, you should obligatorily use this option.

--weekly

Generate statistic reports and graphics on a weekly basis. By default, vzstatrep

analyzes the logs and produces the server resources statistics once a day.

--nodes hostname

Send the statistic report and graphics to the e-mail address(es) specified as the value(s) of the STATS_EMAIL parameter in the /etc/vzstatrep.conf file on the Monitor Server. If the --sendmailto option is omitted, you should obligatorily use this option.

Analyze the logs from the server whose IP address or hostname is specified as the value of this option. You can set several servers by separating them by spaces and enclosing them in quotes (e.g. "my_hardware_node1 my_hardware_node2"

). If the option is omitted or its value is not specified, the logs from the servers set as the values of the NODES parameter in the

/etc/vzstatrep.conf

file on the Monitor Server are analyzed.

The vzstatrep utility generates statistic reports and graphics on the basis of the logs gathered by vzlmond

(by default, the logs are stored in the /var/log/vzstat directory on the server) and containing information on the memory and CPU consumption of the server, network resources on the server, etc. You do not need to perform any additional operations to start using vzstatrep.

All the necessary parameters can be set during the vzstatrep execution by using the aforementioned options. However, if you wish to run the vzstatrep utility as a cron job and/or free yourself from the necessity to manually specify the needed options each time you wish to run vzstatrep

, you should edit the /etc/vzstatrep.conf configuration file on the Monitor Server and set the parameters values contained in this file. Detailed information on the

/etc/vzstatrep.conf

file is provided in the vzstatrep Configuration File subsection

(p. 52).

94

Managing Parallels Server Bare Metal 5.0

pstat

This utility is for real-time monitoring in Parallels Server Bare Metal. It displays the status and load of the system pertaining to its disk, network, CPU, and memory (including swap) parameters, updating this status with the preset time interval. It also provides a list of running virtual machines and Containers together with their resources consumption statistics, and can sort this list by a number of parameters. The utility has an interactive interface for setting the mode of displaying the information.

The syntax of the pstat utility is the following: pstat [-l] [-d X] [-p CT_ID] [-b|-v] [-t] [-a]

Here is the description of the command-line parameters:

-l

-d

-p

-b

-v

-t

-a

-i

-m

-o

-O

-n

-s

-c

Print information once and exit immediately.

Specify the delay between screen updates. Can be changed on the fly by the t interactive command. Default is 1 sec.

Monitor only Containers with the specified CT_IDs. This flag can be given up to twenty times, in form -p CT_ID1 -p CT_ID2 .... This option is not available interactively.

"Brief" mode. Minimal details level. Shows only one summary line about each monitoring subsystem. By default, "standard" details level is in use. Valid levels are "brief", "standard" and "verbose". Can be set on the fly by the b interactive command. See also the -v command-line option and s and v interactive commands.

"Verbose" mode. Provides maximum details about all monitored subsystems. Can be set on the fly by the v interactive command. See also the -b command-line option and b and s interactive commands.

Text mode, provides information once. It is printed in terse form, suitable for parsing by other programs. All output data are not aligned and numbers are not in a human readable format. In the text mode, there are no colors in the output and only the top 10 Containers sorted by their CPU usage are shown.

Display the current disk input and output (I/O) statistics for virtual machines and Containers.

Display the IO accounting information for virtual machines and Containers.

Display disc statistics for all file system types. By default, the statistics is shown for ext2, ext3, ext4, and reiserfs.

Filter the output by the specified parameters. You can specify multiple parameters and separate them by commas. The list of available parameters is given below.

Filter the output by the specified parameters. Unlike the -o option, the produced output already contains some default columns (for example, Container ID and IP address). The list of available parameters is given below.

Display network statistics.

Filter the output by the specified keys. The list of available parameters is given below.

Display I/O statistics in the specified units of measurement: B (bytes), K (kilobytes), M

(megabytes), or G (gigabytes). pstat

can display the following information:

95

Managing Parallels Server Bare Metal 5.0

Type of

Information

Uptime

Containers and processes

CPU states

Mem

Memory zones information

Memory zones fragmentation

Memory allocation latency

Description Example Toggling by l This line displays the time for which the system has been up, and three "load averages" for the system. The load averages are the average number of processes ready to run during the last 1, 5, and 15 minutes. This line is just like the output of uptime(1).

Total number of virtual machines and

Containers and processes running at the time of the last update. The output is also broken down into the number of tasks which are running, sleeping, uninterruptable, zombie, or stopped.

1:22am, up 1:31, 2 users, load average:

0.00, 0.06, 0.33

CTNum 102, procs 467: running 12, sleeping

455, unint 0, zombie

0, stopped 0 p

Shows the percentage of CPU time used by all virtual machines and Containers and by the server (shown as CT0), the CPU time spent in the user mode, in the system mode, and being idle, and the maximal/average scheduling latency in ms. The scheduling latency is the time spent by the processes in the system awaiting for scheduling.

CPU [ OK ]: CTs 43%,

CT0 12%, user 41%, sys 13%, idle 45%, lat(ms) 3/2 c

Statistics on the memory usage, including the total available memory, free memory, and maximal/average memory allocation latency.

The free memory is displayed both for the low and high memory. The low memory is the sum of the DMA and Normal zones memory and the high memory is the High zone memory.

Memory allocation latency is the time required to allocate memory inside the kernel in ms. An excessive allocation latency can be a sign of server's overload.

Mem [ OK ]: total

755MB, free 671MB/0MB

(low/high), lat(ms)

10/7.

m, M

Information on the memory zones state. This information includes: the total size of the memory zone in MB, the size of active and inactive lists, of the free memory and zone limits.

Information on the memory zones fragmentation. This information describes how much system memory is fragmented and which is the biggest block size possible to allocate atomically. The first number before * is a number of blocks and the second is a block size in pages.

ZONE1 (Normal): size

752MB, act 29MB, inact 31MB, free

658MB (0/1/2) fragm 2*1 3*2 15*4

22*8 25*16 12*32 4*64

0*128 1*256 326*512".

m, M m, M

Memory allocation latency is an average time spent in the kernel memory allocator for different memory type requests. Any memory type is coded as XY, where X is A for

GFP_ATOMIC, K for GFP_KERNEL and U for

GFP_USER, and Y denotes the allocation request order, i.e. Y=0 for order=0 and 1 for order=1.

Mem lat (ms): A0 0,

K0 0, U0 1, K1 3, U1

2 m, M

Slab cache information includes: the total slab Slab pages: 13MB/13MB m, M Slab cache

96

Managing Parallels Server Bare Metal 5.0 information

Swap

Swap latency

Swap cache

Network information

Network interface information

Disks statistics cache size/real cache size divided into the inode cache size, dentry cache size, buffer heads cache size and page beancounters cache size. The real cache size is the size to which the cache can be shrunk, i.e. it is always less than the total cache size.

(ino 8MB, de 1MB, bh

1MB, pb 0MB)

Statistics on the used swap space, including the total swap space, the available swap space and the speed of swap-in/swap-out activity in

MB/s.

Swap [ OK ]: tot

1004MB, free 1004MB, in 0.000MB/s, out

0.000MB/s

Swap operations latency. This includes the swap-in count, the swap-in maximal/average latency in ms, the swap-out count, the swapout maximal/average latency in ms, and the maximal/average CPU time spent for the swap-out. w, W

Swap lat: si 0, 0/0 ms, so 0, 0/0 ms, 0/0 cpu ms w, W

Swap cache information includes the number of addition, deletion, and find operations respecting the swap cache.

Swap cache: add 0, del 0, find 0/0 w, W n, N

Network statistics summary includes the total incoming traffic speed in MB/s and incoming packets/s, and outgoing traffic speed in MB/s and outgoing packets/s.

Net [ OK ]: tot in

1.020MB/s 267pkt/s, out 0.001MB/s 1pkt/s

Provides the network statistics summary for a particular Ethernet interface, including its total incoming traffic speed in MB/s and incoming packets/s, and outgoing traffic speed in MB/s and outgoing packets/s. eth0: in 0.000MB/s

3pkt/s, out 0.001MB/s

1pkt/s n, N

Disks statistics summary including the writing and reading activity in MB/s.

Disks [ OK ]: in

0.000MB/s, out

0.000MB/s d, D

Mounted disks statistics d, D

Disk I/O statistics

Information on the mounted disks such as their mount point, free space, and free inodes left on the device. root(/) free:

3489MB(46%),

511077ino(52%)

Shows disk input and output statistics for virtual machines and Containers. The following statistics is displayed:

IOUSED%

5.00

• IOUSED%

: the percentage of time the disks are used by the virtual machine or Container.

IOWAIT%

0.00

A

• IOWAIT%

: the percentage of time when at least one I/O transaction in the virtual machine or Container is waiting for being served.

IOSPEED

2/100MB/s

• IOSPEED

: the current speed of disk

I/O operations in the virtual machine or Container and the I/O limit set for this virtual machine or Container, if any. The value can be displayed in bytes, kilobytes, megabytes, or gigabytes per second, depending on

97

Managing Parallels Server Bare Metal 5.0 the units you used to set the I/O limit.

Quite a number of single-key interactive commands can be used while pstat is running to change the way the utility displays information. The commands are not available if pstat runs with the -t or -l command-line option. These interactive commands are the following: d, D

0 o

I

X e i l p

Key h, ?

Action

Print a help screen. space

Update display immediately. q

Quit. t

Change the delay between screen updates. You will be prompted to enter new delay time, in seconds. Entering 0 causes continuous updates. See also the -d command-line parameter. b

Set the "brief" details level. See also the -b command-line parameter. s

Set the "normal" details level. v

Set the "verbose" details level. See also the -v command-line parameter. a

"Averaged" mode. Monitoring parameters will be averaged through a minute. This includes: 1.

Number of uninterruptable processes; 2. Scheduling max latency; 3. Memory allocation max latency; 4. Size of free/active/inactive memory; 5. Swap-in latency; 6. UBC fail-counters absolute values.

Toggle display of virtual machine and Container IP addresses/hostnames.

Toggle display of idle virtual machines and Containers.

Toggle display of load average.

Toggle display of processes statistics. c w m, M

Toggle display of CPU usage statistics.

Toggle display of swap information.

Toggle/expand display of memory information. Each subsystem, including memory, network and disk has a number of verbosity levels. In the minimal level no information is displayed.

Corresponding interactive lowercase key decreases verbosity level, the same key in uppercase increases it. n, N

A

Toggle/expand display of network statistics.

Toggle display of disk input and output statistics for virtual machines and Containers.

Toggle display of input and output accounting for virtual machines and Containers.

Toggle display of network statistics for virtual machines and Containers.

Toggle/expand display of disk usage and activity information.

Toggle display of statistics for the server itself.

Sort key. You can use one of the following sort option keys: n

Sort by Container ID

98

Managing Parallels Server Bare Metal 5.0 c

Sort by CPU usage f

Sort by UBC failure counters r

Sort by the number of running processes p Sort by the total number of processes t Sort by virtual machine or Container status. virtual machines and Containers which probably are unusable or unstable (increasing UBC failure counters or very high scheduling latency) will be shown first. s Sort by the number of open sockets m Sort by memory latency v Sort by virtual memory usage k Sort by kernel memory usage

99

Managing Parallels Server Bare Metal 5.0

You can use the following parameters with the -o, -O, and -s options to filter the information related to virtual machines and Containers:

Parameter Name id st vm

Column Name

CTID

ST

%VM

Description virtual machine or Container ID virtual machine or Container status.

Virtual memory usage, in per cent of the total memory on the Node. It's displayed in the form of "actual usage/barrier". This parameter corresponds to the

PHYSPAGES

VSwap parameter. km sw proc cpu sock fcnt mlat iow ior iowt iort ios

%KM

%SW

PROC

CPU

SOCK

FCNT

MLAT

IOW

IOR

IOWT

IORT

IOS

Kernel memory usage, in per cent of the normal zone size. It's displayed in the form of "actual usage/barrier".

This parameter corresponds to the kmemsize UBC parameter.

Swap space usage, in per cent of the total swap space on the Node. It's displayed in the form of "actual usage/barrier". This parameter corresponds to the

SWAPPAGES

VSwap parameter.

Process information. It's displayed in the form of "running processes/total processes/barrier".

CPU usage. It's displayed in the form of "actual CPU usage/guaranteed PU usage".

If more than one processor is installed on the server, all processors are considered as 100%.

Sockets usage calculated as the sum of UBC numtcpsock

and numothersock parameters. It's displayed in the form of "open sockets/barrier".

Fail counters—that is, the number of UBC fail counters for all resources.

Maximum process scheduling latency, in milliseconds. In this case, the latency means the maximum time a process in a virtual machine or Container is waiting for the CPU.

Transfer rate with which data is written to the virtual machine or Container.

Transfer rate with which data is read from the virtual machine or Container.

Total amount of data that was written to the virtual machine or Container.

Total amount of data that was read from the virtual machine or Container.

Synchronization rate.

100

iod rx tx rxt txt rxp txp rxpt txpt

IOD

RX

TX

RXT

TXT

RXP

TXPT

RXPT

TXPT

Managing Parallels Server Bare Metal 5.0

Flushing rate of dirty pages (pages that have been changed but are not yet written to the virtual machine or

Container disk).

Incoming traffic rate, in megabytes per second.

Outgoing traffic, in megabytes per second.

Total amount of incoming traffic, in megabytes.

Total amount of outgoing traffic, in megabytes.

Incoming traffic, in packets per second.

Outgoing traffic, in packets per second.

Total amount of incoming packets.

Total amount of outgoing packets.

101

C

H A P T E R

3

Managing Containers

Parallels Containers can be managed using the pctl command-line utility. The utility is installed on the Parallels server during the product installation.

In This Chapter

Matrix of Parallels Server Bare Metal Command-Line Utilities ................................... 103

pctl ........................................................................................................................ 105

vzlist ...................................................................................................................... 124

vzquota .................................................................................................................. 130

Migration Utilities .................................................................................................... 135

Backing-Up Utilities ................................................................................................ 143

EZ Template Management Utilities .......................................................................... 148

Supplementary Tools .............................................................................................. 178

Managing Containers

Matrix of Parallels Server Bare Metal Command-

Line Utilities

The table below contains the full list of Parallels Server Bare Metal command-line utilities you can use for managing Containers.

General utilities are intended for performing day-to-day maintenance tasks: pctl vzlist vzquota

Utility to control Containers.

Utility to view a list of Containers existing on the server with additional information.

Utility to control Parallels Server Bare Metal disk quotas.

Container migration tools allow to migrate Containers between servers or within one server: vzmigrate vzmlocal vzp2v pmigrate

Utility for migrating Containers from one server to another.

Utility for the local cloning or moving of the Containers.

Utility for migrating physical servers to Containers on the Parallels server.

Utility for migrating physical servers to Containers and for moving Containers between Parallels servers.

Container backup utilities allow to back up and restore the Container private areas, configuration files, action scripts, and quota information: pbackup prestore

Utility to back up Containers.

Utility to restore backed up Containers.

Template management tools allow the template creation, maintenance and installation of applications into a Container: vzpkg vzmktmpl vzpkgproxy vzrhnproxy

Utility to manage OS and application EZ templates either inside your Containers or on the server itself.

Utility to create OS and application EZ templates.

Utility to create caching proxy servers for handling OS and application EZ templates.

Utility to create RHN proxy servers for handling the packages included in the

RHEL 4 and RHEL 5 OS EZ templates.

Supplementary tools perform a number of miscellaneous tasks in the Parallels server and Container context: vzfsutil vzcache vzps vztop vzsetxinetd

Utility for the VZFS optimization and consistency checking.

Utility to gain extra disk space by caching the files identical in different

Containers.

Utilities working as the standard ps and top utilities, with Container-related functionality added.

Utility to switch some services between a standalone and xinetd-dependent

103

Managing Containers vzdqcheck vzdqdump vzdqload vznetstat vzcpucheck vzmemcheck vzcalc vzcheckovr vzstat vzpid vzsplit vzcfgscale vzcfgvalidate vzhwcalc vzmtemplate modes.

Print file space current usage from quota’s point of view.

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.

Utility that prints network traffic usage statistic by Containers.

Utility for checking CPU utilization by Containers.

Utility for checking the server and Container current memory parameters.

Utility to calculate resource usage by a Container.

Utility to check the current system overcommitment and safety of the total resource control settings.

Utility to monitor the server and Container resources consumption in real time.

Utility that prints Container id the process belongs to.

Utility to generate Container configuration file sample, “splitting” the server into equal parts.

Utility to scale the Container configuration.

Utility to validate Container configuration file correctness.

Utility to scan the main resources on any Linux server and to save the obtained information to a special file.

Utility to migrate the installed OS and application templates from the one server to another.

104

Managing Containers

pctl

pctl

is the primary tool for Container management. To use it, you have to log in to the server as the root user. The syntax of pctl is: pctl [--quiet | --verbose] command CT_ID pctl --version pctl --help

Where command can be one of the following: create delete destroy mount umount start stop restart status set unset

Creates a new Container.

Deletes a Container.

Mounts the Container private area and executes the Container mount script.

Unmounts the Container private area and executes the unmount script.

Starts a Container.

Stops a Container.

Restarts a Container.

Displays the Container status.

Sets Container parameters: resource control settings, hostname, IP addresses, and so on.

Removes Container parameters (resource control settings, IP addresses, and so on) from the configuration file.

Logs in to a Container without knowing its root password.

Runs arbitrary commands in a Container without logging in to it. enter exec exec2 recover reinstall quotaon quotaoff quotainit suspend resume convert runscript

Recovers the original state of the Container system and application files.

Turns the disk quota on for a Container.

Turns the disk quota off for a Container.

Initializes the disk quota for a Container with the parameters taken from the Container configuration file.

Saves the state of a running Container in a dump file.

Restores a Container from its dump file.

Converts legacy Containers to support the new Parallels Containers directory layout.

Runs shell scripts in a Container.

Verbosity options can be used with any of the above commands:

--verbose

--quiet

Sets the log level to its maximum possible value.

Disables logging to the screen and to the log file.

105

Managing Containers

You can also pass to pctl one of the following options:

--version

--help

Displays the pctl package version currently installed on the server.

Displays the usage information about pctl.

106

Managing Containers

pctl create

This command is used to create a new Container. It has the following syntax: pctl 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 Server Bare Metal needs. Do not use IDs from 1 to 100 for Containers.

Command options are as follows:

--ostemplate name

--config name

--private path

--root path

--ipadd addr[/mask]

--hostname name

--name name

--description desc

--skip_app_templates

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

Server Bare Metal configuration file.

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 Server Bare

Metal configuration file, you will have to set resource control parameters for the Container using the pctl set command.

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.

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.

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 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 to assign to the Container. Like IDs, names can be used to perform Container-related operations.

Container description. You cat type any text you consider reasonable. If the text contains space characters, enclose in in quotation marks.

Do not install the application templates specified in the Container sample configuration file.

OS standard template to use for creating the Container. If omitted, this value is taken from the global Parallels Server Bare Metal configuration

107

Managing Containers

--pkgver ver file.

Particular version of OS standard template. If omitted, the latest available version is used.

pctl delete and pctl destroy

These commands are used to delete a Container, which is no longer needed, from the server. The syntax of the commands is as follows: pctl delete <CT_ID> pctl destroy <CT_ID>

When executed, pctl delete/pctl 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.

108

Managing Containers

pctl start, pctl stop, pctl restart, and pctl status

These four commands have the same syntax and take no obligatory arguments: pctl start <CT_ID|name> [--wait] pctl stop <CT_ID|name> [--fast] pctl restart <CT_ID|name> pctl 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 pctl 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, pctl 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 vz-start vz-net_add ve-alias_add ve-veconfig ve-quota start

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 pctl dismounts the Container private area and returns the error.

This script sets up IP traffic accounting for the Container.

This script creates the necessary ARP entries and sets up the necessary routing entries for Container IP addresses.

This script configures the network interfaces inside the Container.

This script is called by pctl to set a hostname and DNS search domains inside the Container.

If the second-level (per user/group) quota is turned on, then pctl calls this script to form the correct /etc/mtab file inside the Container.

Optional Container start script. If it exists, then it is executed in the context of a just started Container. pctl 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, pctl 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 pctl stop is described below in the order of execution: stop umount

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 pctl does not stop the Container.

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.

109

Managing Containers

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 Server Bare Metal versions.

The pctl restart <CT_ID> command consecutively performs the stopping and starting of the corresponding Container.

The pctl 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:

# pctl status 101

VEID 101 exist mounted running

pctl mount and pctl umount

These commands take no additional arguments: pctl mount <CT_ID> pctl umount <CT_ID>

The first command mounts the Container private area to the Container root directory

(/vz/root/<CT_ID> on the server) without starting it. Normally, you do not have to use this command as the pctl start command mounts the Container private area automatically.

The pctl umount command unmounts the Container private area. Usually, there is no need in using this command either because pctl stop unmounts the Container private area automatically.

110

Managing Containers

pctl set

This command is used for setting Container parameters. It has the following syntax: pctl set <CT_ID> <option> <value> [--save]

An optional –-save switch, if specified, tells pctl 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 of Container reboot. 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 Server Bare Metal, you can also use the pctl set command to specify a number of parameters for the server 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

--offline_management yes|no

--offline_service service_name

--userpasswd user:password

This setting requires the –-save switch. If you set it to

“yes” than Parallels Server Bare Metal 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 server system management parameters are set on the server boot to the values indicated in this file.

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).

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 server.

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.

111

Managing Containers

--noatime yes|no

--devnodes device:r|w|rw|none

--netdev_add name

--netdev_del name

--capability name:on|off

--features name:on|off

--root path

--private path

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.

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.

Moves the specified network device from the server to the Container.

For example: --netdev_add eth0

Moves the specified network device from the given

Container to the server.

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.

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

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.

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.

112

Managing Containers

--setmode restart|ignore

--disabled yes|no

--name

--description

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.

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 pctl set.

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 server. 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").

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]

--bindmount_del dst|all

Mounts a source directory (src) located on the server 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 setgroup-identifier bits to take effect.

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

113

Managing Containers

-p, --numproc bar:lim

--numtcpsock bar:lim

--numothersock bar:lim

-e, --numiptent bar:lim

--vmguarpages bar:lim

-k, --kmemsize bar:lim

--tcpsndbuf bar:lim

-b, --tcprcvbuf bar:lim

--othersockbuf bar:lim

--dgramrcvbuf bar:lim

--oomguarpages bar:lim 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).

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 Server Bare Metal, the limit shall be set to the same value as the barrier.

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 Server Bare

Metal, the limit shall be set to the same value as the barrier.

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 Server Bare

Metal, the limit shall be set to the same value as the barrier.

Number of IP packet filtering entries.

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 Server Bare Metal, the limit shall be set to the same value as the barrier.

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.

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.

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.

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

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

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 Server

Bare Metal, the limit shall be set to the same value as the barrier.

114

-l, --lockedpages bar:lim

--shmpages bar:lim

--physpages bar:lim

--swappages bar:lim

--privvmpages bar:lim

-n, --numfile bar:lim

-f, --numflock bar:lim

-t, --numpty bar:lim

-i, --numsiginfo bar:lim

-x, --dcachesize bar:lim

--cpuunits units

--cpulimit percent|megahertz

Managing Containers

Memory not allowed to be swapped out (locked with the mlock()

system call), in 4-Kb pages.

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

The total size of RAM used by processes, in 4 Kb pages.

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.

The total amount of swap space to be available to the

Container, in Kb pages. In the current version of Parallels

Containers, this parameter is always set to unlimited (even if you configure this parameter).

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.

Number of files opened by all Container processes. In this version of Parallels Server Bare Metal, the limit shall be set to the same value as the barrier.

Number of file locks created by all Container processes.

Number of pseudo-terminals. For example, ssh session, screen

, xterm application consumes pseudo-terminal resource. In this version of Parallels Server Bare Metal, the limit shall be set to the same value as the barrier.

Number of siginfo structures (essentially this parameter limits size of signal delivery queue). In this version of

Parallels Server Bare Metal, the limit shall be set to the same value as the barrier.

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.

CPU weight. This is a positive integer number that defines how much CPU time the Container can get as compared to the other virtual machines and 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.

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

115

Managing Containers

--cpus num

--cpumask num

--diskspace bar:lim

--diskinodes bar:lim

--quotatime seconds

--quotaugidlimit num

--ioprio num

116

CPU time equals 200%.

If the server has more than one CPU installed, this option allows you to set the number of virtual CPUs to be available to the Container.

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).

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.

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.

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'.

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.

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

--rate dev:class:Kbits

--ratebound yes|no

--meminfo none|pages:num| privvmpages:num

--reset_ub

--physpages

Managing Containers

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.

• B

: sets the limit in bytes per second.

In the current version of Parallels Containers, the maximum

I/O bandwidth limit you can set for a Container is 2 GB per second.

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.

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.

Customizes the output of the /proc/meminfo virtual file inside the Container and sets it to one of the following modes:

Non-virtualized (--meminfo none). In this case running the cat /proc/meminfo command inside the Container will display the information about physical memory on the server (total, used, free, shared, etc.), in kilobytes.

Virtualized in pages (--meminfo pages:num).

Setting the /proc/meminfo output to this mode allows you to manually specify the amount of total memory to be displayed while running the cat

/proc/meminfo

command inside the

Container.

Virtualized in privvmpages (--meminfo privvmpages:num

). Setting the

/proc/meminfo

output to this mode also allows you to arbitrarily specify the amount of total memory to be displayed while running the cat

/proc/meminfo

command inside the

Container. As distinct from the previous mode, the amount of memory shown in this mode is calculated on the basis of the value of the

PRIVVMPAGES

parameter set in the Container configuration file.

Resets the current values of all system parameters of the server to the ones set in the 0.conf file.

The amount of RAM that can be used by the processes of a

117

Managing Containers

--swappages

--vm_overcommit

Container, in 4-KB pages.

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.

Memory overcommit factor that defines the memory allocation limit for a Container. The limit is calculated as

(PHYSPAGES + SWAP) * factor

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

--ipadd addr

--ipadd addr/net_mask

Sets the hostname to the specified name.

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.

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 Containers configuration file is set to yes

.

--ipdel addr|all

--ext_ipadd addr

--ext_ipdel addr|all

--nameserver addr

--searchdomain domain

--iptables module

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.

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.

Removes the external IP address from the Container. To delete all external IP addresses assigned to the Container, specify --ext_ipdel all.

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.

The DNS search domain for the Container. More than one domain may be specified.

Only those iptables modules will be loaded to the given

Container which are indicated.

118

--netif_add name

[,mac,host_mac]

--netif_del name

--ifname name

--mac MAC_Address

--host_mac MAC_Address

--host_ifname name

--network network_ID

--dhcp yes|no

--gw addr

Managing Containers

The list of iptables modules are loaded to a Container is determined by the list of iptables modules loaded on the server at the moment of the Container startup.

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 server.

Only the Ethernet interface name (name) is mandatory; all the other parameters, if not specified, are automatically generated by Parallels Server Bare Metal during the veth adapter creation.

Removes the veth virtual network adapter with the specified name from the Container.

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.

The MAC address to be assigned to the veth virtual

Ethernet interface inside the Container. Should be used along with the --ifname option.

The MAC address to be assigned to the veth virtual

Ethernet interface on the server. Should be used along with the --ifname option.

The name to be assigned to the veth virtual Ethernet interface on the server. Should be used along with the -ifname

option.

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.

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.

Set the default gateway for the veth virtual network

119

Managing Containers adapter. Should be used along with the --ifname option.

pctl unset

This command is used to remove Container parameters from its configuration file

(/etc/vz/conf/<CT_ID>.conf). It has the following syntax: pctl unset <CT_ID> <setting_name> --save

Depending on the parameter for which the command is executed, pctl 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 server boot if executed with the --onboot parameter).

This command can be used with the same parameters as pctl set. You can view detailed information on all the parameters in the previous subsection.

pctl exec, pctl exec2, and pctl enter

These commands are used to run arbitrary commands in a Container being authenticated as root on the server. The syntax of these commands is as follows: pctl { exec|exec2 } <CT_ID|name> <command> pctl 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. pctl exec returns 0 in case pctl has been able to launch the command and does not take into account the exit code of the command itself. pctl 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. pctl enter

is similar to pctl exec /bin/bash. The difference between the two is that pctl 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.

120

Managing Containers

pctl recover and pctl 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 pctl recover command simply rewrites the original symlinks to the Container private area

(leaving the user files intact), the pctl 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: pctl recover <CT_ID> [options] pctl reinstall <CT_ID> [options]

The available options are listed below:

Option

--resetpwdb

--skipbackup

--scripts script1

script2 ...

--listscripts

--desc

Description

Removes the Container user database and creates a clean database as for any new installation.

Does not save the contents of the old private area to the /old directory. Can be used with the pctl reinstall command only.

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.

Lists the scripts that will be executed during the Container reinstallation to customize your application templates inside the new Container.

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.

121

Managing Containers

pctl quotaon, pctl quotaoff, and pctl quotainit

These commands turn the quota on or off for the particular Container; the pctl 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: pctl quotaon <CT_ID> pctl quotaoff <CT_ID> pctl 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 pctl set

command.

pctl suspend and pctl resume

The pctl suspend command is used to save the state of a running Container. It has the following syntax: pctl suspend <CT_ID>

During the pctl 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 server (or in the directory specified as the value of the DUMPDIR parameter in the Parallels Server Bare Metal global file).

The pctl resume command is used to restore the Container from its dump file created with the pctl suspend

command. It has the following syntax: pctl resume <CT_ID>

When executed, pctl resume searches for the Dump file in the /vz/private/CT_ID/dump directory on the server and restores the Container from this file.You can restore the Container dump file on the Source Server, i.e. on the server where this Container was running before its dumping, or transfer the dump file to another server and restore it there.

Note: Before restoring a Container from its dump file, make sure that the file system on the Destination

Server is identical to that at the moment of the Container dumping. Otherwise, the Container restoration may fail.

122

Managing Containers

pctl runscript

The pctl 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 pctl runscript is as follows: pctl 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 server.

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

123

Managing Containers

vzlist

The vzlist utility is used to list the Containers existing on the given server 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

-a, --all

-S, --stopped

-o parameter[.specifier]

-s, --sort

[-]parameter[.specifier]

-h, --hosthame hostname_pattern

Description

Lists all the Containers existing on the server. By default, only running Containers are shown.

Lists only stopped Containers.

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.

Sorts the Containers in the list by the specified parameter. If "-" is given before the name of the parameter, the sorting order is reversed.

Displays only those Containers that correspond to the specified hostname pattern. The following wildcards can be used: *,?, and

[]

.

-H, --no-header

CT_ID

-n, --name

-N, --name_filter name_pattern

-i, --netif

<interface_name>

-d, --description desc_pattern

Note: The last wildcard should be escaped to avoid shell interpretation.

Do not display column headers.

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 server, with no additional information.

If used without any parameters, displays information on all the

Containers on the server together with their names. If you indicate the Container ID after this option, displays information including the

Container name on the specified Container only.

Displays only the Container that corresponds to the specified name pattern.

Displays the Container whose veth virtual Ethernet interface name on the server corresponds to the specified name pattern.

Displays only the Container whose description corresponds to the specified pattern.

124

-L, --list

Managing Containers

Lists all the parameters available to be used with the -o option.

125

Managing Containers

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

.b

.l

.f

.s

.h

The maximal registered usage of the corresponding resource by the given Container.

The barrier on using the corresponding resource set for the given Container.

The limit on using the corresponding resource set for the given Container.

The number of times the system has failed to allocate the corresponding resource for the given Container.

The soft limit on using the corresponding resource set for the given Container.

The hard limit on using the corresponding resource set for the given Container.

The following parameters are available for using with the utility:

Parameter ctid hostname ip status tm ostemplate kmemsize lockedpages privvmpages

Possible

Specifiers none none none none none none

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

Output Column Description

CTID

HOSTNAME

IP_ADDR

STATUS

TM

The Container ID.

The Container hostname.

The Container IP address.

Specifies whether the Container is running or stopped.

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 Specifies the name of the OS template your

Container is based on ( e.g. redhat-el5x86

).

KMEMSIZE

LOCKEDP

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.

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

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

126

shmpages numproc physpages vmguarpages numtcpsock numflock numpty numsiginfo tcpsndbuf tcprcvbuf

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

oomguarpages .m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

SHMP

NPROC

PHYSP

VMGUARP

OOMGUARP

NTCPSOCK

NFLOCK

NPTY

NSIGINFO

TCPSNDB

TCPRCVB

Managing Containers this resource parameter.

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.

The number of processes and threads allowed.

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.

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.

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.

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.

The number of file locks created by all

Container processes.

The number of pseudo-terminals. For example, ssh

session, screen, xterm application consumes pseudo-terminal resource.

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

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.

The total size (in bytes) of receive buffers for

TCP sockets. Amount of kernel memory

127

Managing Containers

.l, .f

othersockb dgramrcvbuf nothersock

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

dcachesize numfile numiptent diskspace diskinodes laverage cpulimit cpuunits none none none

.m, .b,

.l, .f

.m, .b,

.l, .f

.m, .b,

.l, .f

.s, .h

.s, .h

OTHSOCKB

DGRAMRCVB received from the remote side but not read by the local application yet.

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

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

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

NFILE

The number of files opened by all Container processes.

NIPTENT

The number of IP packet filtering entries.

DQBLOCKS

DQINODES

LAVERAGE

CPULIM

CPUUNI

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.

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.

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

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

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

Server Bare Metal reporting tools consider one

1 GHz PIII Intel processor to be equivalent to

50,000 CPU units.

128

Managing Containers cpumask nodemask ioprio iolimit iopslimit none none none none none

CPUMASK

NODEMASK

IOPRIO

IOLIMIT

IOPSLIMIT

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).

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.

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.

The bandwidth a Container is allowed to use for its disk input and output (I/O) operation, in bytes per second.

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.

129

Managing Containers

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. pctl 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 Server Bare Metal 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 server 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 Server Bare Metal allows you to set soft and hard limits as well as an expiration time. Upon reaching a soft limit, Parallels Server Bare Metal 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.

130

Managing Containers

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

-b, --block-softlimit num

-B, --block-hardlimit num

-e, --block-exptime time

-i, --inode-softlimit num

-I, --inode-hardlimit num

-n, --inode-exptime time

-p path

-c quota_file

Optional. If the value used is 1 than per user/group quota is enabled in the Container. By default, user/group quotas are disabled.

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.

Required. Specifies disk quota block hard limit in 1 Kb blocks.

This limit cannot be exceeded by the Container.

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

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.

Required. Specifies inodes hard limit. This limit cannot be exceeded by the Container.

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

Required. Specifies the path to the Container private area.

Optional. Specifies the file to write output of counted disk space and inodes as well as limits. If omitted, the default

131

Managing Containers

/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

-u, --ugid-limit num

-p path

-f

-c quota_file

-b, --block-softlimit num

-B, --block-hardlimit num

-e, --block-exptime time

-i, --inode-softlimit num

-I, --inode-hardlimit num

-n, --inode-exptime time

Optional. If the value used is 1 then per user/group quota is enabled in the Container. By default user/group quotas are disabled.

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.

Required. Specifies the path to the Container private area.

This option forces recalculation of quota usage even if the quota file does not have dirty flag set on.

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.

These options are optional for the vzquota on command.

They are described in the vzquota init subsection.

132

Managing Containers

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

-b, --block-softlimit num

-B, --block-hardlimit num

-e, --block-exptime time

-i, --inode-softlimit num

-I, --inode-hardlimit num

-n, --inode-exptime time

-c quota_file

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.

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.

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.

These options are optional for the vzquota on command.

These options are described in the vzquota init subsection.

-b, --block-softlimit num

-B, --block-hardlimit num

-e, --block-exptime time

-i, --inode-softlimit num

-I, --inode-hardlimit num

-n, --inode-exptime time

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

133

Managing Containers

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.

134

Managing Containers

Migration Utilities pmigrate

Migrating virtual machines and Containers is performed using the pmigrate utility. This utility has the following syntax: pmigrate <source_server> <destination_server> [options]

<source_server> is the source server which can be either the server where the virtual machine and Container to be migrated is residing (if you are migrating a virtual machine and Container) or the physical server to be migrated (if you are migrating a physical server).

<destination_server> is the destination server—that is, the server where the virtual machine and Container or the physical server is to be migrated. If the source and/or destination server is not specified, the operation is performed on the local server.

Note: The current version of pmigrate does not support migrating physical servers to Containers.

<source_server> and <destination_server> consists of two parts:

<type> denotes the type of computer to migrate and can be one of the following:

• h

must be specified when migrating a physical server.

• c

must be specified when migrating a Container.

• v

must be specified when migrating a virtual machine.

<address> denotes the location of computer to migrate and can be one of the following:

The computer location if you are migrating a physical server.

The computer location and the virtual machine name or Container ID if you are migrating a virtual machine or Container, respectively. The location must be separated from the virtual machine name/Container ID by the slash (/).

The location format is as follows:

[<user>[:<password>]@]<destination_server_IP_address_or_hostname>[:<destination_server_

port>]

The options ([options]) you can use with pmigrate depend on whether you are migrating to a virtual machine or a Container. This section describes the parameters for migrating Containers between Parallels servers and for moving virtual machines and physical servers to Containers. For

information on performing these operations for virtual machines, see pmigrate (p. 232).

Container-related parameters

The following options can be used with pmigrate when migrating Containers between Parallels servers:

135

Managing Containers

-s, --nostart

-r, --remove-area yes|no

-f, --nodeps

[=[all][,cpu_check]

[,disk_space]

[,technologies]

[,license][,rate]]

-b, --batch

--ssh=<ssh_options>

--keep-dst

Do not attempt to start the Container on the destination server after its successful migration if the Container was running on the source server prior to the migration. This option does not have any effect if the Container was not running on the source server.

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 server and have the

.migrated

suffix appended to them.

During its execution, pmigrate performs a number of checks on the destination server (e.g. it verifies that all OS and application templates required for the Container are present on the destination server) 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 server. 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 server.

• cpu_check

: do not check the CPU capabilities of the

Destination Server.

• disk_space

: do not check the amount of disk space on the destination server.

• technologies

: do not check a set of technologies provided by the Parallels Server Bare Metal kernel on the destination server (see the description of the

TECHNOLOGIES

parameter in the Container

Configuration File subsection for details).

• license

: do not check the license installed on the destination server.

• rate

: do not check the value of the RATE parameter in the Parallels Server Bare Metal global file.

Normally, you do not have to specify this option. It is used by

Parallels Server Bare Metal scripts and changes the screen output to a computer-parsable form.

Additional options to be passed to ssh while connecting to the destination server.

Note: Do not specify the destination server hostname as an option of --ssh.

Do not remove the 'synched' Container private area on the destination server if some error occurred during the migration.

This option allows you to prevent pmigrate from the repeated

'synching' the Container private area if the first migration attempt failed for some reason or other.

136

Managing Containers

--online

--lazy

--noiter

--require-realtime

--readonly

Migrates the running Container with zero downtime. By default, the 'iterative online migration' type is used. During the migration:

1. The main amount of Container memory is transferred to the destination server.

2. The Container is 'dumped' and saved to an image file.

3. The image file is transferred to the destination server where it is

'undumped'.

Using this type of online migration allows you to attain the smallest service delay.

To not use the 'iterative online migration' type, supply the -noiter

option.

Can be used only together with the --online option. Speeds up the zero downtime migration process if your Container is running a number of memory-consuming applications. This option allows you to decrease the size of the image file storing all Container private data and transferred to the destination server by leaving the main amount of memory in a locked state on the source server and swapping this memory from the Source Server on demand.

While using the --lazy option, pay attention to the following:

The migration type is set to "lazy" only if you additionally supply the --noiter option.

If the --noiter option is not supplied, the migration type is set to 'lazy + iterative'.

Can be used only together with the --online option. Sets the migration type to 'simple'. This option cannot be used together with the --require-realtime option.

Can be used only together with the --online option. Forces pmigrate

to move the Container by using the 'iterative online migration' type. If this migration type cannot be carried out for some reason or another, the command will fail and exit. This option cannot be used together with the --noiter option.

If the default 'iterative online migration' type cannot be carried out, and this option is omitted , pmigrate will try to move your

Container by making use of other types: the 'simple online migration' type or the 'lazy online migration' type (depending on the presence of the --lazy option).

Just copy the specified Container to the destination server without making any changes to the Container on the Source Server.

--dry-run

Simulate the same operations as pmigrate completes without specifying this option (connects to the destination server, verifies that all OS and application templates required for the Container are present on the server, etc.); however, the Container itself is not moved to the destination server.

The following options can be used with pmigrate when migrating a physical server or a virtual machine to a Container:

137

Managing Containers

Name

-c

-q

, --quota

-z, --eztmpl

-d

, --dist

--exclude

-S, --srvstop

Description

Mandatory. The full path to the configuration file on the Parallels server that was created on the physical server by means of the vzhwcalc utility. You can specify only the name of the configuration file if you run the vzp2v

utility from the directory where this file is located.

Optional. The partition on your physical server which has any user and/or user groups quotas imposed on it. This partition will be migrated to the

Container together with all quotas imposed on it. Moreover, these quotas will be applied to the entire Container after the server migration.

Optional. The EZ OS template to be used to create the Container. You may list all OS templates installed on the Parallels server together with their updates by executing the vzpkg list command. If an OS template is not specified, the mkvzfs command is executed during the

Container creation which makes an empty private area with the name of

/vz/private/CT_ID

on the Parallels server. This private area is then used to copy all the physical server files to it.

Optional. The Linux version your physical server is running. The name of the version specified should coincide with the name of the corresponding distribution configuration file located in the /etc/vz/conf/dist directory on the Parallels server. For example, if you specify rhel-5 as the value of this option, the rhel-5.conf file should be present in the

/etc/vz/conf/dist

directory on the Parallels server. You must obligatorily set this option, if there is no DISTRIBUTION variable specified in the server configuration file. In case the DISTRIBUTION variable is set in the configuration file and you have specified the -d option, the latter takes precedence.

Optional. The path to the directories and files which will be excluded from copying to the Container. This option allows you to avoid migrating the data you do not need. To gain more understanding on this option, please consult the man pages for the rsync utility from where it was borrowed.

Note: We strongly recommend that you exclude the directories you were informed of while running the vzhwcalc utility on the physical server.

Optional. The services to be stopped for the time of the physical server migration. We recommend that you stop all the services on the physical server except for the critical ones (e.g. the sshd service that is needed to provide communication between the physical server and the Parallels server) before the migration. This will prevent the running services from modifying any files being moved.

138

Managing Containers

vzmigrate

This command can be used along with the pmigrate utility for moving Containers from one

Parallels server to another 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 server (the one where you run the vzmigrate command) and the destination server have a Container with the ID of <CT_ID>. You can specify multiple Containers at once for migration.

Note: For more information on pmigrate, refer to Migrating Virtual Machines and Containers (p.

135).

The following options can be used with vzmigrate:

-s, --nostart

-r, --remove-area yes|no

-f, --nodeps

[=[all][,cpu_check]

[,disk_space]

[,technologies]

[,license][,rate]]

Do not attempt to start the Container on the destination server after its successful migration if the Container was running on the source server prior to the migration. This option does not have any effect if the Container was not running on the source server.

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 server and have the

.migrated

suffix appended to them.

During its execution, vzmigrate performs a number of checks on the destination server (e.g. it verifies that all OS and application templates required for the Container are present on the destination server) 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 server. 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 server.

• cpu_check

: do not check the CPU capabilities of the destination server.

• disk_space

: do not check the amount of disk space on the destination server.

• technologies

: do not check a set of technologies provided by the Parallels Server Bare Metal kernel on the destination server (see the description of the

TECHNOLOGIES

parameter in the Container

Configuration File subsection for details).

139

Managing Containers

-b, --batch

--ssh=<ssh_options>

--keep-dst

--online

--lazy

--noiter

--require-realtime

140

• license

: do not check the license installed on the destination server.

• rate

: do not check the value of the RATE parameter in the Parallels Server Bare Metal global file.

Normally, you do not have to specify this option. It is used by

Parallels Server Bare Metal scripts and changes the screen output to a computer-parsable form.

Additional options to be passed to ssh while connecting to the destination server.

Note: Do not specify the destination server hostname as an option of --ssh.

Do not remove the 'synched' Container private area on the destination server if some error occurred during the migration.

This option allows you to prevent vzmigrate from the repeated

'synching' the Container private area if the first migration attempt failed for some reason or other.

Migrates the running Container with zero downtime. By default, the 'iterative online migration' type is used. During the migration:

The main amount of Container memory is transferred to the destination server.

The Container is 'dumped' and saved to an image file.

The image file is transferred to the destination server where it is 'undumped'.

Using this type of online migration allows you to attain the smallest service delay.

To not use the 'iterative online migration' type, supply the -noiter

option.

Can be used only together with the --online option. Speeds up the zero downtime migration process if your Container is running a number of memory-consuming applications. This option allows you to decrease the size of the image file storing all Container private data and transferred to the destination server by leaving the main amount of memory in a locked state on the source server and swapping this memory from the source server on demand.

While using the --lazy option, pay your attention to the following:

The migration type is set to "lazy" only if you additionally supply the --noiter option.

If the --noiter option is not supplied, the migration type is set to 'lazy + iterative'.

Can be used only together with the --online option. Sets the migration type to 'simple'. This option cannot be used together with the --require-realtime option.

Can be used only together with the --online option. Forces

Managing Containers

--readonly

--dry-run vzmigrate

to move the Container by using the 'iterative online migration' type. If this migration type cannot be carried out for some reason or another, the command will fail and exit. This option cannot be used together with the --noiter option.

If the default 'iterative online migration' type cannot be carried out, and this option is omitted , vzmigrate will try to move your

Container by making use of other types: the 'simple online migration' type or the 'lazy online migration' type (depending on the presence of the --lazy option).

Just copy the specified Container to the Destination Server without making any changes to the Container on the source server.

Simulate the same operations as vzmigrate completes without specifying this option (connects to the destination server, verifies that all OS and application templates required for the Container are present on the server, etc.); however, the Container itself is not moved to the destination server.

vzmlocal

Moving/copying a Container within one and the same server consists in changing/adding the

Container ID, private area, and root paths. Thus, you may use the vzmlocal utility either to change the ID and/or the private area path and/or the root path of any existing Container or to clone a Container, i.e. to create a complete copy of an existing Container with different ID and paths. It has the following syntax: vzmlocal <source_CT_ID>[:<dest_CT_ID> \

[:<dest_private>[:dest_root]] [...] vzmlocal -C <source_CT_ID>:<dest_CT_ID> \

[:<dest_private>[:dest_root]] [...] vzmlocal -h

The options are the following:

-h

Display the utility help.

-C

Clone the source Container instead of moving it.

You should specify the source Container ID (<source_CT_ID>) and the destination Container ID

(<dest_CT_ID>). Specifying the destination Container private area path (<dest_private>) and root path (<dest_root>) is optional; it allows you to override the default paths -

/vz/private/<dest_CT_ID>

and /vz/root/<dest_CT_ID>, correspondingly.

Notes:

1. You may perform a number of copying/moving operations by a single invocation of the vzmlocal utility.

2. You may run the vzmlocal utility on both running and stopped Containers.

141

Managing Containers

vzp2v

vzp2v

can be used along with the pmigrate utility to migrate a physical server to a Container on your Parallels server. It has the following syntax: vzp2v [user[:password]@]address[:port] [options]

Note: For more information on pmigrate, refer to Migrating Virtual Machines and Containers (p.

135).

The options that can be used with the vzp2v utility are listed in the table below:

Name

--ctid

-c

-q

, --quota

-z, --eztmpl

-t, --ostmpl

-d

, --dist

--exclude

Description

Mandatory. The ID of the Container that will be created on the Parallels server and where the physical server will be migrated. You can specify any unoccupied ID.

Mandatory. The full path to the configuration file on the Parallels server that was created on the physical server by means of the vzhwcalc utility. You can specify only the name of the configuration file if you run the vzp2v

utility from the directory where this file is located.

Optional. The partition on your physical server which has any user and/or user groups quotas imposed on it. This partition will be migrated to the

Container together with all quotas imposed on it. Moreover, these quotas will be applied to the entire Container after the server migration.

Optional. The EZ OS template to be used to create the Container. You may list all OS templates installed on the Parallels server together with their updates by executing the vzpkg list command. If an OS template is not specified, the mkvzfs command is executed during the

Container creation which makes an empty private area with the name of

/vz/private/CT_ID

on the Parallels server. This private area is then used to copy all the physical server files to it.

Optional. The OS template to be used to create the Container. You can list all OS templates installed on the Parallels server together with their updates by executing the vzpkgls command. If an OS template is not specified, the mkvzfs command is executed during the Container creation which makes an empty private area with the name of

/vz/private/CT_ID

on the Parallels server. This private area is then used to copy all the physical server files to it.

Optional. The Linux version your physical server is running. The name of the version specified should coincide with the name of the corresponding distribution configuration file located in the /etc/vz/conf/dist directory on the Parallels server. For example, if you specify rhel-5 as the value of this option, the rhel-5.conf file should be present in the

/etc/vz/conf/dist

directory on the Parallels server. You must obligatorily set this option, if there is no DISTRIBUTION variable specified in the server configuration file. In case the DISTRIBUTION variable is set in the configuration file and you have specified the -d option, the latter takes precedence.

Optional. The path to the directories and files which will be excluded from copying to the Container. This option allows you to avoid migrating the data you do not need. To gain more understanding on this option, please

142

-S, --srvstop

Managing Containers consult the man pages for the rsync utility from where it was borrowed.

Note: We strongly recommend that you exclude the directories you were informed of while running the vzhwcalc utility on the physical server.

Optional. The services to be stopped for the time of the physical server migration. We recommend that you stop all the services on the physical server except for the critical ones (e.g. the sshd service that is needed to provide communication between the physical server and the Parallels server) before the migration. This will prevent the running services from modifying any files being moved.

Prints information on the utility options.

Prints usage information.

-h, --help

--usage

Backing-Up Utilities

Any Container is defined by its private area, configuration files, action scripts, and quota information. Backing up these components allows you to restore all the content of a Container on any Parallels Server Bare Metal-based system at any time if the Container gets broken.

143

Managing Containers

pbackup

The pbackup utility is run on the so-called Backup Server. It connects via SSH to the servers where some or all Containers are to be backed up and puts the tarballs into the directory defined in the /etc/vzbackup.conf global backup configuration file (by default, this directory is

/vz/backup

). Later on, the Container backups may be restored from this directory. It has the following syntax: pbackup [backup_options] SERVER1 ... [CT options]

You may specify any number of servers names or IP addresses in the command-line. You may also enter these names as the value of the BACKUP_NODES parameter in the global backup configuration file to avoid the necessity to specify them in the command-line. In this case, you shall specify the –a option instead.

Notes:

1. This section describes only backup options for Containers. For backup options that can be used with

virtual machines, see pbackup (p. 235).

2. While the following two subsections provide the complete reference on the pbackup and prestore utilities, many of their options can be specified in the /etc/vzbackup.conf configuration file to be used as the default ones.

The backup options are the following:

-F

-I

-i

-Cg

-Cb

-Cn

-a

-c CONFIG

-s

-z

Force a plain full backup. Plain full backups of Containers do not allows creating incremental backups on their basis.

Force a full backup.

Make an incremental backup or, if no full backups are available, a full backup.

Compress the resulting Container backups with the gzip algorithm. This option takes precedence of the BACKUP_COMPRESS parameter in the backup configuration file.

Compress the resulting Container backups with the bzip2 algorithm. This option takes precedence of the BACKUP_COMPRESS parameter in the backup configuration file.

Do not compress the resulting Container backups. This option takes precedence of the BACKUP_COMPRESS parameter in the backup configuration file.

Back up all servers specified in the global backup configuration file.

Use an alternative backup configuration file.

The Containers are to be stopped before their backing up. In this case, if a client tries to access the Containers during their downtime, a temporary

"busy" page is shown. This option takes precedence of the

BACKUP_VESTOP

parameter in the backup configuration file.

Use the VZFS tracking facility to decrease the Container downtime. With this option, the backing up is performed in two stages. On the first stage,

144

Managing Containers

-n

-p

--desc DESCRIPTION

-j

-L

--rm-tag tag

--rm-old

--ssh-opts OPTIONS

--vzcache the Container is backed up while still running. On the second stage, it is stopped, and the changes in the Container file system that have been made during the first stage are added to the backup. Valid only if used together with the -s option.

The Containers are NOT to be stopped before their backing up. This option takes precedence of the BACKUP_VESTOP parameter in the backup configuration file.

Apply time and load restriction rules for periodic backups. These rules are defined by the BACKUP_KEEP_MAX and BACKUP_LOADAVG_MAX parameters in the backup configuration file (/etc/vzbackup.conf).

Without this option, these parameters do not take effect. This option is useful if you invoke pbackup in unattended mode as a cron job. It overrides the CRON_BACKUP parameter in the global backup configuration file.

The description of the backup archive.

Is opposite to the -p switch. Turns off the periodic backup mode and disregards the BACKUP_KEEP_MAX and BACKUP_LOADAVG_MAX parameters in the backup configuration file (/etc/vzbackup.conf). It overrides the CRON_BACKUP parameter in the global backup configuration file.

Make use of the BACKUP_FINISH_TIME and BACKUP_LIMIT_TIME in the backup configuration file (/etc/vzbackup.conf).

Create a backup and then remove the backup with the specified tag. You can learn the tags of the existing backups on the server by using, for example, the prestore -l command.

Create a backup and then remove the oldest backup of the specified server/Container(s).

Options to be passed to ssh. See examples in the backup configuration file.

Back up not the Containers themselves, but the cache area of the server

(/vz/template/vzcaches).

The Container options define the list of Containers to be backed up:

-e CT1...

-x CT1...

The Containers to back up on the server. Containers can be specified using both their IDs

(e.g. 101 or 102) and their names (e.g. comp1 or comp2).

If the --vzcache option is specified, not the Containers themselves, but their caches will be backed up.

The Containers that need not be backed up (Containers to exclude). Containers can be specified using both their IDs (e.g. 101 or 102) and their names (e.g. comp1 or comp2).

If the --vzcache option is specified, not the Containers themselves, but their caches will be excluded from backing up.

It is sufficient to specify only one Container option: either –e, or –x; or to do without any Container options if all the Containers from the specified server(s) are to be backed up.

145

Managing Containers

prestore

The prestore utility is also run on the Backup Server. It uses the Container backups stored on the Backup Server to restore them to their original servers (or to any other location if the –d option is specified). The syntax of the command is the following: prestore [restore_options] server1 ... [CT_options]

You may specify any number of servers (their names or IP addresses) whose Containers were at one time backed up and now need to be restored.

The restore options are the following:

-c CONFIG

-d NODE

-t TAG

-r TAG

--rm-prev TAG

-l

-f

--chain

Use an alternative backup configuration file.

The Destination Server to restore the Containers to. If no Destination

Server is specified, the Containers are restored to the server from which they were originally backed up.

Specify the tag of any intermediary incremental backup to be restored.

Remove the backup tagged by the TAG value. This option is valid only if a single Container is specified and if the TAG value specifies the last incremental backup.

Remove the backup tagged by the TAG value together with all the previous backups. This option is valid only if a single Container is specified and if the TAG value specifies the last incremental backup.

Do not restore any Containers. Show the information on the Containers available to be restored.

Show the full information on the backed up Containers (only if the -l option is specified).

Show a tag chain (only if the –l option is specified).

--desc config

--single-tar

Display the configuration file inside the archive with the specified tag (only if the -l and -t options are specified).

Indicates that a single tar is coming (stdin).

--skip-check-vzcache

--vzcache

The Container options define a list of Containers to be restored:

-e CT1...

-x CT1...

The Containers to be restored on the server. Any Container can be specified using both its IDs (e.g. 101 or 102) and its names (e.g. comp1 or comp2

).

The Containers that need not be restored (Containers to exclude). Any

Container can be specified using both its IDs (e.g. 101 or 102) and its names (e.g. comp1 or comp2).

146

Do not restore the backups of the Container cached files stored in the

/vz/backup/CT_ID/vzcache

directory on the Backup Server. For example, you should use this option while restoring a Container with cached files to a Destination Server other than the Backup Server.

Restore the vzcache template area keeping the Container cached files and located in the /vz/template/vzcaches directory on the server.

Managing Containers

It is sufficient to specify only one Container option: either –e, or –x; or to do without any Container options if all the Containers from the specified servers are to be restored.

147

Managing Containers

EZ Template Management Utilities

The following utilities can be used to perform EZ templates-related operations:

• vzmktmpl

. This utility is used to create OS and application EZ templates.

• vzpkgproxy

. This utility is used to set up a caching proxy server meant for handling your OS and application EZ templates.

• vzrhnproxy

. This utility is used to set up a Red Hat Network (RHN) Proxy Server meant for handling the packages included in the RHEL 4 OS EZ template.

• vzmtemplate

. This utility is used to migrate the installed OS EZ templates from the Source

Server to the Destination Server. Detailed information on this utility is provided in the vzmtemplate subsection

(p. 191).

• vzpkg

. This utility is used to perform to manage OS and application EZ templates either inside your Containers or on the server itself. This tool can also be used to manage standard software packages (e.g. the mysql.rpm package) inside a Container. The syntax of vzpkg is: vzpkg command [options] <CT_ID> vzpkg --help

Where command can be one of the following: install template

Used to install OS and application EZ templates on the server. update template

Used to update OS and application EZ templates installed on the server. remove template

Used to remove OS and application EZ templates from the server. list Used to list EZ templates or software packages either on the server or inside a particular Container. info

Used to get information on any EZ templates or software packages available on the server or inside the Container. status

Used to display the updates for the packages installed inside the Container. install

Used to add application EZ templates to or to install software packages inside the Container. update

Used to update application EZ templates and software packages inside the

Container. link

Used to replace the real application files inside your Container(s) with the symlinks to the same files on the server. remove

Used to remove application EZ templates or software packages from the

Container. create cache

Used to create a tarball (cache) for the given OS EZ template. update cache

Used to update the existing tarball (cache) for the given OS EZ template. remove cache

Used to remove a tarball (cache) for the given OS EZ template. localinstall

Used to install a software package inside a Container from the corresponding file on the server.

148

Managing Containers localupdate upgrade fetch clean update metadata

Used to update the software packages installed inside your Container(s) by means of the vzpkg install or vzpkg localinstall commands.

Used to upgrade an OS EZ template the Container is based on to a newer version.

Used to download packages included in EZ templates to the server and to store them in the vzpkg local cache.

Used to remove all locally cached data from the template directories on the server.

Used to update the local metadata on the server.

vzpkg install template

This command is used to install an OS or application EZ template on the server from the corresponding package. It has the following syntax: vzpkg install template [options] <path_to_package> ...

You can use the following options with this command:

Name

-q, --quiet

-f, --force

Description

Disables logging to the screen and to the log file.

Forces the EZ template installation the server.

When executed, the vzpkg install template command installs an application or OS template on the server from the specified package (<package>). You can install a number of templates at once by specifying the corresponding packages and separating them by spaces.

vzpkg update template

This command is used to update an OS or application EZ template on the server from the corresponding package. It has the following syntax: vzpkg update template [options] <path_to_package> ...

This command can be used with the following options:

Name

-q, --quiet

-f, --force

Description

Disables logging to the screen and to the log file.

Forces the EZ template update.

When executed, the vzpkg update template command updates an application or OS EZ template on the server from the specified file (<package>). You can update a number of templates at once by specifying the corresponding packages and separating them by spaces.

149

Managing Containers

vzpkg remove template

This command is used to remove an OS or application EZ template that you do need any more from the server. It has the following syntax: vzpkg remove template [options] [-F OS_template] <template_name> ...

You can pass the following options to this command:

Name

-q, --quiet

-f, --force

Description

Disables logging to the screen and to the log file.

Forces the EZ template deletion from the server.

When executed, the vzpkg remove template command removes the specified OS EZ template (<template_name>) from the server. To delete an application EZ template, you should additionally specify the name of the OS EZ template (OS_template) under which this application template is to be run.

150

Managing Containers

vzpkg list

The vzpkg list command is used to list the EZ templates or software packages installed on the server or already added to a particular Container. It has the following syntax: vzpkg list [options] <CT_ID>|<CT_NAME> [...] vzpkg list [options] [<OS_template>|<CT_ID>|<CT_NAME> [...]]

If you indicate one or more Container IDs or names, the command will list the EZ templates applied to the specified Containers. If you indicate one or more OS EZ templates, vzpkg list will display a list of application EZ templates available for these OS EZ templates. Without the

<CT_ID>/<CT_NAME>

and <OS_template> arguments, the utility lists all EZ templates available for Containers on the server.

The following options can be used with the vzpkg list command:

Name

-p, --package

-O, --os

-A, --app

-C, --cache

-r, --remote

-u, --custom-pkg

-i, --pkgid

Description

If the <CT_ID> or <CT_NAME> argument is given, the command lists all software packages installed inside the Container. If the <OS_template> argument is given, the command lists all packages included in the OS EZ template. Without the <CT_ID>/<CT_NAME> and <OS_template> arguments, vzpkg list displays all packages available on the server.

If the <CT_ID> or <CT_NAME> argument is given, the command displays the

OS EZ template the Container is based on. Without the

<CT_ID>

/<CT_NAME> argument, vzpkg list lists all OS EZ templates installed on the server.

If the <CT_ID> or <CT_NAME> argument is given, the command displays the application EZ templates installed inside the Container. If the

<OS_template>

is given, the command shows the application EZ templates which can be used with the OS EZ template specified. Without the

<CT_ID>/<CT_NAME>

and <OS_template> arguments, vzpkg list lists all application EZ templates installed on the server.

Lists the packages included in the specified EZ template or applied to the specified Container from the local vzpkg cache. You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file. Should be used along with the -p option.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg list

list the packages included in the specified EZ template or applied to the specified Container in the remote repositories. Should be used along with the -p option.

Displays a list of packages that are applied to the specified Container but absent from the repository set to handle the EZ template(s) where these packages are included.

Displays the ID assigned to the EZ template instead of its name; these IDs are unique within the given system. If the <CT_ID> or <CT_NAME> argument is given, the command shows the IDs of the EZ templates available inside the

Container. If the <OS_template> argument is given, the command displays

151

Managing Containers

-S, --with-summary

-c, --cached

-d, --debug

<num>

-q, --quiet the IDs of the OS EZ template specified and all its EZ application templates.

Without the <CT_ID>/<CT_NAME> and <OS_template> arguments, the

IDs of all EZ templates installed on the server are shown.

In addition to listing the EZ templates available either inside the Container (if the <CT_ID> or <CT_NAME> argument is given) or installed on the server (if the <CT_ID>/<CT_NAME> argument is omitted), this option makes vzpkg list

display the summary information on the corresponding EZ templates/packages.

This option has no effect if the <CT_ID> or <CT_NAME> argument is given. If used for listing the EZ templates available on the server, it makes vzpkg list

omit all application and OS EZ templates for which the cache has not been created (by running the vzpkg create cache command). In other words, with this option on, vzpkg list will list only the OS EZ templates ready to be used for the Container creation.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

152

Managing Containers

vzpkg info

This command provides information on the EZ templates or software packages installed on the server or applied to the Container. The syntax of the utility is as follows: vzpkg info [-F <OS_template>|<CT_ID>|<CT_NAME>] -q|-d <app_template>

[<parameters> ...] vzpkg info -p [-C|-r] [-F <OS_template>|<CT_ID>|<CT_NAME>] -q|-d

<package_name> [<parameters> ...]

The available options are described in the following table:

Name Description

-F, --for--os

<os_name>|<CT_ID>

Displays information on the application EZ template or the software package (if the

-p

option is specified) included in the specified OS EZ template or applied to the indicated the Container.

-p, --package If the <CT_ID> or <CT_NAME> argument is given, the command lists all software packages installed inside the Container. If the <OS_template> argument is given, the command lists all packages included in the OS EZ template.

-C, --cache Displays the information on the specified package from the local vzpkg cache.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file.

-r, --remote

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file, you should use this option to make vzpkg info get the information on the specified package from the remote repositories set for handling the EZ template where this package is included.

-d, --debug

<num>

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

-q, --quiet

Disables logging to the screen and to the log file.

While executed, vzpkg info parses the subdirectories and files located in the

/vz/template/<os_name>/<os_version>/<arch>/config

directory and containing the

EZ template meta data. To run the command, you should specify either the OS EZ template name or the Container ID. In either case, detailed information on the corresponding OS EZ template is displayed. You can also use the -F option to get the necessary information on any application EZ template included into the OS EZ template or applied to the Container.

By default, vzpkg info displays all meta data on the EZ template/package specified. However, you can reduce the amount of the output information by using special parameters

(<parameters>) listed in the table below:

Name name packages repositories

Description

The name of the EZ template/package.

The packages included in the EZ template. For EZ templates only.

The repository where the packages comprising the EZ template are stored.

For EZ templates only.

153

Managing Containers mirrorlist distribution summary description technologies version release arch

The URL to the file containing a list of repositories from where the packages comprising the EZ template are to be downloaded. For EZ templates only.

The Linux distribution on the basis the OS EZ template has been created or under which the application EZ template is to be run. For EZ templates only.

Brief information on the EZ template/package.

Detailed information on the EZ template/package. As distinct from summary

, it can contain additional data on the EZ template/package.

Displays the following information:

The microprocessor architecture where the EZ template is to be used (x86, x86, ia64);

Specifies whether the EZ template can be used only on the servers with the Native POSIX Thread Library (NPTL) support. In this case the nptl entry is displayed after the vzpkg info execution.

For EZ templates only.

The version of the software package.

The release of the software package.

The system architecture where the EZ template/package is to be used. It can be one of the following:

• x86

if the EZ template/package is to be used on 32-bit platforms;

• x86_64

if the EZ template is to be used on x86-64-bit platforms

(e.g. on servers with the AMD Opteron and Intel Pentium D processors installed);

• ia64

if the EZ template is to be used on IA-64-bit platforms (i.e. on servers with the Itanium 2 processor installed). config_path

Displays the path to the EZ template configuration directory containing the template meta data where the meta data for the base OS EZ template are stored (the default directory path is

/vz/template/<os_name>/<os_version>/<arch>/config/os/d efault

). package_manager_type

The packaging system used to handle the packages included in the specified EZ template. It can be one of the following:

• rpm

for RPM-based Linux distributions (Fedora Core, Red Hat

Enterprise Linux, etc.); package_manager

• dpkg

for Debian-based Linux distributions (e.g. Debian and

Ubuntu).

For EZ templates only.

The package manager type used to manage the packages included in the specified EZ template. It can be one of the following:

32-bit Linux distributions:

• rpm44x86

: Red Hat Enterprise Linux 5, Fedora Core 4, 5, and

6 and Fedora 7 and 8;

154

Managing Containers

• rpm43x86

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4, 5;

• rpm41x86

: SUSE Linux Enterprise Server 10 and SUSE Linux

10.x where x denotes the minor number of the SUSE Linux 10 release (e.g. 10.1 or 10.2);

• rpm41s9x86

: SUSE Linux Enterprise Server 9;

• dpkg

: Debian and Ubuntu;

64-bit Linux distributions for x86-64 processors:

• rpm44x64

: Red Hat Enterprise Linux 5, Fedora Core 4, 5, and

6, Fedora 7 and 8;

• rpm43x64

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4, 5;

• rpm41x64

: SUSE Linux Enterprise Server 10 and SUSE Linux

10.x where x denotes the minor number of the SUSE Linux 10 release (e.g. 10.1 or 10.2);

• rpm41s9x64

: SUSE Linux Enterprise Server 9;

• dpkgx64

: Debian and Ubuntu;

64-bit Linux distributions for ia64 processors:

• rpm44i64

: Red Hat Enterprise Linux 5;

• rpm43i64

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4 and 5;

• rpm41s9i64

: SUSE Linux Enterprise Server 9;

• rpm41i64

: SUSE Linux Enterprise Server 10;

• dpkgi64

: Debian and Ubuntu.

155

Managing Containers

vzpkg status

This command is used to check the status of the packages either installed inside a Container or included in an OS EZ template. It has the following syntax: vzpkg status [options] <CT_ID>|<CT_NAME>|<OS_template>

You can use the following options with vzpkg status:

Option

-C, --cache

-r, --remote

-d, --debug

<num>

-q, --quiet

Description

Makes the vzpkg status command look for available updates in the local vzpkg

cache only. You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the

METADATA_EXPIRE

parameter specified in the /etc/vztt/vztt.conf file.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg status

look for the package updates in the remote repositories set for handling the corresponding EZ template.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

When executed, the command performs the following operations:

Checks all the packages installed inside the specified Container or included in the specified OS

EZ template.

Checks the repository used to install/update packages inside the Container/OS EZ template.

Compares the packages in the repository with those inside the Container/OS EZ template.

Lists the found packages updates for the Container/OS EZ template, if any, or informs you that the Container/OS EZ template is up-to-date.

Note: The vzpkg status command can be executed for running Containers only.

156

Managing Containers

vzpkg install

This command is used to add an application EZ template to or install a software package inside a

Container. It has the following syntax: vzpkg install [options] <CT_ID>|<CT_NAME> <object> [...]

The vzpkg install command will add an object (<object>) which can be either an application

EZ template or a standard software package to the Container with the ID of <CT_ID> or with the name of <CT_NAME>. You can specify a number of objects to be applied to your Container.

When executed, vzpkg install automatically handles the interdependencies among the packages to be installed inside a Container and ensures that all dependencies are satisfied. If the package dependencies cannot be resolved, the installation process will fail and the corresponding message will be displayed.

Options available to this command are:

Name

-p, --package

-f, --force

-C, --cache

-r, --remote

-n, --check-only

-d, --debug

<num>

-q, --quiet

Description

Tells the vzpkg install command to install software packages instead of EZ templates.

Forces the EZ template/package installation.

Makes the vzpkg install command look for the packages included in the EZ template in the local vzpkg cache only. If there is a package not available locally, the command will fail.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg install

look for the packages in the remote repositories set for handling the corresponding EZ template.

Simulates the same operations as vzpkg install completes without specifying this option (downloads the software packages to the server, handles the package interdependencies, etc.); however, the packages themselves are not installed in the specified the Container.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

By default, the specified object is treated by vzpkg install as an application EZ template.

However, you can use the -p option to explicitly specify that the object should be considered as a software package.

Installing packages by using the vzpkg install command has the following main advantages:

157

Managing Containers

The dependencies for software packages are automatically checked during the installation process; so, you do not have to bother any more on how to resolve possible package dependencies.

During the package installation, only symlinks to the installed files on the server are created and added to the Container private area, which allows you to noticeably save disk space inside your

Containers.

You can update the installed packages by running the vzpkg update command. For the information on this command, please see the next subsection.

Note: A Container has to be running in order to apply an application EZ template to or install a package inside this Container.

158

Managing Containers

vzpkg update

The vzpkg update command is used to update either the OS EZ template a Container is based on or any of the application EZ templates inside the Container. Besides, you can use this command to update the software packages installed inside your Container by means of the vzpkg install command. It has the following syntax: vzpkg update [options] <CT_ID>|<CT_NAME> [<object> [...]]

The following options can be used with vzpkg update:

Name

-C, --cache

Description

Makes the vzpkg update command look for the package updates in the local vzpkg

cache only.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file.

-r, --remote

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file, you should use this option to make vzpkg update look for the package updates in the remote repositories set for handling the corresponding EZ templates.

-p, --package Updates the packages installed inside the Container by using the vzpkg install command.

-f, --force Forces the EZ template/package update procedure.

-n, --checkonly

Simulates the same operations as vzpkg update completes without specifying this option (downloads the updated packages to the server, handles their interdependencies, etc.); however, the packages themselves are not updated.

-d, --debug

<num>

-q, --quiet

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

Without any option specified, vzpkg update updates all EZ templates (including the OS EZ template) inside the Container with the ID of <CT_ID> or the name of <CT_NAME>. However, you can make the command update a particular EZ template by specifying its name as <object>. You can also use the -p option to make the command update the packages installed inside the

Container by using vzpkg install instead of EZ templates.

159

Managing Containers

vzpkg remove

This command is used to remove an application EZ template or a software package from a

Container. It has the following syntax: vzpkg remove [options] <CT_ID>|<CT_NAME> <object> [...]

This command will remove an object (object) which can be either an application EZ template or a standard software package (if the -p option is specified) installed with the vzpkg install command from the Container with the ID of CT_ID or with the name of <CT_NAME>. You may specify a number of objects for removing.

The options available to this command are:

Name

-p, --package

-w, --withdepends

Description

Removes the specified package(s) from the Container.

Removes also the packages having dependencies with the object specified.

-f, --force

-d, --debug

<num>

Forces the EZ template/package deletion.

-n, --check-only

Simulates the same operations as vzpkg remove completes without specifying this option (handles interdependencies of the packages to be removed from the server, etc.); however, the packages themselves are not deleted from the specified

Container(s).

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

-q, --quiet

Disables logging to the screen and to the log file.

By default, the specified object is treated by vzpkg remove as an application EZ template.

However, you can use the -p option to explicitly specify that the object should be considered as a software package.

Note: A Container has to be running in order to remove an application EZ template/package from it.

160

Managing Containers

vzpkg link

If an application (or its update) was directly installed inside a Container, whereas a compatible application EZ template is also installed on the server, the Container can be linked to this template, so the real files inside the Container are replaced with symlinks to these very files on the server. The vzpkg link

command has the following syntax: vzpkg link [options] <CT_ID>|<CT_NAME>

The options that can be used with this command are the following:

Option

-s, --slow

-C, --cache

-r, --remote

-d, --debug

<num>

-q, --quiet

Description

Check all packages inside the Container including the ones installed by using the technology of Parallels Server Bare Metal templates and replace the real application files, if any, with symlinks to the files on the server.

Makes the vzpkg link command look for the packages in the local vzpkg cache only. If there is a package not available locally, the command will fail.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file; in this case vzpkg link will also check the local vzpkg cache only.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the/etc/vztt/vztt.conf file, you should use this option to make vzpkg link look for the packages in the remote repositories set for handling the corresponding EZ templates.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

161

Managing Containers

vzpkg create cache

This command is used to create tarballs (caches) for OS EZ templates. You should execute this command before you can start using a newly installed OS EZ template for creating Containers. It has the following syntax: vzpkg create cache [options] [<OS_template> [...]]

You can use the following options with this command:

Name

-C, --cache

-r, --remote

-d, --debug

<num>

-q, --quiet

-f, --force

Description

Makes the vzpkg create cache command check for the packages included in the EZ OS template in the local vzpkg cache only and use them for the cache creation.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file. In this case vzpkg create cache

will also check the local vzpkg cache only.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg create cache

check for the packages included in the EZ OS template in the remote repositories set for its handling.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

Forces the process of the cache creation. vzpkg create cache

checks the template area on the server (by default, the /vz/template directory is used) and if it finds an OS EZ template for which no tar archive exists, it creates a gzipped tarball for the corresponding OS EZ template and places it to the /vz/template/cache directory. When a Container is being created, pctl just unpacks the tar archive.

By default, vzpkg create cache checks the tar archive existence for all OS EZ templates installed on the server and creates some, if necessary. However, you can explicitly indicate what

OS EZ template should be cached by specifying its name as <OS_template>. If the cache of the

OS template specified already exists on the server, the command will fail and you will be presented with the corresponding error message.

162

Managing Containers

vzpkg update cache

This command is used to update tarballs (caches) of the OS EZ templates installed on the server. It has the following syntax: vzpkg update cache [options] [<OS_template> [...]]

You can pass the following options to this command:

Name

-C, --cache

-r, --remote

Description

Makes the vzpkg update cache command check for the packages updates in the local vzpkg cache only and use them for the cache creation.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file. In this case vzpkg update cache

will also check the local vzpkg cache only.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg update cache

check for the packages updates in the remote repositories set for handling the given EZ OS template. vzpkg update cache

checks the cache directory in the template area (by default, the template area is located in the /vz/template directory on the server) and updates all existing tarballs in this directory. However, you can explicitly indicate what OS EZ template tarball is to be updated by specifying its name as <OS_template>. Upon the vzpkg update cache execution, the old tarball is renamed by receiving the -old suffix (e.g. redhat-el5-x86.tar.gz-old).

If the vzpkg update cache command does not find a tarball for one or more OS EZ templates installed on the server, it creates the corresponding tar archive(s) and puts them to the

/vz/template/cache

directory.

163

Managing Containers

vzpkg remove cache

This command removes the cache for the OS EZ templates specified. It has the following syntax: vzpkg remove cache [options] [<OS_template> [...]]

You can use the following options with this command:

Name

-d, --debug

<num>

-q, --quiet

Description

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

By default, vzpkg remove cache deletes all caches located in the /vz/template/cache directory on the server. However, you can explicitly indicate what OS EZ template tar archive is to be removed by specifying its name as <OS_template>.

Note: The OS EZ template caches having the -old suffix are not removed from the

/vz/template/cache

directory. You should use the -rm command to delete these caches from the server.

164

Managing Containers

vzpkg localinstall

The vzpkg localinstall command is used to install a software package inside a Container from the corresponding file on the server. It has the following syntax: vzpkg localinstall [options] <CT_ID>|<CT_NAME> rpm_file_path [...]

Options available to this command are:

Name

-C, --cache

-r, --remote

-n, --check-only

-d, --debug

<num>

-q, --quiet

Description

When handling the package interdependencies, makes the vzpkg localinstall

command look for the needed packages in the local vzpkg cache only. If there is a package not available locally, the command will fail.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file.

If the elapsed time from the last vzpkg local cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg localinstall

look for the packages in the remote repository.

Simulates the same operations as vzpkg localinstall completes without specifying this option (e.g. handles the package interdependencies); however, the package itself is not installed in the specified Container.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

When executed, the command installs the package, the full path to which is specified as rpm_file_path

, inside the Container with the ID of <CT_ID> or with the name of <CT_NAME>.

You may specify a number of packages at once to be installed inside the Container.

During its execution, vzpkg localinstall automatically handles the interdependencies among the packages to be installed inside a Container and ensures that all dependencies are satisfied. If the package dependencies cannot be resolved, the installation process will fail and the corresponding message will be displayed.

165

Managing Containers

vzpkg localupdate

The vzpkg localupdate command is used to update the software packages installed inside your Container(s) by means of the vzpkg install or vzpkg localinstall commands. It has the following syntax: vzpkg localupdate [options] <CT_ID>|<CT_NAME> rpm_file_path [...]

Options available to this command are:

Name

-C, --cache

-r, --remote

-n, --check-only

-d, --debug

<num>

-q, --quiet

Description

When handling the package interdependencies, makes the vzpkg localupdate

command look for the needed packages in the local vzpkg cache only. If there is a package not available locally, the command will fail.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file.

If the elapsed time from the last vzpkg local cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg localupdate

look for the packages in the remote repository.

Simulates the same operations as vzpkg localupdate completes without specifying this option (e.g. handles the package interdependencies); however, the package itself is not installed in the specified Container.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

When executed, vzpkg localupdate compares the file on the server the full path to which is specified as rpm_file_path with the corresponding package inside the Container with the ID of

<CT_ID> or the name of <CT_NAME> and updates it, if necessary. You may specify a number of packages at once to be updated inside your Container.

166

Managing Containers

vzpkg upgrade

The vzpkg upgrade command is used to upgrade an OS EZ template the Container is based on to a newer version. It has the following syntax: vzpkg upgrade [options] <CT_ID>|<CT_NAME>

You can use the following options with this command:

Name

-C, --cache

Description

Makes the vzpkg upgrade command check for the packages included in the OS EZ template in the local vzpkg cache only. If any package is not available locally, the command will fail.

You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file; in this case vzpkg upgrade will also check the local vzpkg cache only.

-r, --remote If the elapsed time from the last local vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg upgrade

check for the packages in the remote repositories set for handling the given EZ OS template.

-n, --check-only

Simulates the same operations as vzpkg upgrade completes without specifying this option (downloads the packages to the server, handles their interdependencies, etc.); however, the packages themselves inside the

Container are not upgraded.

-f, --force

Forces the process of upgrading the OS EZ template.

-d, --debug

<num>

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

-q, --quiet

Disables logging to the screen and to the log file.

167

Managing Containers

vzpkg fetch

This command is used to download packages included in the corresponding OS EZ template or their updates from the remote repository to the vzpkg local cache on the server and to prepare them for installation. It has the following syntax: vzpkg fetch [options] <OS_template>

You can pass the following options to vzpkg fetch:

Option Description

-O, --os

Download packages/updates for the specified EZ OS template.

-A, --app

-C, --cache

-r, --remote

-f, --force

-d, --debug

<num>

-q, --quiet

Download packages/updates for EZ application templates used with the EZ specified OS template.

Makes the vzpkg fetch command look for the metadata in the vzpkg local cache only. You can omit this parameter if the elapsed time from the last vzpkg

cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the /etc/vztt/vztt.conf file.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg fetch

look for the OS EZ template metadata in the remote repositories set for handling the corresponding EZ template.

Forces the process of downloading packages and/or their updates to the server.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

You can make vzpkg fetch run as a cron job (e.g. nightly) checking for available packages or packages updates for your EZ templates and keeping them in the local cache. Having all the necessary packages in the vzpkg local cache can greatly speed up the execution of the vzpkg install

, vzpkg update, or vzpkg create cache commands since the packages are available locally and there is no need to check for them in the corresponding remote repositories.

168

Managing Containers

vzpkg clean

This command is used to remove the software packages, their headers, and metadata downloaded to the server from the repository during the vzpkg execution (e.g. while caching an OS EZ template or adding an application EZ template to a Container for the first time). It has the following syntax: vzpkg clean [options] [<OS_template> [...]]

You can use the following options with vzpkg clean:

Name

-k, --clean-packages

-t, --clean-template

-a, --clean-all

-f, --force

-n, --check-only

-d, --debug

<num>

-q, --quiet

Description

Removes the packages, headers, and metadata of the specified EZ OS template from the local vzpkg cache. This is also the default behaviour of vzpkg clean.

Checks the template area for the specified EZ OS template (the template area has the default path of /vz/template) and removes all packages that are currently not used by any Container on the server and not included in the EZ OS template cache.

Removes both:

• the packages, headers, and metadata of the specified EZ OS template from the vzpkg local cache and

• the packages that are currently not used by any Container on the server and not included in the EZ OS template cache.

Forces the vzpkg clean execution.

Simulates the same operations as vzpkg clean completes without specifying this option; however, the packages and headers are not removed from the server.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

169

Managing Containers

vzpkg update metadata

This command is used to update the OS EZ template local metadata on the server. It has the following syntax: vzpkg update metadata [options] [OS_template ...]

The following options can be used with vzpkg update metadata:

Name

-C, --cache

-r, --remote

-d, --debug

<num>

-q, --quiet

Description

Makes the vzpkg update metadata command look for available metadata updates in the local vzpkg cache only. You can omit this parameter if the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file.

If the elapsed time from the last vzpkg cache update does not exceed the value of the METADATA_EXPIRE parameter specified in the

/etc/vztt/vztt.conf

file, you should use this option to make vzpkg update metadata

look for the updated metadata in the remote repositories set for handling the corresponding OS EZ template.

Sets the debugging level to one of the specified values (from 0 to 10). 10 is the highest debug level and 0 sets the debug level to its minimal value.

Disables logging to the screen and to the log file.

When executed without any options, the command updates the metadata of all OS EZ templates installed on the server. If you specify one or more OS EZ templates, the command will update the metadata of the indicated OS templates only. You can run this command a cron job at regular intervals to be sure that your OS EZ templates metadata are always up-to-date.

170

Managing Containers

vzmktmpl

This utility is used to create new EZ templates. It has the following syntax: vzmktmpl [options] metafile

The following options can be passed to vzmktmpl:

Name

--pre-cache file

--post-cache file

--pre-install file

--post-install file

--pre-upgrade file

--post-upgrade file

--pre-update file

--post-update file

--pre-remove file

--post-remove file

--environment file

Description

The path to the script which will be executed by the vzpkg cache command before installing the packages included in the EZ template on the server. This script is executed in the server context and relevant for OS

EZ templates only.

The path to the script which will be executed by the vzpkg cache command after installing the packages included in the EZ template on the server. This script is executed in the server context and relevant for OS EZ templates only.

The path to the script which will be executed by the vzpkg install command before adding the application EZ template to the Container. This script is executed in the Container context and relevant for application EZ templates only.

The path to the script which will be executed by the vzpkg install command after adding the application EZ template to the Container. This script is executed in the Container context and relevant for application EZ templates only.

The path to the script which will be executed by the vzpkg upgrade command before upgrading the OS EZ template inside the Container. This script is executed in the Container context.

The path to the script which will be execute by the vzpkg upgrade command after upgrading the OS EZ template inside the Container. This script is executed in the Container context.

The path to the script which will be executed by the vzpkg update command before updating the packages included in the application EZ template inside the Container. This script is executed in the Container context.

The path to the script which will be executed by the vzpkg update command after updating the packages included in the application EZ template inside the Container. This script is executed in the Container context.

The path to the script which will be executed by the vzpkg remove command before removing the application EZ template from the Container.

This script is executed in the Container context and relevant for application

EZ templates only.

The path to the script which will be executed by the vzpkg remove command after removing the application EZ template from the Container.

This script is executed in the Container context and relevant for application

EZ templates only.

The path to the file storing a list of environment variables. The variables should be set in the form of key=value. The variables specified in this file are used when running the vzpkg create cache and vzpkg update

171

Managing Containers

-d, --doc file

-s, --spec-only

-r, --srpm

-h, --help cache

commands and exported to the Container environment during the

EZ template scripts execution.

The path to the file containing the information on the EZ template. You can specify several files and separate them by commas.

Creates the package specification file only.

Creates the package source file only.

Displays the utility usage and exits.

The utility requires only the metafile to create an EZ template and save it as a software package

(see the next subsection for information on EZ template metafiles). However, you can set a number of scripts to be executed on different stages of the EZ template lifecycle (e.g. upon its installing on the server or after its removing from the Container) or use other options listed in the table above.

Note: We recommend that you use the sample scripts located in the /usr/share/vztt/samples directory on your server as the basis for creating your own scripts.

172

Managing Containers

vzpkg.metafile

This file is used by the vzmktmpl utility as the basis for the EZ template creation. 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

%osname

%osver

%osarch

%appname

%setname

Description

Mandatory. The name of the Linux distribution for which you are creating the

OS EZ template or under which the application EZ template being created is to be run.

Mandatory. The version of the Linux distribution specified as the value of the

%osname

parameter.

Mandatory. The microprocessor architecture where the EZ template is to be run. You can set the value of this parameter to one of the following:

x86: this value should be specified if your EZ template is to be used on 32-bit platforms.

• x86-64

: this value should be specified if your EZ template is to be used on x86-64-bit platforms (e.g. on servers with the AMD

Opteron and Intel Pentium D processors installed).

• ia64

: this value should be specified if your EZ template is to be used on IA-64-bit platforms (i.e. on servers with the Itanium 2 processor installed).

Mandatory, for application EZ templates only. The name of the application

EZ template.

Optional. The name of the non-base OS EZ template, if any. This parameter should be specified only while creating non-base OS EZ templates.

%upgradable_version

%packages

Optional. A list of Linux distribution versions which can be upgraded to the version of the Linux distribution for which you are creating the EZ template.

For OS EZ templates only.

Mandatory. A list of software packages to be included in the EZ template.

The names of the packages listed as the value of this parameter should correspond to the names of real packages that are stored in the repository used for managing your EZ templates and can be specified in one of the following ways:

For RPM-based Linux distributions:

• as a package name only (e.g. wget)

• as a package name with the indication of the system architecture on which the package is to be run (e.g. wget.i386

, wget.noarch)

• as a package name with its versions (e.g. wget-1.9.1)

• as a package name with its versions and release number (e.g.

173

Managing Containers

%packages_0

%packages_1

%package_manager wget-1.9.1-12

)

• as a package name with its version, release number, and system architecture (e.g. wget-1.9.1-12.i386)

• as a package name with its version, release number, system architecture, and epoch number (e.g. 10:wget-1.9.1-

12.i386

)

For Debian-based Linux distributions:

• as a package name only (e.g. wget)

• as a package name with its version (e.g. wget-1.9.1-12)

Mandatory, for Debian-based OS EZ templates only. A list of packages to be used for creating a minimal Debian/Ubuntu chroot environment. These packages should correspond to those installed on a standalone server on the first stage of the Ubuntu distribution installation. The packages will be installed on the server one by one in the specified order during the OS EZ template caching. If you wish several packages to be simultaneously installed on the server, you should specify the package names on a single line and separate them by spaces.

Mandatory, for Debian-based OS EZ templates only. A list of 'base' packages for the Debian/Ubuntu distribution. These packages are needed to install the packages listed as the value of the %packages parameter.

Mandatory. The short name of the package manager to be used for handling the EZ template. Depending on the Linux distribution for which you are creating the template or under which the template will be used, you should set the following values for the PKGMAN parameter:

32-bit Linux distributions:

• rpm44x86

: Red Hat Enterprise Linux 5, Fedora Core 4, 5, and

6, Fedora 7 and 8

• rpm43x86

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4, 5

• rpm41x86

: SUSE Linux Enterprise Server 10 and SUSE Linux

10.x where x denotes the minor number of the SUSE Linux 10 release (e.g. 10.1 or 10.2)

• rpm41s9x86

: SUSE Linux Enterprise Server 9

• dpkg

: Debian and Ubuntu

64-bit Linux distributions for x86-64 processors:

• rpm44x64

: Red Hat Enterprise Linux 5 and Fedora Core 4, 5, and 6, Fedora 7 and 8

• rpm43x64

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4, 5

• rpm41x64

: SUSE Linux Enterprise Server 10 and SUSE Linux

10.x where x denotes the minor number of the SUSE Linux 10 release (e.g. 10.1 or 10.2)

• rpm41s9x64

: SUSE Linux Enterprise Server 9

174

Managing Containers

%repositories

%mirrorlist

%distribution

%description

%version

%release

%license

%changelog

• dpkgx64

: Debian and Ubuntu

64-bit Linux distributions for ia64 processors:

• rpm44i64

: Red Hat Enterprise Linux 5

• rpm43i64

: Red Hat Enterprise Linux 3 and 4 (with the 2.6 kernel and NPTL support) and CentOS 4, 5

• rpm41s9i64

: SUSE Linux Enterprise Server 9

• rpm41i64

: SUSE Linux Enterprise Server 10

• dpkgi64

: Debian and Ubuntu

This parameter should be obligatorily specified for all base OS EZ templates and can be omitted for application EZ templates and non-base OS EZ templates.

Mandatory, for RPM-based Linux distributions only. A list of repositories where the packages comprising the EZ template are stored.

Mandatory. One or several URLs to the file containing a list of repositories from where the packages comprising the EZ template are to be downloaded. This parameter can be omitted if you are creating a metafile for an application EZ template or a non-base OS EZ template.

Optional. The type of the Linux distribution. Examples of Linux distribution types are centos, debian, fedora-core, gentoo, mandrake, redhat

, rhel-3, rhel-4, rhel-5, fedora-core-4, fedoracore-5

, slackware, slackware-10.0, suse, suse-9.3, etc.

Optional. Detailed information on the EZ template package file.

Optional. The version of the EZ template package file.

Optional. The release of the EZ template package file.

Optional. The information about the owner of the EZ template package file.

Optional. The information about the changes made to the EZ template package file.

vzpkgproxy

The vzpkgproxy utility is used to set up a caching proxy server meant for handling OS and application EZ templates. The vzpkgproxy package where the vzpkgproxy utility is included can be installed by using the rpm -i command on any computer meeting the following requirements:

The Apache httpd server, version 2.0.52 and higher, should be installed on the workstation.

The createrepo package, version 0.4.2 and higher, should be installed on the workstation.

During its installation, the utility performs all the tasks necessary to install, configure, and put into operation your caching proxy server. Detailed information on how to set up caching proxy servers is given in the Parallels Containers 4.6 Templates Management Guide.

175

Managing Containers

vzrhnproxy

The vzrhnproxy utility is used to set up a Red Hat Network (RHN) Proxy Server meant for handling the packages included in the RHEL 4 and 5 OS EZ templates. It has the following syntax: vzrhnproxy register OS_arch OS_name server_hostname

server1_IP_Address [server2_IP_Address ...] vzrhnproxy list vzrhnproxy update [profile_name ...] vzrhnproxy help

The vzrhnproxy utility can be installed with the rpm -i command on any 'RHEL 4'-based server (e.g. RHEL 4 and RHEL 5, Fedora 7 and 8, or CentOS 4 and 5). To start using vzrhnproxy for creating an RHN Proxy Server, you should specify valid credentials in the

/etc/vz/rhnproxy/rhn.conf

file to log in to RHN and run the vzrhnproxy register command on the server where you wish to create the RHN Proxy Server. This command will:

1 Connect to Red Hat Network with the credentials specified in the previous step.

2 Register in RHN and create a system profile for the server with:

• the hostname of HN_hostname

• the OS name of OS_name. In the current version of Parallels Server Bare Metal, this name can be set to one of the following:

* 4AS for Red Hat Enterprise Linux 4 Advanced Server

* 4ES for Red Hat Enterprise Linux 4 Edge Server

* 4WS for Red Hat Enterprise Linux 4 Workstation

* 4Desktop for Red Hat Enterprise Linux 4 Desktop

* 5Server for Red Hat Enterprise Linux 5 Server

* 5Client for Red Hat Enterprise Linux 5 Desktop

• the system architecture of OS_arch which can be one of the following: i386 for 32-bit versions of RHEL 4 and 5, x86_64 for x86-64-bit versions of RHEL 4 and 5, or ia64 for

IA64-bit versions of RHEL 4 and 5

3 Download the headers of the packages comprising the corresponding RHEL distribution to the

RHN Proxy Server.

4 Create a pseudo-repository containing the repodata generated on the basis of the downloaded headers.

5 Grant the server with the IP address of server1_IP_Address access to the RHN Proxy

Server. You can specify several IP addresses to allow several servers to use this Proxy Server.

The vzrhnproxy list command displays a list of all system profiles you have registered with

Red Hat Network.

176

Managing Containers

The vzrhnproxy update command updates the repodata in the pseudo-repository on the

Proxy Server for the specified system profile (profile_name); you can specify more than one system profile whose repodata are to be updated.

177

Managing Containers

Supplementary Tools vzfsutil

This command is used for checking the VZFS consistency, correcting and optimizing the Container private area, upgrade the Container private area from VZFS 1 to VZFS 2. It has the following syntax: vzfsutil [general_options] -t template_path private_path

<action_options>

A Container private area consists of number of VZFS symlinks to templates and when the

Container is running, these VZFS symlinks are visible as regular files inside the Container. When the user inside the Container changes one of the VZFS symlink files, a file with a special name and with the changed content is created in the special copy-on-write directory ($VE_PRIVATE/cow) of the

Container private area. However, when the user creates a file inside the Container, the file is created in the root directory ($VE_PRIVATE/root) of the private area ($VE_PRIVATE).

This utility optimizes the private area by moving copy-on-write files to their actual location in the root directory of the private area. It also checks the correctness of VZFS symlinks and fixes found inconsistencies.

The required parameters for this utility invocation are:

-t template_path

<action_options> private_path

Path to the directory where templates are installed. As a rule, it is

/vz/template

.

One or more actions described below.

Path to the Container private area.

General options

-v

-q

-i

-p, --progress

-V

Verbose mode. Causes the utility to print debugging messages about its progress.

You can give up to two –v switches to increase verbosity.

Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are displayed.

Interactive mode. When this option is given, the utility asks for confirmation before correcting any inconsistency. This option works only with check actions.

Display (at certain intervals) the information on the operations currently performed by vzfsutil.

Display the utility version.

--upgrade

--ctid=CT_ID

Upgrades the Container private area from VZFS v1 to VZFS v2. You can also use -

-ctid

with this option to perform an additional check of the Container private area.

Performs an additional check for the Container with the specified ID.

Action options

178

Managing Containers

Action options can be checking and optimizing. Checking actions have the format of --

<option>[=<action>]

where <action> is one of the following: i, ignore m, move r, remove

Do not repair found inconsistency, only report it. This is the default action if no action is explicitly specified.

Move inconsistent VZFS symlinks into the $VE_PRIVATE/lost_files directory.

Remove inconsistent VZFS symlinks.

Options can be one or several of the following:

--call,--cA

--ccow,--cC

Correct all found errors. This options turn on and set action on all type of corrections. However, you can specify different action on a particular type of correction by adding specific option. For example, you may want to report only all inconsistencies except the orphaned file in copy-on-write area, which you want to remove. In that case you have to issue the command with –-call=i -–ccow=r action options.

Correct orphaned files in the copy-on-write directory $VE_PRIVATE/cow. The file is considered to be orphaned when there is no VZFS symlink in the Container private area referring to the file.

--cmark,--cM

--clink,--cL

Correct broken copy-on-write mark on the VZFS symlink. VZFS uses sticky bit on the VZFS symlink when file is being copied as a mark that copy-on-write directory has a new file for the symlink. The mark is considered to be broken when copy-onwrite area contains no file for the VZFS symlink. If this option is used with the remove

action then VZFS symlink is not removed but the mark (sticky bit) is turned off on the VZFS symlink.

Correct broken VZFS symlink. VZFS symlink is considered to be broken when it points to non-existent or non-regular file in the template directory.

Optimization actions have the format of --<option>[=<action>] where <action> can be one of the following: i, ignore d, do

Do not do actual optimization, only report what can be optimized. This is the default action if no action is explicitly specified.

Proceed with the optimization.

Options can be one or several of the following:

--oall,--oA

--oreplace,--oR

--oempty,--oE

Do all types of optimizations.

Replaces VZFS symlinks in the Container private area with the files found in the copy-on-write directory.

Compares the content of the file in the copy-on-write directory with the file from the template directory and if they are the same, removes the file from the copyon-write directory. It also turns off the copy-on-write mark (sticky bit) from the corresponding VZFS symlink.

The example below illustrates the usage of vzfsutil for getting rid of files in the copy-on-write directory of Container 101.

# ls /vz/private/101/cow

02c38bc341d382c11ecb8140b2811ea3 81294809f6694940b2b8bd321ceda09e

1052304dc986a695b12d34eaf1324976 823500b4147c2d3a30e4478faee48550

2dfb1f92fc775fc85d7898391d72080d 96c61677e816f3433e3f0eeb6e539380

179

Managing Containers

410fb765985f96d07b5e90b875cb325f a5f1c84a031fcf70743896779758a181

57ec3d1ee07a848f883ca6ba4511e9bc b46db38473ff5b6082c1803f0cc1f59c

# vzfsutil -t /vz/template --oall=d /vz/private/101

Optimization: 'cow' '57ec3d1ee07a848f883ca6ba4511e9bc' \ different from 'template' 'redhat-el5-x86/initscripts-6.43-1/sbin/ifup'

Optimized: replaced 'magic' 'sbin/ifup' with 'cow' \

'57ec3d1ee07a848f883ca6ba4511e9bc'

Optimization: non-changed 'cow' '410fb765985f96d7b5e90b875cb325f' \ for 'etc/printcap'

Optimized: removed non-changed 'cow' '410fb765985f96d7b5e90b875cb325f'

[further output suppressed]

# ls -l /vz/private/101/cow total 0

Caution: Potentially, with incorrect usage (for example, if you specify the remove action with noninteractive mode and incorrect template area), this utility may destroy VZFS private area. Use this utility with care. It is highly recommended to run it in the “report-only” mode before making any changes.

vzcache

The vzcache utility scans the specified Containers for common files and caches these files in the server template area (/vz/template/vc by default), replacing the real files inside the Containers with symlinks to the template area. In the case of a significant number of identical files, using this utility results in a notable disk space gain. vzcache has the following syntax: vzcache [options] CT_ID-list

The following command-line options can be used with the vzcache utility:

Option

-h

, --help

--version

-v

, --verbose

-q

, --quiet

-r

, --cachearea

-C

, --clean

-s

, --size-limit N

Description

Print the usage information.

Display the utility version.

Verbose mode. Causes vzcache to print debugging messages about its progress. Multiple -v options increase verbosity; the maximal number is 2.

Quiet mode. Print error messages only.

Process the Container template area only. During the vzcache execution, a separate template area (/vz/template/vc/CT_UUID by default) is created for each specified Container. CT_UUID denotes the Container unique identifier and can be determined by viewing the

UUID

parameter in the Container configuration file.

You are recommended to use this option when running vzcache for migrated or restored Containers.

Clears the Container template area (/vz/template/vc/CT_UUID by default) from those cached files that are not present any more inside the corresponding Container. Only one Container can be cleaned up at a time.

Do not process files smaller than N bytes. By default, only empty files are not processed.

180

Managing Containers

vzps and vztop

These two utilities can be run on the server just as the standard Linux ps and top utilities. For information on the ps and top utilities, consult Linux Administrator's Guide or the corresponding man pages. The vzps and vztop utilities provide certain additional functionality related to monitoring separate Containers running on the server.

The vzps utility has the following functionality added:

The -E CT_ID command-line switch can be used to show only the processes running inside the Container with the specified ID.

The vztop utility has the following functionality added:

The -E CT_ID command-line switch can be used to show only the processes running inside the Container with the ID specified. If -1 is specified as CT_ID, the processes of all running

Containers are displayed.

The e interactive command (the key pressed while top is running) can be used to show/hide the CTID column, which displays the Container where a particular process is running (0 stands for the server itself).

The E interactive command can be used to select another Container the processes of which are to be shown. If -1 is specified, the processes of all running Containers are displayed.

181

Managing Containers

vzsetxinetd

To switch the service running in a particular Container between an independent and xinetddependent modes, the vzsetxinetd utility is used. It has the following syntax: vzsetxinetd -h vzsetxinetd -s CT_ID SERVICE ... vzsetxinetd [-u] [-f] CT_ID SERVICE on|off ... where CT_ID is the ID of the corresponding Container, and SERVICE is the corresponding service: sendmail

, sshd, proftpd, or courier-imap. There may be any number of the SERVICE or

SERVICE on|off

strings in a single invocation of the vzsetxinetd utility. With "on", the service will be based on xinetd; if "off" is specified, it will be standalone.

Notes:

1. The courier-imapd, courier-imapds, courier-pop3d, and courier-pop3ds services are provided by the courier-imap service, thus vzsetxinetd can manage these services via the courier-imap

service.

2. The Parallels HSPcomplete application cannot be used for managing Containers having one or more services configured with the vzsetxinetd utility.

Here follows the explanation of available options:

-h

, --help

-s

, --state

-u

, --userfiles

-f

, --force

Prints help on the usage of the utility.

Prints the information on whether the corresponding service is xinetd-dependent or standalone.

This option tells the utility to save the previously saved user files related to the service.

This option tells the utility to set the service to the specified mode even in case the service is currently in this mode already.

182

Managing Containers

vzdqcheck

This utility counts inodes and disk space used using the same algorithm as Parallels Server Bare

Metal quota. It has the following syntax: vzdqcheck [options] <path>

The command traverses directory tree given as the path argument and calculates space occupied by all files and number of inodes. The command does not follow mount points and correctly handles VZFS symlinks unlike the standard du command.

Options available to the vzdqcheck command are:

-h

Usage info.

-V vzquota

version info.

-v

Verbose mode.

-q

Quiet mode.

183

Managing Containers

vzdqdump and vzdqload

The vzdqdump and vzdqload utilities are used for dumping the Container user/group quota limits and grace times from the kernel or the quota file or for loading them to a quota file, respectively. vzdqdump

displays the corresponding values on the console screen, and vzdqload gets the information from the standard input.

The syntax of the commands is the following: vzdqdump [general_options] quota_id [-f] [-c quota_file] –G|-U|-T vzdqload [general_options] quota_id [-c quota_file] –G|-U|-T

The general options are described in the table below:

-h

Usage info.

-V vzquota

version info.

-v

Verbose mode.

-q

Quiet mode.

The quota_id parameter corresponds to the ID of the Container for which you wish to dump/load the quotas. Other options are the following:

-f

-c quota_file

-G, --grace

-U, --limits

-T, --exptimes

Dump the user/group quota information from the kernel rather than from the quota file

Specifies a quota file to process other than the default quota file

(var/vzquota/quota.<CT_ID>)

Dump/load user/group grace times

Dump/load user/group disk limits

Dump/load user/group expiration times

Quotas must be turned off when the vzdqload utility is working. Mind that only 2nd-level disk quotas are handled by the utilities.

184

Managing Containers

vznetstat

This utility outputs traffic usage statistics for Containers. It has the following syntax: vznetstat [-4|-6] [-v <ID>] [-c <class>] [-a] [-r]

The utility displays input and output traffic for Containers for each defined network class, in bytes.

The network classes are described in the /etc/vz/conf/networks_classes file. vznetstat displays statistics only on Containers that were started at least once.

The utility accepts the following options:

-4|-6

-v <ID>

-c <class>

-a

-r

-h, -help

Display IPv4 or IPv6 statistics for Containers. By default, the total amount of IPv4 and

IPv6 statistics is shown.

Display statistics for the specified Container. Multiple –v options can be given to a single vznetstat invocation.

Display statistics for the <class> class only.

Display statistics for all classes.

Rounds down the statistics results, which is shown in bytes by default. In this case, the statistics is displayed in the following units of measurement, depending on the amount of traffic:

• K(b)

—kilobytes

• M(b)

—megabytes

• G(b)

—gigabytes

Display the utility usage information.

vzcpucheck

This utility displays the current server utilization in terms of allocated CPU units as well as total server CPU units capacity. It has the following syntax: vzcpucheck [-v]

Without arguments, the utility prints the sum of CPU units of all running Containers and the total server capacity. If the –v option is given, the utility prints per Container CPU units information.

185

Managing Containers

vzmemcheck

This utility shows the server memory parameters: low memory utilization, low memory commitment,

RAM utilization, memory+swap utilization, memory+swap commitment, allocated memory utilization, allocated memory commitment, allocated memory limit. It has the following syntax: vzmemcheck [-v] [-A]

The following options can be specified in the command-line:

-v

Display information for each Container.

-A

Display absolute values (in megabytes).

It is possible to use any of the available options, both of them, or to do without any options.

vzcalc

This utility is used to calculate Container resource usage. It has the following syntax: vzcalc [-v] <CT_ID>

This utility displays what part of server resources Container <CT_ID> is using. An optional –v switch produces verbose output including number of processes, low memory, allocated memory and memory and swap statistics.

For stopped Containers the utility displays promised and maximum values the Container can consume. For running Containers, it also outputs the current values.

The high values of resource usage means that either the server is overcommitted or Container configuration is invalid.

vzcheckovr

This utility is used to check the current system overcommitment and safety of the total resource control settings. It runs as follows: vzcheckovr [-v] where –v is the option for verbose output. This utility computes the commitment levels of a number of resource management parameters (Low Memory, Memory + Swap, Allocated Memory) and compares them with the values chosen by the Parallels Server Bare Metal administrator in the

/etc/vz/vz.conf

global configuration file. The utility will produce a warning if these configured values are exceeded. Similarly to vzmemcheck, vzcheckovr takes into account only those

Containers that are currently running and ignores all the others existing on the server.

186

Managing Containers

vzpid

This utility prints the ID of the Container where the process is running. It has the following syntax: vzpid <pid> [<pid>…]

Multiple process IDs can be specified as arguments.

vzsplit

This utility is used to generate a sample Container configuration file with a set of system resource control parameters. The syntax of this command is as follows: vzsplit [-n num] [-f sample_name] [-s swap_size]

This utility is used for dividing the server into equal parts. It generates a full set of Containers system resource control parameters based on the total physical memory of the server it runs on and the number of Containers the server shall be able to run even if the given number of Containers consume all allowed resources.

Without any option the utility prompts for the desired number of Containers and outputs the resulting resource control parameters to the screen.

The utility accepts the following options:

-n num

-f sample_name

-s swap_size

Desired number of Containers to be simultaneously run on the server.

Name of the sample configuration to create.

Size of the swap file on the server. It is recommended to specify the swap size to be taken into account when the utility generates sample configurations.

The resulting sample configuration will be created in the /etc/vz/conf directory. The file name will be ve-<sample_name>.conf-sample. Now you can pass <sample_name> as an argument to the –-config option of the pctl create command. If a sample with this name already exists, the utility will output an error message and will not overwrite the existing configuration.

Note: If you create a Container configuration sample by splitting Parallels Server Bare Metal resources via Parallels Server Bare Metal tools (e.g. Parallels Management Console) rather than using vzsplit, this sample is put to the /var/vzagent/etc/samples directory after its creation. This sample can then be used for creating new Containers by Parallels Server Bare Metal tools only.

187

Managing Containers

vzcfgscale

This utility is used to “scale” Container configuration. It multiplies Container resource control parameters by the number passed as an argument. The syntax of this utility is as follows: vzcfgscale [options] <CT_config_file>

Container configuration file shall be always the last parameter and the utility uses it to produce scaled Container configuration. The utility accepts the following options:

-o <file>

-a <factor>

-c <factor>

-d <factor>

-u <factor>

-n <factor>

-r

Output scaled configuration into the <file>. By default, utility prints its output to screen. Note that the file specified cannot be the same as <CT_config_file>, otherwise you will loose the configuration file content.

Multiply all Container parameters by a <factor>.

Multiply CPU parameters by a <factor>.

Multiply disk related parameters by a <factor>.

Multiply system resource control parameters by a <factor>.

Multiply bandwidth parameters by a <factor>.

Do not output Container-specific parameters like VE_ROOT, VE_PRIVATE, and so on.

This option is useful for producing configuration samples to be used as an argument for the -–config option of the pctl create command.

At least one multiplying argument is required. It is possible to specify more than one multiplying argument to use different factors for different group of parameters. If both –a and a specific group option is used, then the specific option factor takes precedence of the value specified by the –a option.

188

Managing Containers

vzcfgvalidate

This utility is used to check the resource management parameters consistency in a Container configuration file. It has the following syntax: vzcfgvalidate <CT_config_file>

The utility has a number of constraints according to which it tests the configuration file. If a constraint is not satisfied, the utility prints a message with its severity status. Three severity statuses are defined in Parallels Server Bare Metal:

Recommendation

Warning

Error

This is a suggestion, which is not critical for Container or server operations. The configuration is valid in general; however, if the system has enough memory, it is better to increase the settings as advised.

A constraint is not satisfied and the configuration is invalid. Applications in the

Container with such invalid configuration may have suboptimal performance or fail in a not graceful way.

An important constraint is not satisfied and the configuration is invalid. Applications in a Container with such invalid configuration have increased chances to fail unexpectedly, to be terminated or to hang.

It is suggested to use this utility when applications in a Container behave in an unexpected way and there seems to be no resource shortage for the Container.

189

Managing Containers

vzhwcalc

vzhwcalc

is used to scan information on the resources consumption on a server (this can be a physical server or a server) and create a special file on its basis. When launched without any options, it makes a snapshot of the resources consumption and writes down this information to a special file - a server configuration file. The collected information can then be used to create a

Container on its basis where the physical server will be migrated. You may also use vzhwcalc to collect data on your server resources in one place and be aware of their current consumption.

The vzhwcalc utility has the following syntax: vzhwcalc [options]

The following options can be passed to the vzhwcalc utility:

Option Name

-o, --out

-t, --scan-time

-p, --scan-period

--mem-scale

--disk-scale

-d, --dist-detect

-h, --help

-v, --version

Description

The name of the configuration file that will be created by the utility and contain information on the server main resources.

The time during which the utility is to be run on the server. The time should be given in the dhms format (e.g. 1d2h30m40s).

The interval with which the server will be scanned by the utility.

The enlargement factor by which the calculated memory on the server will be increased in the configuration file.

The enlargement factor by which the calculated disk space on the server will be increased in the configuration file.

The path to the file on the server where the distdetect-common.sh script is located. You can specify several scripts and separate them by commas.

Print usage information.

Print the version of the utility.

The configuration file created by the vzhwcalc utility is placed to the same directory on the server from where you have run this utility and has the default name of ve.conf (i.e. in case the -o option was omitted during the utility execution).

190

Managing Containers

vzmtemplate

The vzmtemplate utility is used to migrate the installed OS and application standard templates and OS EZ templates from the Source Server to the Destination Server. It has the following syntax: vzmtemplate [-bhz] [--ssh=<ssh_options>]

<[user_name@]Destination_server_IP_Address> template_name ...

The following options can be used with vzmtemplate:

Option

-z, --eztempl

--ssh=ssh_options

-b, --batch

-h, --help

Description

Migrates the specified OS EZ template(s) installed on the Source Server.

Without this option specified, vzmtemplate moves standard OS and application templates.

Additional ssh options to be used while connecting to the Destination

Server.

This option should be passed to vzmtemplate in scripts if you are going to use these scripts for running the vzmtemplate utility and do not wish them to analyze the vzmtemplate command output.

Displays the utility usage and exits.

To migrate a template, you should execute the vzmtemplate command on the Source Server and pass the corresponding options to it. During its execution, the utility will try to connect to the

Destination Server with the IP address of Destination_server_IP_Address and move the specified template(s) to this server. By default, vzmtemplate logs in to the Destination Server as root

and asks you for the password of this user. However, you can make the utility use other credentials to log in to the Destination Server by appending the corresponding user name with the

@

symbol to the Server IP address (e.g. [email protected]). Keep in mind that the specified user should have the root privileges; otherwise, the command will fail.

191

C

H A P T E R

4

Managing Virtual Machines

This chapter describes the utilities that can be used for managing your virtual machines.

In This Chapter

pctl ........................................................................................................................ 192

pmigrate ................................................................................................................ 232

pbackup ................................................................................................................ 235

prestore ................................................................................................................. 236

prl_disk_tool ........................................................................................................... 237

pnetstat ................................................................................................................. 239

prl_convert ............................................................................................................. 240

pctl

Parallels virtual machines can be managed using the pctl command-line utility. The utility is installed on the Parallels server during the product installation.

Managing Virtual Machines

pctl backup

Backs up a virtual machine.

Syntax pctl backup vm_id|vm_name [-f,--full] [-i,--incremental]

[

-s,--storage user[[:passwd]@server[:port]]

[

--description desc]

Parameters

Name

vm_id|vm_name

-s

,--storage

user

Description

The UUID or the name of the virtual machine to back up.

This option is used to specify the backup server connection and login parameters. If this option is omitted, the backup will be saved on the default backup server. The default backup server can be configured using the prlsrvctl set

command.

The name of the user on a remote backup server.

passwd

server

port

--description

desc

-f

,--full

-i

,--incremental

The user password. If omitted, the user will be prompted to enter a password.

Server hostname or IP address.

Port number. If omitted, the default port number will be used.

Backup description.

Create a full backup of the virtual machine. A full backup contains all virtual machine data.

Create an incremental backup of the virtual machine. An incremental backup contains only the files changed since the previous full or incremental backup. This is the default backup type.

Links

General Syntax

(p. 64),

Legend

(p. 13)

193

Managing Virtual Machines

pctl backup-delete

Deletes a virtual machine backup.

Syntax pctl backup-delete {{vm_id|vm_name} | -t,--tag backup_id}

[

-s,--storage user[[:passwd]@server[:port]]

Parameters

Name

vm_id|vm_name

-t,--tag

backup_id

-s,--storage

user

Description

The UUID or the name of the virtual machine. If this option is specified, the command will delete the latest virtual machine backup. To delete a specific backup, omit this option and specify the backup ID using the --tag option (described below).

The ID of the backup to delete.

The backup server connection and login parameters. If this option is omitted, the backups will be searched for on the default backup server.

The default backup server can be configured using the prlsrvctl set command.

The name of the backup server user.

passwd

server

port

The user password.

Backup server hostname or IP address.

Port number. If this option is omitted, the default port will be used.

Links

General Syntax

(p. 64),

Legend

(p. 13)

194

Managing Virtual Machines

pctl backup-list

Lists the available backups for the specified virtual machine.

Syntax pctl backup-list [vm_id|vm_name] [-f,--full]

[

-s,--storage user[[:passwd]@server[:port]]

Parameters

Name

vm_id|vm_name

-f, --full

-s,--storage

--localvms

user

passwd

server

port

Description

The UUID or the name of the virtual machine for which to list the available backups.

Display full backup information.

Backup server connection and login parameters. If this option is omitted, the backups will be searched for on the default backup server. The default backup server can be configured using the prlsrvctl set command.

List only the backups of the virtual machines that were residing on the local server .

The name of the backup server user.

The user password.

Backup server hostname or IP address.

Port number. If omitted, the default port is used.

Links

General Syntax

(p. 64),

Legend

(p. 13)

195

Managing Virtual Machines

pctl capture

Captures the screen of a virtual machine desktop and saves it to a file on the client machine. The data is saved in the Portable Network Graphics (PNG) format.

Syntax pctl capture ID|name --file name

Parameters

Name

ID name

--file name

Description

The virtual machine ID.

The virtual machine name.

Name and path of the file to which the image should be saved. You should include the file extension (.png) or the file will be saved without one.

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl clone

Creates an exact copy of the specified virtual machine.

Syntax pctl clone ID|name --name new_name [--template] [--location path]

Parameters

Name

ID name

--name new_name

--template

--location path

Description

The ID of the virtual machine to clone

The name of the virtual machine to clone.

The name to be assigned to the new virtual machine.

Create a virtual machine template instead of a real virtual machine.

Templates are used as a basis for creating new virtual machines.

Name and path of the new virtual machine directory. If this parameter is omitted, the new virtual machine will be created in the default directory.

Links

General Syntax

(p. 64),

Legend

(p. 13)

196

Managing Virtual Machines

pctl enter

Creates a command prompt channel to a virtual machine. By using this command, you can create a command prompt channel and execute commands in a virtual machine. Parallels Tools must be installed in a virtual machine to use this utility.

Syntax pctl enter exec vm_id|vm_name

Parameters

Name

vm_id|vm_name

Description

The UUID or the name of the virtual machine.

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl exec

Executes a command inside a virtual machine. Parallels Tools must be installed in a virtual machine to use this utility. Commands in Linux guests are invoked with bash -c.

Syntax pctl exec vm_id|vm_name command

Parameters

Name

vm_id|vm_name

command

Description

The UUID or the name of the virtual machine.

A command to execute.

Links

General Syntax

(p. 64),

Legend

(p. 13)

197

Managing Virtual Machines

pctl list

Obtains a list of virtual machines on the Parallels server. The command allows to obtain a summary list containing only the virtual machine ID, name, and status, or to obtain a detailed information about a specific or all virtual machines.

Syntax pctl list [--all] [--template] [--no-header]

[

-o, --output name[,name...]] [-s, --sort name|-name] pctl list --info [ID|name]

Parameters

Name

-a, --all

-t, --template

--no-header

-o, --output name

-s, --sort name

-i, --info

-f, --full

ID name

Description

List all, running, stopped, suspended, and paused virtual machines. If this and the rest of the parameters are omitted, only the running virtual machines will be displayed.

List the available virtual machine templates. The real virtual machines will not be included in the output.

Do not display column headers.

Display one (or any combination) of the following fields:

• uuid

-- Virtual machine ID.

• name

-- Virtual machine name.

• status

--Virtual machine status (running, stopped, etc.).

The above fields can be combined in a single command using comma separator (e.g. uuid, name). The excluded fields will not be displayed. The field names must be typed in lower case.

Sort the virtual machine list by the specified parameter in ascending order.

Display detailed information about a virtual machine.

Display detailed information about the network cards in a virtual machine.

Should be used with the --info option.

The ID of the virtual machine for which to display the detailed information. If not specified, the information will be displayed for all registered virtual machines.

The name of the virtual machine for which to display the detailed information. If not specified, the information will be displayed for all registered virtual machines.

Links

General Syntax

(p. 64),

Legend

(p. 13)

198

Managing Virtual Machines

pctl pause, suspend, resume

Pause, suspend, and resume a virtual machine.

Syntax pctl pause ID|name pctl suspend ID|name pctl resume ID|name

Parameters

Name

ID name

Description

The ID of the virtual machine to pause, suspend, or resume.

The name of the virtual machine to pause, suspend, or resume.

Remarks

The pause command pauses a virtual machine. To continue the virtual machine operation, use the pctl start command

(p. 224).

The suspend command suspends the virtual machine operation. When a running virtual machine is suspended, the state of the virtual machine processes is saved to a file on the host. After that, the machine is stopped. To resume the machine, use the resume command.

Links

General Syntax

(p. 64),

Legend

(p. 13)

199

Managing Virtual Machines

pctl problem-report

Obtains a problem report for the specified virtual machine and displays it on the screen.

Syntax pctl problem-report ID|name

Parameters

Name

ID name

Description

The ID of the virtual machine for which to obtain the problem report.

The name of the virtual machine for which to obtain the report. If the name consists of separate words, it must be enclosed in quotes.

Remarks

The command collects technical data about a virtual machine and displays the report on the screen

(the output can also be piped to a file). The report can then be forwarded to the Parallels technical support for the analysis of the problem.

Links

General Syntax

(p. 64),

Legend

(p. 13)

200

Managing Virtual Machines

pctl restore

Restores a virtual machine from a backup.

Syntax pctl restore {{vm_id|vm_name} | -t,--tag backup_id}

[

-s,--storage user[[:passwd]@server[:port]]

[

-n, --name new_name]

Parameters

Name

vm_id|vm_name

-t,--tag

backup_id

-s,--storage

user

passwd

server

Description

The UUID or the name of the virtual machine. If this option is specified, the command will restore it from the latest available backup. To restore a virtual machine from a specific backup, omit this option and specify the backup ID using the --tag option (described below).

The backup ID from which to restore a virtual machine.

The backup server connection and login parameters. If this option is omitted, the backups will be searched for on the default backup server. The default backup server can be configured using the prlsrvctl set command.

The name of the backup server user.

The user password.

The backup server hostname or IP address.

port Port number. If omitted, the default port will be used.

-n, --name

new_name A new name to assign to the restored virtual machine. If omitted, the virtual machine will be restored with the original name.

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl set

The pctl set command is used to modify the configuration of a virtual machine and manage virtual machine devices and shared folders. The following subsections provide technical information on how to use the command to perform these tasks.

201

Managing Virtual Machines

Modifying Virtual Machine Configuration

The pctl set command is used to modify the virtual machine configuration parameters.

Syntax pctl set ID|name [--cpus number] [--memsize number] [--videosize number]

[

--memquota auto|min:max[:priority]] [--mem-hotplug on|off]

[

--description description]

[

--autostart on|off|auto] [--autostart-delay number]

[

--autostop stop|suspend] [--applyconfig conf] [--name name]

[

--start-as-user administrator|owner|user:passwd]

[

--vnc-mode auto|manual|off] [--vnc-port port] [--vnc-passwd passwd]

[

--vnc-address address]

[

--cpu-hotplug on|off]

[

--cpuunits units] [--cpulimit percent|megahertz]

[

--ioprio priority] [--iolimit limit]

[

--cpumask N[,N,N1-N2]]

[

--offline-management on|off] [--offline-service service_name]

[

--userpasswd user:passwd]

[

--rate] [--ratebound on|off]

Parameters

Name

ID name

Description

Target virtual machine ID.

Target virtual machine name.

--cpus number

--memsize number

--videosize number

--memquota auto|

guarantee:limit[:priority[:maxballoon}]

Number of virtual CPUs in the virtual machine. If the host has more than one CPU, this option allows you to set the number of virtual CPUs to be available in the virtual machine.

The amount of memory (RAM) available to the virtual machine, in megabytes.

The amount of video memory available to the virtual machine graphics card.

Sets the parameters of the memory consumption by the virtual machine:

guarantee. The amount of memory a virtual machine is guaranteed to get on demand. By default, the guaranteed memory is calculated on the basis of

RAM and video memory assigned to a virtual machine and is about a half of its total memory.

limit. The maximum amount of memory a virtual machine is allowed to consume.

By default, no limit is set for all newly created virtual machines, and any virtual machine may consume all free memory

202

--mem-hotplug on|off

--description VM_description

--autostart on|off|auto

--autostart-delay number

--autostop stop|suspend

Managing Virtual Machines on the server.

priority. The priority (from 1 to 100) that defines which virtual machine will get memory first. The higher the priority of a virtual machine, the more chances it has to get memory when the Parallels server has insufficient memory resources. By default, the priority is set to 50.

ballooning. The maximum amount of memory the balloon driver in a virtual machine may allocate for its needs. By default, the balloon driver can allocate up to 60% of RAM set for a virtual machine.

• auto

. Resets all memory parameters to their default values.

Enables or disables memory (RAM) hotplug support in the virtual machine. This feature is disabled in the virtual machine by default. The guest operating system must support memory hotplug for this functionality to work.

Short description of the virtual machine.

Defines the virtual machine start-up options:

• on

-- the virtual machine is started automatically wen the Parallels server starts or the Parallels Server Bare Metal component responsible for managing virtual machines is disabled.

• off

-- the autostart is off. This is the default virtual machine start-up mode.

• auto

-- resume the virtual machine state prior to shutting down the Parallels server or disabling the Parallels Server

Bare Metal component responsible for managing virtual machines.

If you set this option to on or auto, you must additionally specify the --start-as-user option.

Sets the time delay used during the virtual machine automatic startup.

Sets the automatic shutdown mode for the specified virtual machine:

• stop

-- the virtual machine is stopped when you shut down the Parallels server or disable the Parallels component responsible for managing virtual

203

Managing Virtual Machines

--applyconfig

conf

--name

name

--start-as-user administrator|owner|user:passwd

--vnc-mode auto|manual|off

--vnc-port

port

--vnc-passwd

passwd

--vnc-address address

--cpu-hotplug on|off

--cpuunits units

--cpulimit percent|megahertz

204 machines.

• suspend

-- the virtual machine is suspended when the Parallels server is shut down or the Parallels component responsible for managing virtual machines is disabled.

Applies the resource parameter values from the specified VM configuration file to the virtual machine. The parameters defining the OS family and OS version are left intact.

Changes the virtual machine name.

Specifies the account to use to autostart the virtual machine:

• administrator -- start the virtual machine as the administrator of the host operating system.

• owner

-- start the virtual machine as the virtual machine owner.

• user:passwd

-- start the virtual machine as the specified user.

Enables or disables access to the virtual machine via the VNC protocol.

Sets the VNC port number.

Sets the VNC password.

Sets the IP address to use for logging in to the virtual machine via VNC. It must be one of the IP addresses assigned to the Parallels server.

By default, you can use any of the IP addresses of the Parallels server to log in to the virtual machine.

Enables or disables CPU hotplug support in the virtual machine. This feature is disabled by default. The guest operating system must support CPU hotplug for this functionality to work.

Sets the CPU weight for the virtual machine. This is a positive integer number that defines how much CPU time the virtual machine can get as compared to the other virtual machines and

Containers running on the server. The larger the number, the more CPU time the virtual machine can receive. Possible values range from 8 to

500000. If this parameter is not set, the default value of 1000 is used.

CPU limit, in percent or megahertz (MHz) the virtual machine is not allowed to exceed. By default, the limit is set in percent. To set the limit

--ioprio

priority

--iolimit

limit

--cpumask

N[,N,N1-N2]

--offline-management on|off

--offline-service

service_name

--userpasswd

user:passwd

--rate

--ratebound

--tools-autoupdate on|off

Links

General Syntax

(p. 64),

Legend

(p. 13)

Managing Virtual Machines in MHz, specify "m" after the value.

Note: If the server has 2 processors, the total CPU time equals 200%.

Disk I/O priority level from 0 to 7. The default is 4.

Disk I/O bandwidth limit. The default is 0 (no limit). By default the limit is set in megabytes per second. You can use the following letters following the number to specify units of measure:

G -- gigabytes per second (e.g., 1G).

K -- kilobytes per second (e.g., 10K).

B -- bytes per second (e.g., 100B).

An affinity mask indicating what CPU(s) the virtual machine processes should be run on.

You can specify a list of CPUs identified by their index numbers separated by commas (0, 1, 2, 3, etc.) or a range (4-6).

To make all CPUs available for the virtual machine processes specify --cpumask all.

Turns the offline management on or off.

The name of the service to use for offline management.

Sets the password for the specified user in the virtual machine. If the user account does not exist, it will be created. Parallels Tools must be installed in the virtual machine for the command to work.

Sets the guaranteed outgoing traffic rate in Kb/s for the virtual machine.

Turns the network traffic rate limitation set by the

--rate

parameter (above) on or off. The default value is "off".

Turns on/off automatic updating of Parallels

Tools in the guest operating system. If this option is set to ON, Parallels Tools updates will be performed automatically every time an update is available for Parallels Server Bare Metal. If this option is set to OFF, no automatic Parallels Tools updates will be performed, so that you can do it manually at a convenient time.

205

Managing Virtual Machines

Managing Virtual Devices

The pctl set command allows to add virtual devices to a virtual machine and to modify and delete existing virtual devices.

General Syntax pctl set ID|VM_name --device-add dev_type options pctl set ID|VM_name --device-set name options pctl set ID|VM_name --device-del name

Parameters

Name

ID

VM_name

Description

The virtual machine ID.

The virtual machine name.

--device-add dev_type options

--device-set name options

--device-del name

Adds a virtual device to the specified virtual machine.

The dev_type parameter specifies the virtual device type (hdd, cdrom, fdd, net, etc.).

The options parameters specifies device-type specific options.

Modifies the configuration of an existing virtual device in the specified virtual machine.

The name parameter specifies the virtual device name.

The options parameters specifies device-type specific options.

Deletes a virtual device from the virtual machine.

The name parameter specifies the name of the virtual device to delete.

Remarks

All device-related parameters can be subdivided into the following categories:

Hard disk drives

Optical disk drives

(p. 210)

Network cards

Floppy disk drives

(p. 212)

USB devices

(p. 217)

Serial ports

(p. 215)

Parallel ports

(p. 216)

206

Managing Virtual Machines

Sound cards

(p. 218)

Each group of parameters is explained in the following subsections in detail.

Notes

All operations on virtual machine devices (adding, modifying, or removing a device) must be performed on a stopped virtual machine. An attempt to perform any of these operations on a running virtual machine will result in error.

Links

Legend

(p. 13)

207

Managing Virtual Machines

Hard Disk Drive Management Parameters

This group of parameters is used to add and configure virtual hard disks in a virtual machine. The first syntax uses a file to emulate a hard disk drive. The second syntax connects a physical hard disk on the host server to the virtual machine.

Syntax pctl set ID|VM_name {--device-add hdd | --device-set hddN}

[

--image name]

[

--type expand|plain][--size number][--split]

[

--iface sata|ide|scsi][--position number]

[

--enable|--disable] pctl set ID|VM_name --device-add hdd

--device real_name

[

--iface sata|ide|scsi]

[

--position number]

Parameters

Name

ID

VM_name

--device-add

--device-set hddN

--image name

--device name

Description

The virtual machine ID.

The virtual machine name.

Adds a virtual hard disk drive to the virtual machine.

You can connect up to four SATA/IDE devices and up to seven SCSI devices to a virtual machine. This includes hard disks and optical disk drives.

Modifies the parameters of an existing virtual hard disk.

The name of the virtual hard disk to modify. Virtual hard disks are named using the hddN format where N is the drive index number starting from 0

(e.g. hdd0, hdd1). To obtain the list of disk names, use the pctl list command with the --info option.

This options is used to create a virtual hard disk using an image file. You can create a new image file or use an existing image.

To use an existing image file, specify its name and path using the name parameter.

To create a new image file, omit the --image parameter. New image files are created in the virtual machine directory and are automatically named using the harddiskN.hdd format, where N is the disk index number (e.g. harddisk0.hdd, harddisk1.hdd).

This option is used to connect a physical hard disk on the Parallels

Server to the virtual machine. You can obtain the names of the existing hard disks on the server using the prlsrvctl info command.

208

Managing Virtual Machines

--type expand|plain

Sets the disk type for image file based virtual hard disks:

• expand

-- expanding disk. The image file is small initially and grows in size as you add data to it. This is the default virtual disk type.

• plain

-- plain disk. The image file has a fixed size from the moment it is created (the space is allocated to the drive fully).

Plain disks perform faster than expanding disks.

--size number

The size of the virtual hard disk, in megabytes. The default size is 32,000

MB.

--split

Splits the hard disk image file into 2 GB pieces. You should split a virtual disk if it is stored on a file system that cannot support files larger than 2

GB (e.g. FAT16).

--iface sata|ide|scsi

The disk drive Interface type. If omitted, the SATA interface will be used.

--position number

The SCSI or IDE device identifier to be used for the virtual disk. The allowed ID ranges are the following:

• for IDE devices: 0:0, 0:1, 1:0, 1:1;

• for SCSI device: 0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0.

--enable

You can use one of the following formats for specifying IDs: ID:bus,

ID-bus

, ID. For example, if you specify 3:0 (or 3-0 or 3) as number for a SCSI drive, the guest OS will see the drive as having ID 3 on SCSI bus

0.

Enables the specified virtual disk drive. All newly added disk drives are enabled by default (provided the --disable option is omitted).

--disable

Disables the specified virtual disk drive. The disk drive itself is not removed from the virtual machine configuration.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

209

Managing Virtual Machines

Optical Disk Drive Management Parameters

This group of parameters is used to add and configure virtual optical disk drives, such as DVD or

CD drives.

Syntax pctl set ID|VM_name --device-add cdrom --image image_name

[

--iface ide|scsi] [--position number]

[

--enable|--disable] [--connect|--disconnect] pctl set ID|VM_name --device-add cdrom --device device_name

[

--iface ide|scsi] [--position number]

[

--enable|--disable] [--connect|--disconnect] pctl set ID|VM_name --device-set cdromN

{

--device name|--image name} [--iface ide|scsi]

[

--position number][--enable|--disable]

[

--connect|--disconnect]

Parameters

Name

ID name

--device-add

--device-set cdrom cdromN

--device name

Description

The virtual machine ID.

The virtual machine name.

Adds a DVD/CD drive to the virtual machine. You can connect up to four

IDE devices and up to seven SCSI devices to a virtual machine. This includes virtual hard disks and DVD/CD drives.

Modifies the parameters of an existing virtual optical disk.

Specifies the virtual device type (in this instance, a CD or DVD drive).

The name of the DVD/CD drive to modify. The N postfix indicates the drive index number. To obtain the list of the available drives, use the pctl list

command with the --info option.

The name of the physical optical disk to connect to the virtual machine.

--image name

--iface ide|scsi

--position number

The name of an existing disk image file to mount in the virtual machine.

Currently, the following image file formats are supported: .iso, .cue,

.ccd

, and .dmg. The image must not be compressed and/or encrypted.

Interface type:

• ide

-- IDE disk.

• scsi

-- SCSI disk (default).

The SCSI or IDE device identifier to be used for the DVD/CD drive. The allowed ID ranges are the following:

• for IDE devices: 0:0, 0:1, 1:0, 1:1;

• for SCSI device: 0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0.

210

Managing Virtual Machines

--enable

--disable

--connect

--disconnect

You can use one of the following formats for specifying IDs: ID:bus,

ID-bus

, ID. For example, if you specify 3:0 (or 3-0 or 3) as number for a SCSI drive, the guest OS will see the drive as having ID 3 on SCSI bus

0.

Enables the specified DVD/CD drive. All newly added drives are enabled by default (provided the --disable option is omitted).

Disables the specified optical disk drive. The disk drive itself is not removed from the virtual machine configuration.

Automatically connect the specified optical disk drive during the virtual machine startup process.

Do not automatically connect the specified optical disk drive during the virtual machine startup process.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

211

Managing Virtual Machines

Floppy Disk Drive Management Parameters

This group of parameters is used to add floppy disk drives to a virtual machine and to modify existing virtual floppy disk drives.

Syntax pctl set ID|VM_name --device-add fdd [--device name]

[

--enable|--disable][--connect|--disconnect] pctl set ID|VM_name --device-set fdd [--device name]

[

--enable|--disable][--connect|--disconnect]

Parameters

Name

ID

VM_name fdd

--device-add

--device-set

Description

The virtual machine ID.

The virtual machine name.

Specifies the type of the virtual device to add or modify (in this instance, a floppy disk drive).

Adds a new floppy disk drive to the virtual machine. You can connect only one floppy disk drive to a virtual machine.

Modifies the parameters of an existing virtual floppy disk drive.

--device name

--enable

--disable

--connect

--disconnect

--image path

The name of the physical floppy disk drive to connect to the virtual machine.

If this parameter is omitted, a floppy drive image emulating the floppy disk drive will be created.

Enables the specified floppy disk drive. All newly added floppy drives are enabled by default (provided the --disable option was omitted during the drive creation).

Disables the specified floppy disk drive. The drive itself is not removed from the virtual machine configuration.

Connect the specified floppy disk drive automatically during the virtual machine startup process.

Use this option if you don't want the specified floppy disk drive automatically connected to the virtual machine on its start.

The name and path of an existing floppy disk image file (usually floppy.fdd

) to mount in the virtual machine.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

212

Managing Virtual Machines

Network Adapter Management Parameters

This group of parameters is used to manage virtual network adapters in a virtual machine.

Syntax pctl set ID|VM_name {--device-add net | --device-set netN}

{

--type routed | --network network_id}

[

--mac addr|auto]

[

--ipadd addr[/mask>] | --ipdel addr[/mask] |

--dhcp yes|no | --dhcp6 yes|no] [--gw gw] [--gw6 gw]

[

--nameserver addr] [--searchdomain addr]

[

--configure yes|no]

[

--ipfilter yes|no] [--macfilter yes|no]

[

--preventpromisc yes|no]

[

--enable|--disable] [--connect|--disconnect]

Parameters

Name

ID

Description

The virtual machine ID.

VM_name

The virtual machine name.

--device-add

Adds a new virtual network adapter to the virtual machine.

--device-set Modifies an existing virtual network adapter. netN

The name of the virtual network adapter to modify. To obtain the list of the available adapters, use the pctl list command with the -info

option.

--type routed

--network network_id

Sets the networking mode for the virtual network adapter to

"virtual_network". In this mode the adapter is connected to a virtual network specified by network_id.

--mac addr|auto

Sets the networking mode for the virtual network adapter to "routed".

In this mode, the network adapter is communicating with the outside world through an internal virtual network adapter.

Specifies the MAC address to assign to an existing network adapter.

Specify a desired MAC address using the addr parameter value or use the auto option to generate the existing address automatically

--ipadd addr[/

mask] Adds an IP address and a mask (optional) to the network adapter.

--ipdell addr[/mask]

Deletes an IP address from the network adapter.

--dhcp yes|no

Specifies whether the virtual network adapter should obtain the IPv4 settings through a DHCP server.

--dhcp6 yes|no

Specifies whether the virtual network adapter should obtain the IPv6 settings through a DHCP server .

--gw

gw The default gateway to be used by the virtual machine.

--gw6

gw

--nameserver

addr

--searchdomain

addr

The default IPv6 gateway to be used by the virtual machine.

The default DNS server address to be used by the virtual machine.

The default search domain to be used by the virtual machine.

213

Managing Virtual Machines

--configure yes|no

If set to "yes", the settings above are applied to the virtual network adapter instead of its original settings. Configuring any of the settings above automatically sets this option to "yes". ipfilter yes|no

Determines if the specified network adapter is configured to filter network packages by IP address. If set to "yes", the adapter is allowed to send packages only from IPs in the network adapter IP addresses list. macfilter yes|no

Determines if the specified network adapter is configured to filter network packages by MAC address. If set to "yes", the adapter is allowed to send packages only from its own MAC address. preventpromisc yes|no

Determines if the specified network adapter should reject packages not addressed to its virtual machine. If set to "yes", the adapter will drop such packages. enable|disable

Enables or disable the network adapter. If omitted during the adapter creation, the adapter will be enabled. connect|disconnect

Connects or disconnects the network adapter. When disconnected, the adapter is not removed from the virtual machine.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

214

Managing Virtual Machines

Serial Port Management Parameters

This group of parameters is used to manage serial ports in a virtual machine.

Syntax pctl set ID|VM_name --device-add serial

{

--device name|--output file|--socket name}

[

--enable|--disable][--connect|--disconnect] pctl set ID|VM_name --device-set serialN

{

--device name|--output file|--socket name}

[

--enable|--disable][--connect|--disconnect]

Parameters

Name

ID

VM_name

--device-add

--device-set serial

--device name

--output file

--socket name

Description

The virtual machine ID.

The virtual machine name.

Adds a new serial port to the virtual machine. You can connect up to four serial ports to a virtual machine.

Modifies the parameters of an existing serial port.

Specifies the type of the virtual device to add (in this instance, a serial port).

The name of the physical serial port to which to connect the virtual machine.

The name and path of the output file to which to connect the virtual serial port.

The name of the physical socket to which to connect the virtual serial port.

--enable

--disable

--connect

--disconnect

Enables the virtual serial port. All newly added serial ports are enabled by default (provided the --disable option is omitted).

Disables the virtual serial port.

Automatically connect the virtual serial port during the virtual machine startup process.

Do not automatically connect the virtual serial port during the virtual machine startup process.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

215

Managing Virtual Machines

Parallel Port Management Parameters

This group of parameters is used to manage parallel port in a virtual machine.

Syntax pctl set ID|VM_name --device-add parallel

{

--device name|--output file_name}

[

--enable|--disable][--connect|--disconnect] pctl set ID|VM_name --device-set parallelN

{

--device name|--output file_name}

[

--enable|--disable][--connect|--disconnect]

Parameters

Name

ID name

--device-add

--device-set parallel parallelN

--device name

--output file_name

--enable

--disable

--connect

--disconnect

Description

The virtual machine ID.

The virtual machine name.

Adds a new parallel port to the virtual machine. You can connect up to three parallel ports to a virtual machine.

Modifies the parameters of an existing virtual parallel port.

Specified the type of the virtual device to add (in this instance, a virtual parallel port).

The name of the parallel port to modify. To obtain the list of ports, use the pctl list command with the --info option.

The name of the physical parallel port to which to connect the virtual parallel port.

The name of the output file to which to connect the virtual parallel port.

Enables the specified parallel port. All newly added parallel ports are enabled by default (provided the --disable option was omitted during the port creation).

Disable the specified virtual parallel port. The port itself is not removed from the virtual machine configuration.

Automatically connect the specified virtual parallel port during the virtual machine startup process.

Do not automatically connect the specified virtual parallel port during the virtual machine startup process.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

216

Managing Virtual Machines

USB Controller Management Parameters

This group of parameters is used to manage the USB controller in a virtual machine.

Syntax pctl set ID|VM_name --device-add usb [--enable|--disable]

Parameters

Name

ID

VM_name usb

--enable

--disable

Description

The virtual machine ID.

The virtual machine name.

The type of the virtual device to add to the virtual machine (in this instance, a

USB device).

Enables the USB controller. This is the default option.

Disables the USB controller.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

217

Managing Virtual Machines

Sound Device Management Parameters

This group of parameters is used to manage sound devices in a virtual machine.

Syntax pctl set ID|VM_name --device-add sound --output name

[

--enable|--disable][--connect|--disconnect] pctl set ID|VM_name --device-set sound --output name

[

--enable|--disable][--connect|--disconnect]

Parameters

Name

ID

VM_name sound

--output name

--input name

--enable

--disable

--connect

--disconnect

Description

The virtual machine ID.

The virtual machine name.

The type of the virtual device to add to the virtual machine (in this instance, a sound device).

The name of a physical output device to which to connect the virtual sound device.

The name of the physical input device to which to connect the virtual sound device.

Enables the specified sound device. All newly added sound devices are enabled by default (provided the --disable option is omitted).

Disables the specified virtual sound device.

Automatically connect the sound device during the virtual machine startup process.

Do not automatically connect the sound device during the virtual machine startup process.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

218

Managing Virtual Machines

Removing Devices from Virtual Machine

The --device-del option is used to remove virtual devices from a virtual machine.

Syntax pctl set ID|name --device-del name

Parameters

Name

--device-del name

Description

The name of the virtual device to delete from the virtual machine. To obtain the list of virtual devices, use the pctl list command with the --info option.

Links

General Syntax

(p. 64),

Virtual Device Management

(p. 206),

Legend

(p. 13)

219

Managing Virtual Machines

Managing Shared Folders

The pctl set command can be used to add shared folders to a virtual machine and to modify and delete existing shared folders.

Syntax pctl set ID|VM_name --shf-host-add name --path path

[

--mode ro|rw]

[

--shf-description txt]

[

--enable|--disable] pctl set ID|VM_name --shf-host-set name [--mode ro|rw]

[

--path path]

[

--shf-description txt]

[

--enable|--disable] pctl set ID|VM_name --shf-host on|off pctl set ID|VM_name --shf-host-del name pctl set ID|VM_name --shf-guest on|off pctl set ID|VM_name --shf-guest-automount on|off

Parameters

Name

ID

VM_name

--shf-host-add

--shf-host-set

--shf-host on|off

--shf-host-del

--shf-guest on|off

--shf-guest-automount on|off name

--path

--mode

--shf-description

Description

The virtual machine ID.

The virtual machine name.

Shares the specified folder on the Parallels server with the virtual machine.

Modifies the settings of an existing shared folder.

Turns the host folder sharing on or off.

Removes the specified shared folder from the shared folder list.

Turns the guest folder sharing on or off.

Mounts or unmounts virtual disks on the Parallels server.

User-defined shared folder name.

Name and path of a folder on the Parallels server to share with the specified virtual machine.

Sharing mode:

• ro

-- read-only.

• rw

-- read and write.

User-defined shared folder description.

220

--enable

--disable

Links

General Syntax

(p. 64),

Legend

(p. 13)

Enable the shared folder.

Disable the shared folder.

pctl snapshot

Takes a snapshot of a running virtual machine.

Syntax pctl snapshot ID|name [-n,--name name] [-d,--description desc]

Parameters

Name

ID name

-n, --name name

-d, --description desc

Description

The virtual machine ID.

The virtual machine name.

User-defined snapshot name.

User-defined snapshot description.

Links

General Syntax

(p. 64),

Legend

(p. 13)

Managing Virtual Machines

221

Managing Virtual Machines

pctl snapshot-delete

Deletes a virtual machine snapshot.

Syntax pctl snapshot-delete ID|name -i,--id snapshot_id

Parameters

Name

ID name

-i, --id snapshot_id

Description

The virtual machine ID.

The virtual machine name.

The ID of the snapshot to delete.

Notes

If the specified snapshot has child snapshots that were derived from it, they will NOT be deleted.

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl snapshot-list

Displays a list of snapshots of the specified virtual machine.

Syntax pctl snapshot-list ID|name [-t,--tree] [-i,--id snapshot_id]

Parameters

Name

ID name

-t, --tree

-i, --id

snapshot_id

Description

The virtual machine ID.

The virtual machine name.

Displays the snapshot list as a tree. The default display format is tabular with Parent Snapshot ID and Snapshot ID as columns.

The ID of the snapshot to use as a root. If this parameter is omitted, the entire snapshot tree will be displayed.

Links

General Syntax

(p. 64),

Legend

(p. 13)

222

pctl snapshot-switch

Reverts the specified virtual machine to the specified snapshot.

Syntax pctl snapshot-switch ID|name -i,--id snapshot_id

Parameters

Name

ID name

-i, --id snapshot_id

Description

The virtual machine ID.

The virtual machine name.

The ID of the snapshot to revert to.

Links

General Syntax

(p. 64),

Legend

(p. 13)

Managing Virtual Machines

223

Managing Virtual Machines

pctl start, stop, reset

Start, stop, and reset a virtual machine.

Syntax pctl start ID|name pctl stop ID|name [--kill] pctl reset ID|name

Parameters

Name

ID name

--kill

Description

The ID of the virtual machine to start, stop, or reset.

The name of the virtual machine to start, stop, or reset.

Perform a 'hard' virtual machine shutdown. If this option is omitted, an attempt to perform a graceful shutdown will be made.

Remarks

The stop command can perform a 'hard' or a graceful virtual machine shutdown. If the --kill parameter is included, the 'hard' shutdown will be performed. If the parameter is omitted, the outcome of the graceful shutdown attempt will depend on the following:

If the Parallels Tools package is installed in a virtual machine, the graceful shutdown will be performed using its facilities.

If the Parallels Tools package is not installed, the command will try to perform a graceful shutdown using ACPI. Depending on the ACPI support availability in the guest operating system, this may work or not.

The reset command stops and then starts a virtual machine. The command first performs a

'hard' virtual machine shutdown and then starts the virtual machine from the stopped state.

The start command can be used to start a stopped virtual machine or to resume a paused virtual machine

(p. 199).

Links

General Syntax

(p. 64),

Legend

(p. 13)

224

Managing Virtual Machines

General Syntax

The pctl utility is used to perform administration tasks on virtual machines. The utility supports a full range of tasks from creating and administering virtual machines to getting statistics and generating problem reports.

Syntax pctl command ID|name [options] [-v, --verbose number]

Parameters

Name command

ID name options

-v, --verbose number

Description

The name of the command to execute (see the table below for the complete list of commands).

The ID of the virtual machine on which to perform the operation. To obtain the list of the available virtual machines, use the pctl list command.

The name of the virtual machine on which to perform the operation.

To obtain the list of the available virtual machines, use the pctl list

command.

Command options. See individual commands for available options.

Show verbose output. The greater the number, the more verbose output will be produced.

Remarks

To display help, enter pctl without any parameters.

Links

Legend

(p. 13)

225

Managing Virtual Machines

pctl create

Creates a new virtual machine. A virtual machine can be created from scratch or from a virtual machine template. When created from scratch, the target operating system type or version must be specified. To create a virtual machine from a template, the template name must be passed to the command.

Syntax pctl create name {--ostype name|--distribution name} [--location path] pctl create name --ostemplate name [--location path]

Parameters

Name Description name

User-defined new virtual machine name. If the name consists of two or more words separated by spaces, it must be enclosed in quotes.

-o, --ostype name

The name of the family of the operating system that will be installed in the virtual machine. Select from one of the following:

• windows

• linux

• feebsd

• other

(specify this option if the operating system you are planning to install is not listed above).

-d, --distribution name

The operating system version that will be installed in the virtual machine. For the full list of OS versions, refer to the pctl man pages.

--ostemplate name

The name of the virtual machine template from which to create the new virtual machine. Use the pctl list --template command to obtain the list of the available templates.

--location path

Name and path of the directory where to store the new virtual machine files. If this parameter is omitted, the files will be crated in the default virtual machine directory.

Remarks

When creating a virtual machine from scratch, you may specify the operating system family or version. If an operating system version is specified using the --distribution parameter, the virtual machine will be configured for that operating system. If an operating system family is specified using the --ostype parameter, the virtual machine will be configured for the default version of this OS family. The default versions are determined internally by Parallels and are kept in sync with other Parallels management tools such as Parallels Management Console. The best way to find out the default versions used in your Parallels installation is by creating a sample virtual machine.

226

Managing Virtual Machines

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl delete

Deletes a virtual machine from the Parallels server. The command removes a virtual machine from the Parallels Server Bare Metal registry and permanently deletes all its files from the server. Once completed, this operation cannot be reversed.

Syntax pctl delete ID|name

Parameters

Name

ID name

Description

The ID of the virtual machine to delete.

The name of the virtual machine to delete.

Links

General Syntax

(p. 64),

Legend

(p. 13)

227

Managing Virtual Machines

pctl migrate

Migrates a virtual machine from one host to another.

Syntax pctl migrate <[source_server/]ID> <destination_server[/ID]>

[--dst path]

[[--keep-src] [--switch-template] [--changesid]

Options

Name

ID source_server destination_server

--dst path

--keep-src

--switch-template

Description

The source virtual machine ID or name.

The source server information. Use the following format to specify this info:

[user[:password]@]server_IP_address_or_hostname[:port]

The destination server information. If omitted, the migration will be performed locally. Use the following format to specify this info:

[user[:password]@]server_IP_address_or_hostname[:port]

Name and path of the directory on the destination server where the virtual machine files should be stored.

If this option is included, the original virtual machine will be left intact on the source server. If this option is omitted, the original virtual machine will be removed from the source server.

Switches the virtual machine to a template and a template to a virtual machine. For example, if the source virtual machine was a template, it becomes a full featured virtual machine after the migration, and vice versa.

Changes the resulting virtual machine SID.

--changesid

Links

General Syntax

(p. 64),

Legend

(p. 13)

228

Managing Virtual Machines

pctl mount

Mounts the hard disks of a virtual machine to the /vz/mnt/vm_id directory on the Parallels server.

Syntax pctl mount {vm_id|vm_name} pctl mount {vm_id|vm_name} --info

Parameters

Name vm_id|vm_name

--info

Description

UUID or the name of the virtual machine to mount.

Do not mount the virtual machine, just show the information about the mounted virtual disks.

Links

General Syntax

(p. 64),

Legend

(p. 13)

229

Managing Virtual Machines

pctl register, unregister

The register command is used to register a virtual machine with Parallels Server Bare Metal.

The unregister command removes a virtual machine from the Parallels Server Bare Metal registry.

Syntax pctl register path pctl unregister ID|name

Parameters

Name path

ID|name

Description

An absolute path to the virtual machine directory.

The ID or the name of the virtual machine to remove from the Parallels

Server Bare Metal registry.

Remarks

Use the register command when you have a virtual machine on the server that does not show up in the list of the virtual machines registered with the Parallels Server Bare Metal. This can be a machine that was previously removed from the registry or a machine that was copied from another location.

The unregister command removes a virtual machine from the Parallels Server Bare Metal registry, but does not delete the virtual machine files from the server. You can re-register such a machine with Parallels Server Bare Metal later using the register command.

Links

General Syntax

(p. 64),

Legend

(p. 13)

230

Managing Virtual Machines

pctl server

Obtains the information about the Parallels server and Parallels Server Bare Metal. It also allows you to disable the Parallels Server Bare Metal component responsible for managing virtual machines.

Syntax pctl server shutdown|info

Parameters

Name info shutdown

Description

Displays the Parallels Server Bare Metal information.

Disables the Parallels Server Bare Metal component responsible for managing virtual machines. If one or more virtual machines are running, clients are connected, or some tasks are currently in progress, then the operation will be aborted.

See Also prlsrvctl info

(p. 65)

prlsrvctl shutdown

(p. 73)

Links

General Syntax

(p. 64),

Legend

(p. 13)

pctl umount

Unmounts the hard disks of a virtual machine.

Syntax pctl umount {vm_id|vm_name}

Parameters

Name vm_id|vm_name

Description

UUID or the name of the virtual machine you want to mount.

Links

General Syntax

(p. 64),

Legend

(p. 13)

231

Managing Virtual Machines

pmigrate

The pmigrate utility is used to perform different kinds of migration. This utility has the following syntax: pmigrate <source_server> <destination_server> [options]

<source_server> is the source server which can be either the server where the virtual machine and Container to be migrated is residing (if you are migrating a virtual machine and Container) or the physical computer to be migrated (if you are migrating a physical computer).

<destination_server> is the destination server—that is, the Parallels server where the virtual machine and Container or the physical server is to be migrated. If the source and/or destination server is not specified, the operation is performed on the local server.

Note: The current version of pmigrate does not support migrating physical servers to virtual machines.

<source_server> and <destination_server> consists of two parts—<type> and

<address>:

<type> denotes the type of computer to migrate and can be one of the following:

• h

for migrating physical computers

• c

for migrating migrating Containers

• v

for migrating Parallels virtual machines

• x

for migrating Xen virtual machines

<address> denotes the location of computer to migrate and can be one of the following:

The computer location if you are migrating a physical computer.

The computer location and the virtual machine name or Container ID if you are migrating a virtual machine or Container, respectively. The location must be separated from the virtual machine name/Container ID by the slash (/).

The location format is as follows:

[<user>[:<password>]@]<destination_server_IP_address_or_hostname>[:<destination_server_

port>]

The options ([options]) you can use with pmigrate depend on whether you are migrating a virtual machine or a Container. This section describes the parameters you can use to migrate

Parallels and Xen virtual machines, Containers, and physical computers.

Common options:

--dst=<path>

Specifies the name and path of the directory on the destination server to use for storing the virtual machine files. If this option is omitted, the default directory is used.

232

Managing Virtual Machines

-h, --help

Displays the information on the utility usage.

Options specific for migrating virtual machines between Parallels servers:

--keep-src

--switch-template

--changesid

If this option is included, the original virtual machine is not removed from the source server after migration. By default, the original virtual machine is removed from the source server.

Switches the virtual machine to a template and a template to a virtual machine. For example, if the source virtual machine was a template, it becomes a full featured virtual machine after the migration, and vice versa.

Changes the resulting virtual machine SID.

Options specific for migrating Containers to virtual machines:

-s, --size=<size>

-r, --reg[=<y|n>]

-d, --remove[=<y|n>]

--key=<auth_key>

Sets the limit of the resulting virtual machine disk capacity. If you omit this option or specify 0, no limit is set. In this case disk quotas set for virtual machines on the Parallels server will be used. The following size modifiers can be used: G - gigabytes, M

- megabytes (by default), K - kilobytes.

Specifies whether to register the resulting virtual machine on the

Parallels server. By default, the virtual machine is registered.

Removes the source Container after migration. By default, the

Container is left intact.

Set the authentication key for passwordless access to the

Parallels server. To set this key, use the parallels-c2vagent --regkey <auth_key>

command on the server where the Container is residing (<auth_key> can be any alphanumeric value).

Options specific for migrating physical computers to virtual machines:

-r, --reg[=<y|n>]

--osdata=<path>

Specifies whether to register the resulting virtual machine on the Parallels server. By default, the virtual machine is registered.

Sets the path to the directory with data files required for the OS reconfiguration and not found on the source computer.

-a, --all

--key=<auth_key>

Migrate all computer's disks and partitions with all available data.

If this option is omitted, only data from the active disk drive is migrated.

Set the authentication key for passwordless access to the physical computer you want to migrate. To set this key on the computer, use the parallels-transporter-agent -regkey <value>

command (<auth_key> can be any alphanumeric value).

Options specific for migrating Xen virtual machine to virtual machines:

-r, --reg[=<y|n>] Specifies whether to register the resulting virtual machine on the Parallels server. By default, the virtual machine is registered.

233

Managing Virtual Machines

--osdata=<path>

Sets the path to the directory with data files required for the OS reconfiguration and not found on the source virtual machine.

--key=<auth_key> Set the authentication key for passwordless access to the Xen server. To set this key on the Xen server, use the parallels-transporter-agent -regkey <value>

command (<auth_key> can be any alphanumeric value).

--ip=<ip[/mask]

Sets the IP address for the resulting virtual machine. If this option is omitted, the DHCP support is enabled for the virtual machine.

--gw=<ip>

Sets the default gateway for the resulting virtual machine. If this options is omitted, the DHCP support is enabled for the virtual machine.

--nameserver=<ip>

Sets the DNS server for the resulting virtual machine.

--searchdomain=<domain>

Sets the DNS search domain for the resulting virtual machine.

234

Managing Virtual Machines

pbackup

The pbackup utility is run on the so-called Backup Server. It connects via SSH to the servers where some or all virtual machines are to be backed up and puts the tarballs into the

/vz/vmprivate/backups

directory. Later on, the virtual machine backups can be restored from this directory. It has the following syntax: pbackup [backup_options] SERVER1 ... [CT options]

You may specify any number of servers names or IP addresses in the command-line.

Notes:

1. This section describes only backup options for virtual machines. For backup options that can be used

with Containers, see pbackup (p. 144).

2. The backup settings in the /etc/vzbackup.conf file do not apply to virtual machines. To change some of the backup-related settings for virtual machines, you can use the prlsrvctl utility.

The backup options are the following:

-n CREDENTIALS

--ssh-opts OPTIONS

-F, -I

-i

Set the Backup Server, i.e. the server that will be used for storing the resulting virtual machine backups. If this parameter is omitted, the specified virtual machines will be backed up to the server where they are hosted.

The Backup Server can be specified in this format:

user[[:password]@server_IP_address_or_hostname[:port]

Options to be passed to ssh. See examples in the global backup configuration file.

Crete a full backup. A full backup contain all virtual machine data.

Make an incremental backup or, if no full backups are available, a full backup. An incremental backup contains only the file that were changed since the previous full or incremental backup.

The virtual machine options define the list of virtual machines to be backed up:

-e VM1...

-x VM1...

The virtual machines to back up on the server. Virtual machines can be specified using both their IDs and their names.

The virtual machines that need not be backed up (virtual machines to exclude). Virtual machines can be specified using both their IDs and their names.

235

Managing Virtual Machines

prestore

The prestore utility is run on the Backup Server. It uses the virtual machine backups stored on the Backup Server to restore them to their original servers (or to any other location if the –d option is specified). The syntax of the utility is the following: prestore [restore_options] server1 ... [CT_options]

You can specify any number of servers (their names or IP addresses) whose virtual machines were at one time backed up and now need to be restored.

The restore options are the following:

-l

-n backup_server

-e CT1...

-x CT1...

Do not restore any virtual machines. Show the information on the virtual machines available for restoring.

The Backup Server where to look for existing backups. If this option is omitted, prestore searches for the backups on the server from which they were originally backed up.

The format for the Backup Server is as follows:

<user[[:password]@server_IP_address_or_hostname[:port]

>

The virtual machines to restore on the server. Any virtual machine can be specified using both its ID or name.

The virtual machines that need not be restored (virtual machines to exclude). Any virtual machine can be specified using both its ID and name.

236

Managing Virtual Machines

prl_disk_tool

The prl_disk_tool utility is used to manage disk drives of your virtual machines. This utility has the following syntax: prl_disk_tool <COMMAND> [OPTIONS] --hdd <disk_path>

Resizing Virtual Disks

When resizing virtual disks, the utility has the following syntax: prl_disk_tool resize --size <size>[M|G] [--resize_partition] --hdd <disk_path> [-force] [--split] prl_disk_tool resize -i,--info [--units <K|M|G>] --hdd <disk_path>

Parameters resize

--size

--resize_partition

--hdd

<disk_path>

--force

--split

-i, --info

--units

Changes the capacity of the virtual disk. The disk to be resized must be formatted as NTFS, FAT 16, FAT 32, ext2, or ext3.

New size of the virtual disk. It can be set either in megabytes (specify M after the value) or in gigabytes (specify G after the value). By default, the size is set in megabytes.

Resizes the last partition of the specified virtual disk.

Full path to the virtual disk to be configured.

Forces the resizing operation for suspended virtual disks.

Splits the virtual hard disk into 2 GB files.

Do not resize the virtual disk; just show the size the disk will have after resizing.

Displays the disk size in kilobytes (K), megabytes (M, default), and gigabytes (G).

Compacting Virtual Disks

When compacting virtual disks, the utility has the following syntax: prl_disk_tool compact [--buildmap] --hdd <disk_path> [--force] prl_disk_tool compact -i,--info --hdd <disk_path>

Parameters compact

--hdd

<disk_path>

--buildmap

--force

Removes all empty blocks from the expanding virtual disk and reduces its size on your physical disk. The disk to be compacted must be formatted as NTFS, FAT 16, FAT 32, ext2, or ext3. You can also try to compact virtual disks with other filesystems using the --buildmap option.

Full path to the virtual disk to be configured.

Compacts virtual disks with unsupported filesystems.

Forces the compacting operation for suspended virtual disks.

237

Managing Virtual Machines

-i, --info

Do not compact the virtual disk; just display the information about the size the disk will have after compacting.

Preparing Virtual Disks for Booting

The prl_disk_tool utility can also be used to prepare virtual disks and real Boot Camp partitions for booting into virtual machines. In this case, the utility has the following syntax: prl_disk_tool configure --hdd <disk_path> [--para <paravirt_driver>] [--boot

<boot_driver>]

Parameters configure

--hdd

<disk_path>

--para

--boot

Prepares a disk or a real Boot Camp partition for booting into a virtual machine.

Full path to the virtual disk to be configured.

Specifies the full path to the Parallels virtualization driver.

Specifies the full path to the Parallels boot driver.

Converting Virtual Disks

You can use the prl_disk_tool utility to change the type of a virtual machine disk from

expanding to plain and vice versa. In this case, the utility has the following syntax: prl_disk_tool convert --hdd <disk_path> [--plain|expanding] [--split|--merge] prl_disk_tool convert -i,--info --hdd <disk_path>

Parameters convert

--hdd

<disk_path>

-i, --info

--plain

--expanding

--split

--merge

Converts the virtual disk from the expanding format to plain and vice versa.

Full path to the virtual disk to convert.

Do not convert the virtual disk; just show the size the disk will have after resizing.

Converts the disk to the plain format. A plain virtual hard disk has a fixed size.

Converts the disk to the expanding format. An expanding virtual hard disk is small initially. Its size grows as you add applications and data to it.

Splits the virtual hard disk into 2 GB files.

Merges all parts of the split disk into one file.

Displaying Utility Help

To display the utility help, use this command: prl_disk_tool --help

238

Managing Virtual Machines

pnetstat

This utility outputs traffic usage statistics for virtual machines. It has the following syntax: pnetstat [-4|-6] [-v <ID>] [-c <class>] [-a] [-r]

The utility displays input and output traffic for virtual machines for each defined network class, in bytes. The network classes are described in the /etc/vz/conf/networks_classes file. pnetstat

displays statistics only for virtual machines that were started at least once.

The utility accepts the following options:

-4|-6

-c <class>

-a

-r

-h, -help

Display IPv4 or IPv6 statistics for virtual machines. By default, the total amount of IPv4 and IPv6 statistics is shown.

Display statistics for the <class> class only.

Display statistics for all classes.

Rounds down the statistics results, which is shown in bytes by default. In this case, the statistics is displayed in the following units of measurement, depending on the amount of traffic:

• K(b)

—kilobytes

• M(b)

—megabytes

• G(b)

—gigabytes

Display the utility usage information.

239

Managing Virtual Machines

prl_convert

This utility is used to convert third-party virtual disks to Parallels virtual machines and disks. The prl_convert

utility has the following syntax: prl_convert <src> [options] prl_convert <src> --estimate

If the disk is a data disk, prl_convert converts it to a Parallels virtual disk. If a disk is a system disk, prl_convert converts it to a Parallels virtual machine. If the utility cannot create a virtual machine for the disk (for example, it fails to detect the operating system on the disk), the disk is converted to a Parallels virtual disk.

The utility accepts the following options:

--dst=

<path> Set the destination directory. If omitted, the default directory (/var/parallels) is used.

-r, --reg=<y|n>

Register the resulting virtual machine on the Parallels server. By default, the virtual machine is registered.

--os-files=

<path> Set the path to the operating system installation files. These files may be needed when reconfiguring the resulting virtual machine or disk.

--vbox-home=

<path> Specify the path to the directory storing virtual machine configuration files. This option should be used only when converting VirtualBox virtual machines.

--err-code

Show error codes instead of text messages.

--allow-no-os

Convert data disks or disks whose operating system cannot be detected.

--no-reconfig

Skip the reconfiguration step when converting a virtual disk.

--no-src-check

Do not check the source virtual disk state. Use this option with caution because disks of virtual machines that were running before the conversion may be in an inconsistent state after conversion.

--estimate

Estimate the disk size required for conversion, but do not perform the conversion.

-h, --help

Display the utility usage information.

240

C

H A P T E R

5

Glossary

This glossary defines terms and spells out abbreviations used in Parallels Server Bare Metal documentation. References to terms defined elsewhere in the glossary appear in italics.

Application template. A template used to install a set of applications in Containers. See also

Template.

Container (or regular Container). A virtual private server, which is functionally identical to an isolated standalone server, with its own IP addresses, processes, files, its own users database, its own configuration files, its own applications, system libraries, and so on. Containers share one

Parallels server and one OS kernel. However, they are isolated from each other. A Container is a kind of ‘sandbox’ for processes and users.

Guest operating system (Guest OS). An operating system installed inside a virtual machine and

Container. It can be any of the supported Windows or Linux operating systems.

Hardware virtualization. A virtualization technology allowing you to virtualize physical servers at the hardware level. Hardware virtualization provides the necessary environment for creating and managing Parallels virtual machines.

Operating system virtualization (OS virtualization). A virtualization technology allowing you to virtualize physical servers at the operating system (kernel) level. OS virtualization provides the necessary environment for creating and managing Parallels Containers.

OS template (Operating System template). A template used to create new Containers with a pre-installed operating system. See also Template.

Package set. See Template.

Parallels Management Console. A Parallels Server Bare Metal management and monitoring tool with graphical user interface. Parallels Management Console is cross–platform and can run on

Microsoft Windows and Linux computers.

Parallels Server. A hardware virtualization solution that enables you to efficiently use your physical server's hardware resources by sharing them between multiple virtual machines created on this server.

Parallels server (physical server or server). A server where the Parallels Server Bare Metal software is installed for hosting Parallels virtual machines and Containers. Sometimes, it is marked as Container 0.

Glossary

Parallels Server Bare Metal license. A special license that you should install on the physical server to be able to start using Parallels Server Bare Metal. Every physical server must have its own license installed.

Parallels Virtuozzo Containers for Linux. An operating system virtualization solution allowing you to create multiple isolated Containers on a single physical server to share hardware, licenses, and management effort with maximum efficiency.

Private area. A part of the file system storing Container files that are not shared with other

Containers.

Template (package set). A set of original application files (packages) repackaged for mounting over Virtuozzo File System. There are two types of templates. OS Templates are used to create new Containers with a pre-installed operating system. Application templates are used to install an application or a set of applications in Containers.

UBC. An abbreviation of User Beancounter.

User Beancounter. The subsystem of the Parallels Server Bare Metal software for managing

Container memory and some system-related resources.

Virtual Environment (VE). An obsolete designation of a Container.

Virtuozzo File System (VZFS). A virtual file system for mounting to Container private areas. VZFS symlinks are seen as real files inside Containers.

Virtual machine (VM). A computer emulated by Parallels Server Bare Metal. Like a Container, a virtual machine is functionally identical to an isolated standalone computer, with its own IP addresses, processes, files, its own users database, its own configuration files, its own applications, system libraries, and so on. However, as distinct from Containers, virtual machines run their own operating systems rather than sharing one operating system kernel.

242

Index

Index

A

About Parallels Server Bare Metal 5.0 - 9

About This Guide - 10

Action Scripts - 61, 108, 109, 143 add - 79

Applications - 111, 189

Available Commands - 83

B

Backing-Up Utilities - 143

Backup Configuration File - 54

C

Configuration Files creating - 187 offline services - 44 scaling - 188 sysctl - 43 validating - 189 vzlmond - 45 vzreport - 42 vzrmond - 49 vzstat - 47 vzstatrep - 52 vzup2date - 37 vzvpn - 41

Container accessing - 105, 120 backing up - 143 configuring - 105, 111, 130 creating - 105, 107 destroying - 105, 108 disk quota - 131 inodes - 131 listing - 124, 126 mounting - 105, 110 recovering - 105, 121 reinstalling - 105, 121 restarting - 105, 109 restoring - 105 starting/stopping - 105, 109

Container Action Scripts - 61

Container Configuration File - 26

D del - 80

Documentation Conventions - 11

E

EZ Template adding to Container - 148 application - 148, 151, 153, 157, 159, 160 caching - 162, 163, 164 cleaning - 148, 169 creating - 171 installing - 148, 157 listing - 148, 151 management tools - 148

OS - 148, 151, 153, 159, 162, 163, 164 removing - 148, 160 scripts - 171 updating - 148, 159

EZ Template Management Utilities - 148

F

Feedback - 15

Floppy Disk Drive Management Parameters -

212

Index

Formatting Legend - 13

G

General Syntax - 64, 225

Getting Help - 14

Global Parallels Server Bare Metal

Configuration File - 19

Glossary - 241

H

Hard Disk Drive Management Parameters -

208

HN - See Hardware

Host OS - 61

Hostname

Container - 105, 111

Hardware Node - 52, 94

Parallels support server - 41 proxy server - 41, 42

I

Introduction - 8

IP Address

Container - 44, 95, 105, 111

DNS server - 111

Hardware Node - 52, 94

Parallels support server - 41 proxy server - 41, 42 iptables - 111

K

Kernel - 43

2.6 - 111

Kernel Parameters - 43

L

License installing - 89

Linux Distribution Configuration Files - 34 list - 80

M

Managing Containers - 102

Managing Parallels Server Bare Metal 5.0 - 16

Managing Shared Folders - 220

Managing Virtual Devices - 206

Managing Virtual Machines - 192

Matrix of Parallels Server Bare Metal

Command-Line Utilities - 103

Migration

Container to Container - 141

Migration Utilities - 135

Modifying Virtual Machine Configuration - 202

N net add - 67 net del - 69 net list - 69 net set - 68

Network classes - 36 parameters - 111

Network Adapter Management Parameters -

213

Network Classes Definition File - 36

Node

Hardware - 41, 42, 45, 52, 94, 95, 105,

111, 180, 186, 190

Monitor - 52

O

Offline Management - 111

Offline Management Configuration Files - 44

Optical Disk Drive Management Parameters -

210

Organization of This Guide - 11

Overview - 60

P

Parallel Port Management Parameters - 216

Parallels Server Bare Metal Configuration Files

- 17

Parallels Server Bare Metal Scripts - 59

Parallels Server Bare Metal Utilities - 63

Parallels Virtuozzo Containers scripts - 61

Password

Container user - 105, 111 setting - 105, 111 pbackup - 144, 235 pctl - 105, 192 pctl backup - 193 pctl backup-delete - 194 pctl backup-list - 195 pctl capture - 196

pctl clone - 196 pctl create - 107, 226 pctl delete - 227 pctl delete and pctl destroy - 108 pctl enter - 197 pctl exec - 197 pctl exec, pctl exec2, and pctl enter - 120 pctl list - 198 pctl migrate - 228 pctl mount - 229 pctl mount and pctl umount - 110 pctl pause, suspend, resume - 199 pctl problem-report - 200 pctl quotaon, pctl quotaoff, and pctl quotainit

- 122 pctl recover and pctl reinstall - 121 pctl register, unregister - 230 pctl restore - 201 pctl runscript - 123 pctl server - 231 pctl set - 111, 201 pctl snapshot - 221 pctl snapshot-delete - 222 pctl snapshot-list - 222 pctl snapshot-switch - 223 pctl start, pctl stop, pctl restart, and pctl status - 109 pctl start, stop, reset - 224 pctl suspend and pctl resume - 122 pctl umount - 231 pctl unset - 120

Plesk - 44, 111 pmigrate - 135, 232 pnetstat - 239 prestore - 146, 236 privnet - 78 prl_convert - 240 prl_disk_tool - 237 prlsrvctl - 64 prlsrvctl info - 65 prlsrvctl install-license - 66 prlsrvctl net - 66 prlsrvctl problem-report - 70 prlsrvctl set - 71 prlsrvctl shutdown - 73 prlsrvctl statistics - 73 prlsrvctl usb - 74 prlsrvctl user list - 77

Index prlsrvctl user set - 78

Problem Report - 93

Processes viewing - 181 pstat - 95

R

RAM - See memory

Removing Devices from Virtual Machine - 219

Resources calculating - 186

CPU - 185 disk space - 183 memory - 186 monitoring - 95

S

Scripts - 61

Secure Shell - 111

Serial Port Management Parameters - 215

Services changing mode - 182 viewing - 181 xinetd-dependent - 182 set - 79

Setting Connection Parameters - 82

SLM - 111

Sound Device Management Parameters -

218

SSH - See Secure Shell

Supplementary Tools - 178

T

TCP - 111

Template area - 180

U

UBC - See User Beancounters

Update Filters and Update IDs - 85

USB Controller Management Parameters -

217 usb del - 76 usb list - 75 usb set - 76

User Beancounters - 47, 95

Index

V venet - 43

Virtual Machine Action Scripts - 63

Virtuozzo File System - 121, 178, 183 vzcache - 180 vzcalc - 186 vzcfgscale - 188 vzcfgvalidate - 189 vzcheckovr - 186 vzcpucheck - 185 vzdqcheck - 183 vzdqdump and vzdqload - 184

VZFS - See Virtuozzo File System vzfsutil - 178 vzhwcalc - 190 vzlicload - 89 vzlicupdate - 90 vzlicview - 91 vzlist - 124 vzlist Output Parameters and Their Specifiers

- 126 vzlmond Configuration File - 45 vzmemcheck - 186 vzmigrate - 139 vzmktmpl - 171 vzmlocal - 141 vzmtemplate - 191 vznetcfg - 92 vznetstat - 185 vzp2v - 142 vzpid - 187 vzpkg clean - 169 vzpkg create cache - 162 vzpkg fetch - 168 vzpkg info - 153 vzpkg install - 157 vzpkg install template - 149 vzpkg link - 161 vzpkg list - 151 vzpkg localinstall - 165 vzpkg localupdate - 166 vzpkg remove - 160 vzpkg remove cache - 164 vzpkg remove template - 150 vzpkg status - 156 vzpkg update - 159 vzpkg update cache - 163 vzpkg update metadata - 170 vzpkg update template - 149 vzpkg upgrade - 167 vzpkg.metafile - 173 vzpkgproxy - 175 vzpkgproxy Configuration File - 58 vzps and vztop - 181 vzquota - 130 vzquota drop - 132 vzquota init - 131 vzquota on and vzquota off - 132 vzquota setlimit - 133 vzquota setlimit2 - 133 vzquota stat and vzquota show - 134 vzreport - 93 vzreport Configuration File - 42 vzrhnproxy - 176 vzrhnproxy Configuration File - 57 vzrmond Configuration File - 49 vzsetxinetd - 182 vzsplit - 187 vzstat Configuration File - 47 vzstatrep - 94 vzstatrep Configuration File - 52 vztt Configuration File - 59 vzup2date - 81 vzup2date Configuration File - 37 vzup2date install - 87 vzup2date-mirror - 88 vzup2date-mirror Configuration File - 38 vzvpn Configuration File - 41

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents