Parallels Cloud Server - 6.0 User's Guide

Parallels Cloud Server 6.0
User's Guide
Copyright © 1999-2012 Parallels IP Holdings GmbH and its affiliates. All rights reserved.
Copyright © 1999-2012 Parallels IP Holdings GmbH 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 ............................................................................................................. 10
About This Guide .......................................................................................................... 10
Organization of This Guide .................................................................................................... 10
Documentation Conventions ................................................................................................. 11
Getting Help .................................................................................................................. 12
Feedback ...................................................................................................................... 12
Learning Parallels Cloud Server 6.0 Basics ............................................................ 14
Parallels Cloud Server 6.0 Overview ............................................................................... 14
OS Virtualization Layer ................................................................................................... 16
Basics of OS Virtualization ..................................................................................................... 16
Parallels Containers ............................................................................................................... 16
Memory and IOPS Deduplication ........................................................................................... 18
Templates ............................................................................................................................. 18
Hardware Virtualization Layer ......................................................................................... 19
Basics of Hardware Virtualization ........................................................................................... 19
Parallels Virtual Machines ...................................................................................................... 19
Virtual Machine Hardware ...................................................................................................... 20
Virtual Machine Files .............................................................................................................. 21
Support of Virtual and Real Media ......................................................................................... 21
Parallels Cloud Server Configuration .............................................................................. 22
Resource Management ................................................................................................. 23
Understanding Licensing ............................................................................................... 23
Physical Server Availability Considerations ..................................................................... 24
Managing Virtual Machines and Containers ........................................................... 25
Creating Virtual Machines and Containers ...................................................................... 25
Supported Guest Operating Systems .................................................................................... 27
Choosing OS EZ Template .................................................................................................... 28
Performing Initial Configuration ...................................................................................... 28
Configuring Network Settings ................................................................................................ 29
Setting Passwords for Virtual Machines and Containers ........................................................ 29
Contents
Setting Startup Parameters ................................................................................................... 30
Starting, Stopping, and Querying Status of Virtual Machines and Containers .................. 30
Listing Virtual Machines and Containers ......................................................................... 31
Storing Extended Information on Virtual Machines and Containers .................................. 32
Copying Virtual Machines and Containers within Server .................................................. 32
Suspending Virtual Machines and Containers ................................................................. 34
Running Commands in Virtual Machines and Containers ................................................ 34
Deleting Virtual Machines and Containers ...................................................................... 35
Viewing Detailed Information About Virtual Machines and Containers .............................. 35
Managing Virtual Machine and Container Backups ......................................................... 37
Backups Overview ................................................................................................................. 37
Using prlctl backup and prlctl restore .................................................................................... 38
Using pbackup and prestore ................................................................................................. 41
Managing Templates ..................................................................................................... 44
Creating Templates ............................................................................................................... 45
Listing Templates .................................................................................................................. 45
Deploying Templates ............................................................................................................. 45
Managing Snapshots .................................................................................................... 46
Creating Snapshots ............................................................................................................... 46
Listing Snapshots .................................................................................................................. 48
Reverting to Snapshots ......................................................................................................... 49
Deleting Snapshots ............................................................................................................... 49
Migrating Virtual Machines and Containers ..................................................................... 49
General Migration Requirements ........................................................................................... 50
Migrating Virtual Machines and Containers Between Parallels Servers ................................... 51
Migrating Containers to Virtual Machines ............................................................................... 54
Migrating Physical Computers to Virtual Machines and Containers ........................................ 56
Migrating Virtual Machines to Containers ............................................................................... 60
Migrating Xen Virtual Machines .............................................................................................. 61
Performing Container-Specific Operations ..................................................................... 62
Reinstalling Containers .......................................................................................................... 63
Enabling VPN for Containers ................................................................................................. 64
Performing Virtual Machine-Specific Operations ............................................................. 65
Pausing Virtual Machines ....................................................................................................... 65
Contents
Managing Virtual Machine Devices ........................................................................................ 65
Making Screenshots .............................................................................................................. 72
Assigning USB Devices to Virtual Machines ........................................................................... 72
Configuring IP Address Ranges for Host-Only Networks ....................................................... 74
Converting Third-Party Virtual Machines and Disks ................................................................ 75
Managing Resources .............................................................................................. 77
What are Resource Control Parameters? ....................................................................... 77
Managing CPU Resources ............................................................................................ 77
Configuring CPU Units ........................................................................................................... 78
Configuring CPU Affinity for Virtual Machines and Containers ................................................ 78
Configuring CPU Limits for virtual machines and Containers ................................................. 79
Binding CPUs to NUMA Nodes ............................................................................................. 81
Enabling CPU Hotplug for Virtual Machines ........................................................................... 82
Managing Disk Quotas .................................................................................................. 83
What are Disk Quotas? .......................................................................................................... 83
Disk Quota Parameters ......................................................................................................... 83
Managing Per-Container Disk Quotas ................................................................................... 84
Managing Per-User and Per-Group Disk Quotas ................................................................... 85
Managing Virtual Disks .................................................................................................. 86
Changing Virtual Machine Disk Type...................................................................................... 86
Increasing Disk Capacity ....................................................................................................... 87
Reducing Disk Capacity ........................................................................................................ 88
Compacting Disks ................................................................................................................. 89
Managing Virtual Machine Disk Interfaces .............................................................................. 89
Managing Network Accounting and Bandwidth .............................................................. 90
Network Traffic Parameters ................................................................................................... 90
Configuring Network Classes ................................................................................................ 91
Viewing Network Traffic Statistics .......................................................................................... 92
Turning On and Off Network Bandwidth Management .......................................................... 93
Configuring Network Bandwidth Management ...................................................................... 94
Managing Disk I/O Parameters ...................................................................................... 96
Configuring Priority Levels for Virtual Machines and Containers ............................................. 96
Configuring Disk I/O Bandwidth ............................................................................................. 97
Configuring the Number of I/O Operations Per Second ......................................................... 98
Viewing Disk I/O Statistics ..................................................................................................... 98
Contents
Setting Disk I/O Limits for Container Backups and Migrations ............................................... 99
Locating Disk I/O Bottlenecks for Containers ...................................................................... 100
Managing Memory Parameters for Containers.............................................................. 101
Configuring Main VSwap Parameters .................................................................................. 101
Configuring the Memory Allocation Limit .............................................................................. 102
Configuring OOM Killer Behavior ......................................................................................... 103
Tuning VSwap ..................................................................................................................... 104
Configuring Legacy Containers ............................................................................................ 104
Managing Memory Parameters for Virtual Machines ..................................................... 105
Configuring Main Memory Parameters ................................................................................. 105
Configuring Additional Memory Parameters ......................................................................... 106
Enabling Memory Hotplug for Virtual Machines .................................................................... 109
Managing Container Resources Configuration .............................................................. 110
Splitting Server Into Equal Pieces ........................................................................................ 111
Scaling Container Configuration .......................................................................................... 111
Applying New Configuration Sample to Container ............................................................... 112
Managing Virtual Machine Configuration Samples ........................................................ 113
Monitoring Resources ................................................................................................. 114
Managing Services and Processes ...................................................................... 116
What Are Services and Processes ............................................................................... 116
Main Operations on Services and Processes................................................................ 117
Managing Processes and Services .............................................................................. 118
Viewing Active Processes and Services ............................................................................... 118
Monitoring Processes in Real Time ...................................................................................... 120
Determining Container Identifiers by Process IDs ................................................................ 121
Managing Parallels Cloud Server Network ........................................................... 122
Managing Network Adapters on the Parallels Server .................................................... 122
Listing Adapters .................................................................................................................. 123
Creating VLAN Adapters ..................................................................................................... 123
Networking Modes in Parallels Cloud Server ................................................................ 124
Container Network Modes ................................................................................................... 124
Virtual Machine Network Modes .......................................................................................... 128
Differences Between Host-Routed and Bridged Network Modes ........................................ 131
Configuring Virtual Machines and Containers in Host-Routed Mode .............................. 131
Contents
Configuring Virtual Machines and Containers in Bridged Mode ..................................... 133
Managing Virtual Networks .................................................................................................. 133
Managing Adapters in Containers ........................................................................................ 138
Managing Adapters in Virtual Machines ............................................................................... 141
Managing Private Networks ......................................................................................... 143
Learning Private Networks ................................................................................................... 143
Setting Up Private Networks ................................................................................................ 146
Configuring Offline Management .................................................................................. 148
Understanding Offline Management .................................................................................... 149
Enabling and Disabling Offline Management ........................................................................ 152
Enabling and Disabling Offline Services ............................................................................... 153
Offline Management Configuration Files ............................................................................... 153
Using Open vSwitch Bridges ....................................................................................... 154
Managing Licenses ............................................................................................... 156
Installing the License ................................................................................................... 156
Updating the Current License ...................................................................................... 157
Transferring the License to Another Server ................................................................... 158
Viewing the Current License ........................................................................................ 159
Viewing the License ............................................................................................................. 159
License Statuses ................................................................................................................. 161
Keeping Your System Up To Date ........................................................................ 162
Updating Parallels Cloud Server ................................................................................... 162
Rebootless Updates ............................................................................................................ 162
Updating All Components.................................................................................................... 163
Updating Kernel ................................................................................................................... 163
Updating EZ Templates ....................................................................................................... 164
Checking for Updates .......................................................................................................... 164
Performing More Actions ..................................................................................................... 164
Updating Software In Virtual Machines ......................................................................... 164
Updating Containers ................................................................................................... 165
Updating EZ Template Packages Inside a Container ........................................................... 165
Updating OS EZ Template Caches ...................................................................................... 166
Advanced Tasks .................................................................................................... 168
Configuring Capabilities ............................................................................................... 168
Contents
Available Capabilities for Containers .................................................................................... 168
Creating Customized Containers ................................................................................. 170
Using OS Template Caches with Preinstalled Application Templates ................................... 170
Using Customized OS EZ Templates ................................................................................... 172
Using EZ OS Template Sets ................................................................................................ 173
Using Customized Application Templates ............................................................................ 175
Changing System Time from Containers ...................................................................... 176
Obtaining Server ID from Inside a Container ................................................................. 177
Restarting Containers .................................................................................................. 177
Enabling VNC Access to Virtual Machines and Containers ............................................ 178
Enabling VNC Access to Virtual Machines ........................................................................... 178
Enabling VNC Access to Containers .................................................................................... 178
Connecting with a VNC Client ............................................................................................. 179
Setting Immutable and Append Flags for Container Files and Directories ...................... 179
Managing iptables Modules ......................................................................................... 179
Using iptables Modules on Servers ...................................................................................... 179
Using iptables Modules in Containers .................................................................................. 180
Creating Configuration Files for New Linux Distributions ............................................... 181
Aligning Disks and Partitions in Virtual Machines .......................................................... 182
Running Parallels Cloud Server 6.0 in Virtual Machines ................................................. 187
Installing Optional Parallels Cloud Server Packages ...................................................... 189
Working with Shared Folders in Linux Virtual Machines ................................................. 189
Sharing with Ownership of a Virtual Machine User ............................................................... 189
Mounting as a Specific User ................................................................................................ 191
Sharing with Ownership of a Server User ............................................................................ 191
Legacy Features .................................................................................................... 193
Using Virtuozzo File System ......................................................................................... 193
Creating VZFS-based Containers................................................................................. 193
Converting VZFS Containers to New Layout ................................................................ 194
Listing Legacy Container Backups ............................................................................... 194
Troubleshooting .................................................................................................... 195
General Considerations ............................................................................................... 195
Kernel Troubleshooting ................................................................................................ 197
Using ALT+SYSRQ Keyboard Sequences ........................................................................... 197
Contents
Saving Kernel Faults (OOPS) ............................................................................................... 197
Finding a Kernel Function That Caused the D Process State ............................................... 199
Problems with Container Management ........................................................................ 199
Failure to Start a Container .................................................................................................. 199
Failure to Access a Container from Network ........................................................................ 200
Failure to Log In to a Container ............................................................................................ 200
Getting Technical Support ........................................................................................... 201
Preparing and Sending Questions to Technical Support ...................................................... 201
Submitting a Problem Report to Technical Support ............................................................. 202
Establishing Secure Channel to Parallels Support ................................................................ 202
Glossary ................................................................................................................. 204
Index ...................................................................................................................... 206
Feedback ............................................................................................................... 12
C
HAPTER
1

Introduction

Parallels Cloud Server 6.0 is a virtualization solution that allows you to run multiple virtual machines and Containers on a single physical server.
This chapter provides general information about Parallels Cloud Server and this guide. You will learn
goals and target audience of the guide (p. 10)
guide organization (p. 10)
documentation conventions used in the guide (p. 11)
resources to consult to get more information on Parallels Cloud Server (p. 12)
ways to submit feedback to the Parallels documentation team (p. 12)
In This Chapter
About This Guide ................................................................................................... 10
Getting Help ........................................................................................................... 12

About This Guide

The Parallels Cloud Server 6.0 User's Guide provides comprehensive information on Parallels Cloud Server 6.0, high-end virtualization software for bare metal servers. The guide covers the necessary theoretical concepts as well as practical aspects of working with Parallels Cloud Server.
Note: The guide does not explain how to install and configure your Parallels Cloud Server 6.0 system. For detailed information on these operations, see the Parallels Cloud Server 6.0 Installation Guide.
The primary audience for this guide is administrators responsible for managing systems that run Parallels Cloud Server 6.0. The guide assumes that you have a working knowledge of Linux operating systems (command line, system administration, and so on).

Organization of This Guide

This guide is organized in the following way:
Chapter 1, Introduction (p. 10), gives an overview of the Parallels Cloud Server product and this guide.
Introduction
Chapter 2, Learning Parallels Cloud Server 6.0 Basics (p. 14), explains the general principles of Parallels Cloud Server operation.
Chapter 3, Managing Virtual Machines and Containers (p. 25), covers those operations that you can perform on a virtual machine and Container: creating and deleting virtual machines and Containers, starting and stopping them, backing up and restoring, etc. You will also learn how to perform different kinds of migration: migrate virtual machines and Containers between Parallels servers, migrate a physical server to a virtual machine and Container, and migrate a Container to a virtual machine.
Chapter 4, Managing Resources (p. 77), focuses on configuring and monitoring the resource control parameters for virtual machines and Containers. These parameters comprise disk quotas, network accounting and shaping, CPU and system resources.
Chapter 5, Managing Services and Processes (p. 116), familiarizes you with the operations you can perform on processes and services in Parallels Cloud Server.
Chapter 6, Managing Parallels Cloud Server Network (p. 122), familiarizes you with the Parallels Cloud Server network structure and explains how to manage networks in Parallels Cloud Server systems.
Chapter 7, Managing Licenses (p. 156), provides detailed information on managing licenses in Parallels Cloud Server.
Chapter 8, Keeping Your System Up To Date (p. 162), informs you of the ways to keep all the software components of a Parallels server up to date.
Chapter 9, Advanced Tasks (p. 168), enumerates those tasks that are intended for advanced system administrators who would like to obtain deeper knowledge about Parallels Cloud Server capabilities.
Chapter 10, Troubleshooting (p. 195), suggests ways to resolve common inconveniences should they occur during your work with Parallels Cloud Server.

Documentation Conventions

Before you start using this guide, it is important to understand the documentation conventions used in it.
The table below presents the existing formatting conventions.
Formatting convention Type of Information Example
Special Bold
Items you must select, such as menu options, command buttons, or items in a list.
Titles of chapters, sections, and subsections.
Go to the Resources tab.
Read the Basic Administration chapter.
11
Introduction
Italics
prlctl delete
Preformatted
Saved parameters for Container 101
Monospace Bold
C:\vzlist -a
Monospace
Key+Key Key combinations for which the user
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.
The names of commands, files, and directories.
On-screen computer output in your command-line sessions; source code in XML, C++, or other programming languages.
What you type, as contrasted with on-screen computer output.
must press and hold down one key and then press another.
These are the so-called OS templates.
To remove a Container, type ctid.
Use prlctl start to start a Container.
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.

Getting Help

In addition to this guide, there are a number of other resources available for Parallels Cloud Server which can help you use the product more effectively. These resources include:
Parallels Cloud Server 6.0 Installation Guide. This guide provides detailed information on installing Parallels Cloud Server on your server, including the pre-requisites and the stages you shall pass.
Getting Started With Parallels Cloud Server 6.0. This guide provides basic information on how to install Parallels Cloud Server on your server, create new Containers and virtual machines, and perform main operations on them. As distinct from the Parallels Cloud Server 6.0 Installation Guide, it does not contain detailed description of all the operations needed to install and set Parallels Cloud Server to work (e.g., installing Parallels Cloud Server in text mode).
Parallels Cloud Server 6.0 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.).
Parallels Cloud Server 6.0 Command Line Reference Guide. This guide is a complete reference on all Parallels Cloud Server configuration files and command line utilities.

Feedback

12
Introduction
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/).
13
Physical Server Availability Considerations .............................................................. 24
C
HAPTER
2

Learning Parallels Cloud Server 6.0 Basics

This chapter provides a brief description of Parallels Cloud Server 6.0, Parallels virtual machines and Containers, their specifications and underlying technologies.
In This Chapter
Parallels Cloud Server 6.0 Overview ........................................................................ 14
OS Virtualization Layer ............................................................................................ 16
Hardware Virtualization Layer .................................................................................. 19
Parallels Cloud Server Configuration ....................................................................... 22
Resource Management .......................................................................................... 23
Understanding Licensing ........................................................................................ 23

Parallels Cloud Server 6.0 Overview

Parallels Cloud Server 6.0 allows you to simultaneously run multiple Parallels virtual machines and Containers on a single physical server. Using this software, you can efficiently use your server's hardware resources by sharing them among virtual machines and Containers.
Graphically, a server with the Parallels Cloud Server software installed can be represented as follows:
Learning Parallels Cloud Server 6.0 Basics
At the base resides server hardware. Next is the Parallels Cloud Server software which is installed directly on the server hardware and does not need any operating system for its functioning. Parallels Cloud Server includes two virtualization layers:
Hardware virtualization layer. This layer provides the necessary environment for creating and managing Parallels virtual machines.
OS virtualization layer. This layer provides the necessary environment for creating and managing Parallels Containers.
For more information on both layers, see OS Virtualization Layer (p. 16) and Hardware Virtualization Layer (p. 19).
Effectively uniting both virtualization technologies, Parallels Cloud Server provides the best value for cost conscious organizations enabling them to:
standardize server hardware platforms
effectively consolidate server resources
consolidate and support legacy OSs and applications
streamline server and application deployment, maintenance, and management
simplify software testing and development
optimize server and application availability
You can use the following tools to manage virtual machines and Containers:
Command line interface (CLI). This tool comprises a set of Parallels command line utilities and
15
Learning Parallels Cloud Server 6.0 Basics
can be used to manage virtual machines and Containers both locally and remotely.
Parallels Virtual Automation. Parallels Virtual Automation is a tool for managing physical servers, Containers, and virtual machines with the help of a standard Web browser on any platform.

OS Virtualization Layer

This section provides detailed information on the OS virtualization layer, one of the two components of Parallels Cloud Server, responsible for providing support for Parallels Containers.

Basics of OS Virtualization

The OS virtualization allows you to virtualize physical servers on the operating system (kernel) layer. The diagram below shows the basic architecture of OS virtualization.
The OS virtualization layer ensures isolation and security of resources between different Containers. The virtualization layer makes each Container appear as a standalone server. Finally, the Container itself houses its own applications and workload. OS virtualization is streamlined for the best performance, management, and efficiency. Its main advantages are the following:
Containers perform at levels consistent with native servers. Containers have no virtualized hardware and use native hardware and software drivers making its performance unbeatable.
Each Container can seamlessly scale up to the resources of an entire physical server.
OS virtualization technology provides the highest density available from a virtualization solution.
You can create and run up to 100s of Containers on a standard production physical server.
Containers use a single OS, making it extremely simple to maintain and update across Containers. Applications may also be deployed as a single instance.

Parallels Containers

From the point of view of applications and Container users, each Container is an independent system. This independence is provided by the Parallels Cloud Server OS virtualization layer. Note that only a negligible part of the CPU resources is spent on virtualization (around 1-2%). The main features of the virtualization layer implemented in Parallels Cloud Server are the following:
16
Learning Parallels Cloud Server 6.0 Basics
A Container looks like a normal Linux system. It has standard startup scripts; software from
/vz/private/
/vz/private/
/root.hdd/root.hdd
/vz/root/
vendors can run inside Containers without any modifications or adjustment.
A user can change any configuration file and install additional software inside Containers.
Containers are fully isolated from each other (file system, processes, sysctl variables) and
Parallels virtual machines.
Containers share dynamic libraries, which greatly saves memory.
Processes belonging to a Container are scheduled for execution on all available CPUs.
Consequently, Containers are not bound to only one CPU and can use all available CPU power.
The two key parts of any Container are the contents and configuration. By default, all Container files are stored in the /vz/private/<CT_ID> directory on the Parallels server, also called private area.
Key Container directories and files:
File Name Description
ve.conf
<CT_ID>
<CT_ID>
<CT_ID>
Container private area.
Virtual hard disk with Container contents.
Container mount point.
Container configuration file:
Is symlinked to /etc/vz/conf/<CT_ID>.conf.
Defines Container parameters, such as allocated
resource limits, IP address and hostname, and so on.
Overrides matching parameters in the global configuration file.
All Container files are stored in a single image (/vz/private/<CT_ID>/root.hdd/root.hdd), similar to a virtual machine's hard disk. Such standalone nature:
Enables easier migrations and backups due to a faster sequential I/O access to Container images than to separate Container files.
Removes the need for OS and application templates once a Container is created.
Allows the use of native Linux disk quotas that are journaled and does not require quota
recalculation after disasters like server crashes.
Note: Using Containers that store all files in an image file (also known as Containers with the Container- in-an-image-file layout) is supported only for /vz partitions formatted as ext4.
17
Learning Parallels Cloud Server 6.0 Basics

Memory and IOPS Deduplication

Parallels Cloud Server supports memory and IOPS deduplication that helps eliminate memory and I/O bottlenecks in the new image-based Containers and increases the number of running Containers per Parallels server.
Identical files in multiple Containers are efficiently cached and the resulting cache can be stored on an SSD drive to further improve overall system performance and reduce the starting times of multiple similar Containers.
Note: Memory and IOPS deduplication can be managed with the pfcache utility described in the Parallels Cloud Server 6.0 Command Line Reference Guide.

Templates

A template (or a package set) in Parallels Cloud Server is a set of original application files repackaged for use by Parallels Cloud Server. Usually, it is just a set of RPM packages for Red Hat like systems. Parallels Cloud Server provides tools for creating templates, installing, upgrading, adding them to and removing them from a Container.
Using templates lets you:
Share RAM among similar applications running in different Containers to save hundreds of megabytes of memory.
Deploy applications simultaneously in many Containers.
Use different versions of an application in different Containers (for example, perform upgrades
only in certain Containers).
There are two types of templates: OS and application:
An OS template is an operating system and the standard set of applications to be found right after the installation. Parallels Cloud Server uses OS templates to create new Containers with a preinstalled operating system.
An application template is a set of repackaged software packages optionally accompanied with configuration scripts. Application templates are used to add extra software to existing Containers.
For example, you can create a Container on the basis of the redhat OS template and add the MySQL application to it with the help of the mysql template.
Note: For detailed information on Parallels templates, see the Parallels Cloud Server 6.0 Templates Management Guide.
18
Learning Parallels Cloud Server 6.0 Basics

Hardware Virtualization Layer

This section familiarizes you with the second component of Parallels Cloud Server - the hardware virtualization layer. This layer provides the necessary environment for creating and managing Parallels virtual machines.

Basics of Hardware Virtualization

Parallels Cloud Server is based on the concept of hardware virtualization. Hardware virtualization has a base layer—a hypervisor. This layer is loaded directly on the bare server and acts as an intermediary between the server hardware and virtual machines. To allocate hardware and resources to virtual machines, Parallels Cloud Server virtualizes all hardware on the server. Once virtualized, hardware and resources can be easily assigned to virtual machines. Based on the virtual hardware, a virtual machine runs its own complete copies of an operating system and applications.
The following diagram shows the basic architecture of hardware virtualization.
Like OS virtualization, hardware virtualization also provides many benefits the main of which are listed below:
Create multiple virtual machines with different operating systems on a single physical computer.
Run several guest operating systems and their applications simultaneously on a single physical
computer without rebooting.
Consolidate and virtualize the computing environment, reduce hardware costs, lower operating expenses, and increase productivity.
Use open APIs and SDK to extend management integration with in-house and third-party applications.

Parallels Virtual Machines

From the point of view of applications and virtual machine users, each virtual machine is an independent system with an independent set of virtual hardware. This independence is provided by
19
Learning Parallels Cloud Server 6.0 Basics
the Parallels Cloud Server hardware virtualization layer. The main features of the virtualization layer
are the following:
A virtual machine looks like a normal computer. It has its own virtual hardware, and software applications can run in virtual machines without any modifications or adjustment.
A user can easily change the virtual machine configuration (e.g., add a new virtual disk or increase memory).
Virtual machines are fully isolated from each other (file system, processes, sysctl variables) and Parallels Cloud Server.
Install any of the supported operating systems in the virtual machine. The guest operating system and its applications are isolated inside a virtual machine and share physical hardware resources with other virtual machines.
Intel and AMD Virtualization Technology Support
Parallels Cloud Server provides support for Intel and AMD virtualization technologies comprising a set of processor enhancements and improving the work of virtualization solutions. Utilizing these technologies, Parallels Cloud Server can offload some workload to the system hardware, which results in the "near native" performance of guest operating systems.

Virtual Machine Hardware

A Parallels virtual machine works like a stand-alone computer with the following hardware:
CPU
Motherboard
RAM
Video Adapter
Video RAM
Floppy Disk Drive
SATA Devices
Hard Disk
CD/DVD-ROM Drive
SCSI Devices
Hard Disk
Generic SCSI Device
Network Interfaces
Serial (COM) Ports
Parallel (LPT) Ports
Sound Card
Up to 32 Intel/AMD CPUs
Intel i965-based motherboard
Up to 128 GB of RAM
VGA/SVGA video adapter with VBE 3.0
Up to 256 MB of video memory
1.44 MB floppy disk drive mapped to an image file or a physical floppy drive
Up to 6 SATA devices
Hard disk drive mapped to an image file (up to 5 TB each)
CD/DVD-ROM drive mapped to a physical drive or an image file
Up to 15 SCSI devices
Hard disk drive mapped to an image file (up to 5 TB each)
Generic SCSI device
Up to 16 Intel e1000 virtual network adapters.
Up to 4 serial (COM) ports mapped to a socket, a real port, or an output file
Up to 3 parallel (LPT) ports mapped to a printer, a real port, or an output file
AC'97-compatible sound card, sound recording support
Keyboard
20
Generic USB, PS/2 keyboard
Learning Parallels Cloud Server 6.0 Basics
Mouse
.pvm
.iso
Generic USB, PS/2 wheel mouse

Virtual Machine Files

A virtual machine has at least two files: a configuration file (PVS file) and a hard disk image file (HDD file). It can also have additional files: a file for each additional virtual hard disk and output files for virtual ports. By default, the virtual machines files are stored in the /var/parallels directory on the Parallels server.
The list of files related to a virtual machine is given in the table below:
File Name Description
.pvs
.sav
.mem
.hdd
.txt
A bundle that contains the virtual machine files.
A virtual machine configuration file. It defines the hardware and resources configuration of the virtual machine. The configuration file is automatically generated during the virtual machine creation.
A dump file created when you suspend the virtual machine. This file contains the state of the virtual machine and its applications at the moment the suspend was invoked.
A file containing the memory dump for the suspended virtual machine. For a running virtual machine, it is a temporary virtual memory file.
A file representing a virtual hard disk. When you create a virtual machine, you can create it with a new virtual hard disk or use an existing one. A virtual machine can have several hard disks.
An image file of a CD or DVD disc. Virtual machines treat ISO images as real CD/DVD discs.
Output files for serial and parallel ports. The output .txt files are generated when a serial or parallel port connected to an output file is added to the virtual machine configuration.

Support of Virtual and Real Media

This section lists the types of disks that can be used by Parallels virtual machines and provides the information about basic operations you can perform on these disks.
Supported Types of Hard Disks
Parallels virtual machines can use only virtual hard disks image files as their hard disks.
Virtual Hard Disks
The capacity of a virtual hard disk can be set from 100 MB to 5 TB.
21
Learning Parallels Cloud Server 6.0 Basics
Virtual hard disks can be of either plain or expanding format. When you create a virtual machine in Express Windows or Typical mode (in the New Virtual Machine wizard), the disk is created in the expanding format.
Type Description
plain
expanding
A plain virtual hard disk image file has a fixed size. The size is determined when the disk is created. Plain disks can be created with the help of New Virtual Machine wizard (the Custom mode.)
An expanding virtual hard disk image file is small initially. Its size grows as you add applications and data to the virtual hard disk in the guest OS.
Split disks
A virtual disk of either format can be a single-piece disk or a split disk. A split disk is cut into 2 GB pieces and is stored as a single .hdd file.
CD/DVD Discs and Their Images
Parallels Cloud Server can access real CD/DVD discs and images of CD/DVD discs.
Parallels Cloud Server has no limitations on using multi-session CD/DVD discs. A virtual machine can play back audio CDs without any limitations on copy-protected discs.
If your server has a recordable optical drive, you can use it to burn CD or DVD discs in a virtual machine.
Parallels Cloud Server supports CD/DVD disc images in ISO, CUE, and CCD formats.
Floppy Disks and Floppy Disk Images
Parallels Cloud Server can use two types of floppy disks:
Real diskettes inserted into a real floppy disk drive that is connected to the virtual machine.
Floppy disk image files having the .fdd extension and connected to the virtual machine.
Parallels Cloud Server treats floppy disk images like real diskettes. Parallels Cloud Server supports floppy disk image files that have the .fdd extension and are 1.44 MB in size.
With Parallels Cloud Server, you can also create an image of a blank floppy using the Floppy Disk pane of the Virtual Machine Configuration dialog.
Note: Parallels Cloud Server cannot create images of real diskettes.

Parallels Cloud Server Configuration

22
Learning Parallels Cloud Server 6.0 Basics
Parallels Cloud Server allows you to configure settings for the physical server in general and for each Container in particular. Among these settings are disk and user quotas, network parameters, default file locations, sample configuration files, and other.
Parallels Cloud Server stores all OS virtualization-related configuration information in the global configuration file /etc/vz/vz.conf. It defines Container parameters like the default OS templates, disk quotas, logging, and so on. For a list of parameters constituting the global configuration file, refer to the Parallels Cloud Server 6.0 Command Line Reference Guide.
The configuration file is read when the Parallels Cloud Server software and/or Containers are started. However, many settings can also be changed on the fly by means of Parallels Cloud Server standard utilities like prlctl, with or without modifying the corresponding configuration file to keep the changes for the future.

Resource Management

Parallels Cloud Server resource management controls the amount of resources available to virtual machines and Containers. The controlled resources include such parameters as CPU power, disk space, a set of memory-related parameters. Resource management allows you to:
effectively share available physical server resources among virtual machines and Containers
guarantee Quality-of-Service in accordance with a service level agreement (SLA)
provide performance and resource isolation and protect from denial-of-service attacks
simultaneously assign and control resources for a number of virtual machines and Containers
collect usage information for system health monitoring
Resource management is much more important for Parallels Cloud Server than for a standalone server since server resource utilization in such a system is considerably higher than that in a typical system.

Understanding Licensing

To start using the Parallels Cloud Server software, you need a special license - Parallels Cloud Server license. You must install this license on your server after or when installing Parallels Cloud
Server on it. Every physical server hosting virtual machines and Containers must have its own license. Licenses are issued by Parallels and define a number of parameters in respect of your physical server. The main licensed parameters are listed below:
The number of CPUs which can be installed on the physical server. Keep in mind that each of the Dual Core and Hyperthreading processors is regarded as one CPU.
The license expiration date. Any license can be time-limited or permanent.
Parallels Cloud Server licenses have a start date, and if they are time-limited, can also have an
23
Learning Parallels Cloud Server 6.0 Basics
expiration date specified in them. You must set up your system clock correctly; otherwise, the license validation may fail.
The number of virtual machines and Containers that can simultaneously run on he physical server.
The platform and architecture with which the Parallels Cloud Server software is compatible.

Physical Server Availability Considerations

The availability of a physical server running Parallels Cloud Server is more critical than the availability of a typical PC server. Since it runs multiple virtual machines and Containers providing a number of critical services, physical server outage might be very costly. It can be as disastrous as the simultaneous outage of a number of servers running critical services.
To increase physical server availability, we suggest that you follow the recommendations below:
Use a RAID storage for critical virtual machines and Containers. Do prefer hardware RAIDs, but software mirroring RAIDs might suit too as a last resort.
Do not run any software on the server itself. Create special virtual machines and Containers where you can host necessary services such as BIND, FTPD, HTTPD, and so on. On the server, you need only the SSH daemon. Preferably, it should accept connections from a pre-defined set of IP addresses only.
Do not create users on the server itself. You can create as many users as you need in any virtual machine and Container. Remember: compromising the server means compromising all virtual machines and Containers as well.
24
Performing Virtual Machine-Specific Operations ...................................................... 65
C
HAPTER
3

Managing Virtual Machines and Containers

This chapter describes how to perform day-to-day operations on virtual machines and Containers.
Note: We assume that you have successfully installed, configured, and deployed your Parallels Cloud Server system. If you have not, refer to the Parallels Cloud Server 6.0 Installation Guide for detailed information on these operations.
In This Chapter
Creating Virtual Machines and Containers ............................................................... 25
Performing Initial Configuration ............................................................................... 28
Starting, Stopping, and Querying Status of Virtual Machines and Containers ............ 30
Listing Virtual Machines and Containers .................................................................. 31
Storing Extended Information on Virtual Machines and Containers ........................... 32
Copying Virtual Machines and Containers within Server ........................................... 32
Suspending Virtual Machines and Containers .......................................................... 34
Running Commands in Virtual Machines and Containers ......................................... 34
Deleting Virtual Machines and Containers ................................................................ 35
Viewing Detailed Information About Virtual Machines and Containers ....................... 35
Managing Virtual Machine and Container Backups .................................................. 37
Managing Templates .............................................................................................. 44
Managing Snapshots .............................................................................................. 46
Migrating Virtual Machines and Containers .............................................................. 49
Performing Container-Specific Operations ............................................................... 62

Creating Virtual Machines and Containers

This section explains how to create new Parallels virtual machines and Containers. The options you should pass to this command differ depending on whether you want to create a virtual machine or Container.
Creating a Container
To create a Container, use the prlctl create command. The following parameters are required:
Managing Virtual Machines and Containers
Argument Description
prlctl create
Container name
OS template name
Type of virtual server
Name to assign to the Container. A name may contain digits and letters.
When using digits only, start with numbers greater than 100 (101, 102, etc.).
The name of the OS template to base your Container on. Parallels Cloud Server is shipped with a number of ready-to-use OS templates. To find out the names of the available templates, use the vzpkg list -O command.
For the list of operating systems you can run in your Virtual Machines and Containers, see Supported Guest Operating Systems (p. 27).
Tells the
command to create a Container.
Thus, for example, you can create a new Container by executing the following command:
# prlctl create 101 --ostemplate centos-6-x86 --vmtype ct
In this case Parallels Cloud Server creates a new Container with the name of 101 and the CentOS operating system installed inside. All Container contents will be stored in its private area. To find out where the Container private area is located, use the prlctl list command as follows:
# prlctl list 101 -i | grep "Home"
Home: /vz/private/101
Notes:
1. For more information on options you can pass to prlctl create when creating Containers, see the Parallels Cloud Server 6.0 Command Line Reference Guide.
2. For information on creating Containers with preinstalled applications, see Using OS Template Caches
with Preinstalled Applications (p. 170).
Creating a Virtual Machine
The process of creating a new virtual machine includes the following steps:
1 Creating a virtual machine configuration.
2 Installing an operating system in the virtual machine.
3 Installing Parallels Tools in the virtual machine, a set of special utilities that facilitate your work
with virtual machines.
The example below shows you how to make a new virtual machine configuration using the prlctl create command:
# prlctl create MyVM --distribution win-2008 --vmtype vm
This creates a virtual machine with the name of MyVM, adjusts its configuration for installing the Windows Server 2008 operating system in it, and places all virtual machine-related files in the /var/parallels directory.
Once the virtual machine configuration is ready, you can install Windows Server 2008 and Parallels Tools in it. To do this, you can
26
Managing Virtual Machines and Containers
Use the Parallels Virtual Automation application. For details on using this application, consult the Parallels Virtual Automation Administrator's Guide.
Enable VNC support in the virtual machine configuration and install the operating system and Parallels Tools using your favorite VNC client. For information, on configuring VNC support in virtual machines, see Enabling VNC Access to Virtual Machines and Containers (p. 178).
Note: For more information on options you can pass to prlctl create when creating virtual machines, see the Parallels Cloud Server 6.0 Command Line Reference Guide.

Supported Guest Operating Systems

Listed below are the operating systems that have been tested in virtual machines and Containers and are officially supported in Parallels Cloud Server 6.0.
Virtual Machines
Windows
Windows 8 (x64)
Windows 7 with Service Pack 1 (x86, x64)
Windows Server 2012
Windows Server 2008 R2 with Service Pack 1 (x64)
Windows Server 2003 R2 with Service Pack 2 (x86, x64)
Windows XP Professional with Service Pack 2 (x64) and Service Pack 3 (x86)
Linux
Red Hat Enterprise Linux 6.x (x86, x64)
Red Hat Enterprise Linux 5.x (x86, x64)
Fedora 17 (x86, x64)
Fedora 16 (x86, x64)
CentOS 6.x (x86, x64)
CentOS 5.x (x86, x64)
SUSE Linux Enterprise Server 11 with Service Pack 2 (x86, x64)
SUSE Linux Enterprise Server 10 (x86, x64)
openSUSE 12.x (x86, x64)
Debian GNU/Linux 6.0 (x86, x64)
Ubuntu 12.10 (x86, x64)
Ubuntu 11.10 (x86, x64)
Ubuntu Server 12.04 (x86, x64)
Ubuntu Server 10.04 (x86, x64)
FreeBSD
FreeBSD 9 (x86, x64)
27
Managing Virtual Machines and Containers
Containers
Red Hat Enterprise Linux 6.x (x86, x64)
Red Hat Enterprise Linux 5.x (x86, x64)
Fedora 17 (x86, x64)
Fedora 16 (x86, x64)
CentOS 6.x (x86, x64)
CentOS 5.x (x86, x64)
SUSE Linux Enterprise Server 11 with Service Pack 2 (x86, x64)
openSUSE 12.1 (x86, x64)
openSUSE 11.4 (x86, x64)
Debian GNU/Linux 6.0 (x86, x64)
Ubuntu 12.10 (x86, x64)
Ubuntu 12.04 (x86, x64)
Ubuntu 11.10 (x86, x64)
Ubuntu 10.04 (x86, x64)

Choosing OS EZ Template

Before starting to create a Container, you shall decide on which OS EZ template your Container will be based. There might be several OS EZ templates installed on the server and prepared for the Container creation; use the vzpkg list command to find out what OS EZ templates are available on your system:
# vzpkg list -O
centos-6-x86 centos-6-x86_64 2012-05-10 13:16:43
Using the -O option with the vzpkg list command, you can list only the OS EZ templates installed on the server. The time next to an OS EZ template indicates when the template was cached.
You can also use the --with-summary option to display brief information on the installed OS EZ templates:
# vzpkg list -O --with-summary
centos-6-x86 :CentOS 6 EZ OS template centos-6-x86_64 :CentOS 6 (for AMD64/Intel EM64T) EZ OS Template
For detailed information on the vzpkg list command, consult the Parallels Cloud Server 6.0 Command Line Reference Guide.

Performing Initial Configuration

28
Managing Virtual Machines and Containers
Before starting your newly created virtual machine and Container, you first need to configure it. This section describes the main configuration steps for virtual machines and Containers.

Configuring Network Settings

To make virtual machines and Containers accessible from the network, you need to assign valid IP addresses to them and configure DNS servers. The session below illustrates setting these parameters for the MyVM virtual machine and Container 101:
Assigning IPv4 and IPv6 addresses:
# prlctl set MyVM --device-set net0 --ipadd 10.0.186.100/24 # prlctl set MyVM --device-set net0 --ipadd 1fe80::20c:29ff:fe01:fb07 # prlctl set 101 --ipadd 10.0.186.101/24 # prlctl set 101 --ipadd fe80::20c:29ff:fe01:fb08
net0 in the commands above denotes the network card in the VM virtual machine to assign the IP address to. You can view all network cards of a virtual machine using the prlctl list VM_name -i command.
Setting DNS server addresses:
# prlctl set MyVM --nameserver 192.168.1.165 # prlctl set 101 --nameserver 192.168.1.165
Notes:
1. You can configure the network settings only for virtual machines that have Parallels Tools installed.
2. To assign network masks to Containers operating in the venet0 network mode, you must set the USE_VENET_MASK parameter in the /etc/vz/vz.conf configuration file to yes.

Setting Passwords for Virtual Machines and Containers

In Parallels Cloud Server, you can use the --userpasswd option of the prlctl set command to create new accounts in your virtual machines and Containers directly from the Parallels server. The created account can then be used to log in to the virtual machine and Container. The easiest way of doing it is to run this command:
# prlctl set MyVM --userpasswd user1:2wsx123qwe
This command creates the user1 account in the MyVM virtual machine and sets the 2wsx123qwe password for it. Now you can log in to the MyVM virtual machine as user1 and administer it in the same way you would administer a standalone server: install additional software, add users, set up services, and so on.
The prlctl set command can also be used to change passwords for existing accounts in your virtual machines and Containers. For example, to change the password for user1 in the MyVM virtual machine to 0pi65jh9, run this command:
# prlctl set MyVM --userpasswd user1:0pi65jh9
When setting passwords for virtual machines and Containers, keep in mind the following:
29
Managing Virtual Machines and Containers
You can use manage user accounts only inside virtual machines that have Parallels Tools installed.
You should use passwords that meet the minimum length and complexity requirements of the respective operating system. For example, for Windows Server 2008, a password must be more than six characters in length and contain characters from three of the following categories: uppercase characters, lowercase characters, digits, and non-alphabetic characters.
You should not create accounts with empty passwords for virtual machines and Containers running Linux operating systems.

Setting Startup Parameters

The prlctl set command allows you to define the onboot startup parameter for virtual machines and Containers. Setting this parameter to yes makes your virtual machine and Container automatically boot at the physical server startup. For example, to enable Container 101 and the MyVM virtual machine to automatically start on your server boot, you can execute the following commands:
For Container 101:
# prlctl set 101 --onboot yes
For the MyVM virtual machine:
# prlctl set MyVM --onboot yes
Notice that the onboot parameter will have effect only on the next server startup.

Starting, Stopping, and Querying Status of Virtual Machines and Containers

After a virtual machine and Container has been created, it can be managed like a usual computer.
Starting Virtual Machines and Containers
You can use the prlctl start command to start your virtual machines and Containers:
To start Container 101:
# prlctl start 101
To start a virtual machine with the name of MyVM:
# prlctl start MyVM
Stopping Virtual Machines and Containers
The prlctl stop command is used to stop your virtual machines and Containers:
To stop Container 101:
30
Managing Virtual Machines and Containers
# prlctl stop 101
To stop a virtual machine with the name of MyVM:
# prlctl stop MyVM
Checking Status of Virtual Machines and Containers
To check the status of a Container or a virtual machine, use the prlctl status command:
To get to know the status of Container 101:
# prlctl status 101
VEID 101 exists mounted running
To get to know the status of the MyVM virtual machine:
# prlctl status MyVM
Vm MyVM exists stopped
Restarting Virtual Machines and Containers
To restart a virtual machine and Container. To do this, use the prlctl restart command:
To restart a Container:
# prlctl restart 101
To restart a virtual machine:
# prlctl restart MyVM

Listing Virtual Machines and Containers

To get an overview of the virtual machines and Containers existing on the physical server and to get additional information about them — their IP addresses, hostnames, current resource consumption, and so on — use the prlctl list command. In the most general case, you can get a list of all virtual machines and Containers by issuing the following command:
# prlctl list -a
UUID STATUS IP_ADDR T NAME {600adc12-0e39-41b3-bf05-c59b7d26dd73} running 10.10.1.101 CT 101 {b2de86d9-6539-4ccc-9120-928b33ed31b9} stopped 10.10.100.1 VM MyVM
The -a option tells the prlctl list command to output both running and stopped virtual machines and Containers. By default, only running virtual machines and Containers are shown. The default columns inform you of the Container IDs and virtual machine names, the virtual machine and Container status, type, IP addresses, and unique identifiers. This output can be customized as desired by using prlctl list command line options. For example:
# prlctl list -a -o name,ctid
NAME ID 101 101 MyVm {b8cb6d99-1af1-453d-a302-2fddd8f86769}
This command displays only the names of existing virtual machines and Containers and the IP addresses assigned to them. The full list of the prlctl list command-line options for virtual machines and Containers is available in the Parallels Cloud Server 6.0 Command Line Reference Guide.
31
Managing Virtual Machines and Containers

Storing Extended Information on Virtual Machines and Containers

Sometimes, it may be difficult to remember the information on certain virtual machines and Containers. The probability of this increases together with the number of virtual machines and Containers and with the time elapsed since their creation. Parallels Cloud Server allows you to set the description of any virtual machine and Container on the physical server and view it later on, if required. The description can be any text containing any virtual machine and Container-related information. For example, you can include the following in the virtual machine and Container description:
the owner of the virtual machine and Container
the purpose of the virtual machine and Container
the summary description of the virtual machine and Container
Let us assume that you are asked to create a virtual machine for a Mr. Johnson who is going to use it for hosting the MySQL server. So, you create the MyVM virtual machine and, after that, execute the following command on the physical server:
# prlctl set MyVM --description "MyVM > owner - Mr. Johnson > purpose - hosting the MySQL server" -
The VM has been successfully configured.
This command saves the following information related to the virtual machine: its name, owner, and the purpose of its creation. At any time, you can display this information by issuing the following command:
# prlctl list -o description MyVM
MyVM owner - Mr. Johnson purpose - hosting the MySQL server
When working with virtual machine and Container descriptions, keep in mind the following:
You can use any symbols you like in the virtual machine and Container description (new lines, dashes, underscores, spaces, etc.).
If the virtual machine and Container description contains one or more spaces or line breaks (as in the example above), it must be put in single or double quotes.
As distinct from a virtual machine and Container name and ID, a description cannot be used for performing virtual machine and Container-related operations (e.g., for starting or stopping a virtual machine and Container) and is meant for reference purposes only.

Copying Virtual Machines and Containers within Server

32
Managing Virtual Machines and Containers
You can create a complete copy of a particular virtual machine and Container (in respect of all the virtual machine and Container data and resources parameters), or a clone. This saves your time because you do not have to think of setting up the virtual machine and Container configuration parameters and the like. Moreover, you can create a number of clones at a sitting.
In Parallels Cloud Server, you can use the prlctl clone command to copy a virtual machine and Container within the given physical server. To clone a Container or a virtual machine, it must be stopped. For example, you can create a clone of Container 101 and the MyVM virtual machine by running these commands:
# prlctl clone 101 --name 111 # prlctl clone MyVM --name ClonedVM
The --name option specifies which ID or name should be assigned to the new clones.
Checking the Cloned Virtual Machine and Container
To check that your virtual machine and Container has been successfully moved, run this command:
# prlctl list -a
UUID STATUS IP_ADDR T NAME {62951c2a-...} stopped 10.0.10.101 CT 101 {49b66605-...} stopped 10.0.10.101 CT 111 {7f4904ad-...} stopped 10.0.10.115 VM MyVM {2afb2aa2-...} stopped 10.30.128.134 VM ClonedVM
As you can see from the example above, the clones of Container 101 (Container 111) and the MyVM virtual machine (ClonedVM) have been successfully created. However, before starting to use the clones, you should assign different IP addresses to them which are currently identical to those of Container 101 and MyVM. Refer to Performing Initial Configuration (p. 28) to learn how you can do it.
Configuring Default Directories
When cloning a virtual machine and Container, you can also override the following default directories:
/var/parallels/dest_VM_Name.pvm storing the files of a cloned virtual machine (where dest_VM_Name denotes the name of the resulting virtual machine). For example, for the
ClonedVM virtual machine, this directory is /var/parallels/ClonedVM.pvm. To store the files of the ClonedVM virtual machine in a custom directory, you can run the following command:
# prlctl clone MyVM --name ClonedVM --dst /customVMs
In this case all virtual machine files will be placed to the /customVMs directory. Notice that the specified directory must exist on the server; otherwise, the command will fail.
/vz/private/<dest_CTID> defining the Container private area (where <dest_CTID> denotes the ID of the resulting Container). For Container 111, this path is /vz/private/111. To define a custom private area path for Container 111, you can execute the following command:
33
Managing Virtual Machines and Containers
# prlctl clone 101 --name 111 --dst /vz/private/customCTs
Note: The default /var/parallels and /vz/private are valid for servers that do not participate in Parallels Cloud Storage clusters. If your server is part of a cluster, consult the Parallels Cloud Storage Administrator's Guide for information on the default directories for storing virtual machines and Containers.

Suspending Virtual Machines and Containers

Parallels Cloud Server allows you to suspend a running virtual machine and Container on the physical server by saving its current state to a special file. Later on, you can resume the virtual machine and Container and get it in the same state the virtual machine and Container was at the time of its suspending. Suspending your virtual machines and Containers may prove useful, for example, if you need to restart the physical server, but do not want to:
quit the applications currently running in the virtual machine and Container
spend much time on shutting down the guest operating system and then starting it again
You can use the prlctl suspend command to save the current state of a virtual machine and Container. For example, you can issue the following command to suspend the MyVM virtual machine:
# prlctl suspend MyVM
At any time, you can resume the MyVM virtual machine by executing the following command:
# prlctl resume MyVM
Once the restoration process is complete, any applications that were running in the MyVM virtual machine at the time of its suspending will be running again and the information content will be the same as it was when the virtual machine was suspended.

Running Commands in Virtual Machines and Containers

Parallels Cloud Server allows you to execute arbitrary commands inside virtual machines and Containers by running them on the physical server, i.e. without the need to log in to the respective virtual machine and Container. For example, this can be useful in these cases:
If you do not know the virtual machine and Container login information, but need to run some diagnosis commands to verify that it is operational.
If network access is absent for a virtual machine and Container.
In both these cases, you can use the prlctl exec command to run a command inside the respective virtual machine and Container. The session below illustrates the situation when you run the stopped SSH daemon inside a Linux virtual machine with the name of My_Linux:
34
Managing Virtual Machines and Containers
# prlctl exec My_Linux /etc/init.d/sshd status
sshd is stopped
# prlctl exec My_Linux /etc/init.d/sshd start
Starting sshd:[OK]
# prlctl exec My_Linux /etc/init.d/sshd status
sshd (pid 26187) is running...
Notes:
1. You can use the prlctl exec command only inside virtual machines that have Parallels Tools installed.
2. The prlctl exec command is executed inside a virtual machine and Container from the / directory rather than from the /root one.

Deleting Virtual Machines and Containers

You can delete a virtual machine and Container that is not needed anymore using the prlctl delete command. Note that you cannot delete a running or mounted virtual machine and
Container. The example below illustrates deleting the running Container 101:
# prlctl delete 101
Deleting Container private area: /vz/private/101 Container is currently running (stop first)
# prlctl stop 101
Stopping Container... Container was stopped Container is unmounted
# prlctl delete 101
Deleting Container private area: /vz/private/101 Container private area was deleted

Viewing Detailed Information About Virtual Machines and Containers

To view detailed information about a virtual machine or Container, you can use the prlctl list
-i command. For example, the following command lists all information about the MyVM virtual
machine:
# prlctl list -i MyVM
ID: {5c1fb1bb-4364-4b42-86b2-c584bdd2223b} EnvID: 2075205468 Name: MyVM Description: State: running OS: win-7 Uptime: 21:49:55 (since 2011-05-19 12:25:19) Home: /var/parallels/MyVM.pvm/ Owner: root@. Effective owner: owner GuestTools: state=installed
35
Managing Virtual Machines and Containers
Autostart: off
server uses to refer to a virtual machine when displaying some information on
Name
Description
State
OS
Home
Guest Tools
Hardware
Autostop: shutdown Boot order: hdd0 cdrom0 fdd0 Remote display: mode=off port=6500 address=0.0.0.0 Remote display state: stopped Hardware: cpu 1 VT-x accl=high mode=32 ioprio=4 iolimit=0 memory 1024Mb video 32Mb memory_quota auto fdd0 (+) real='/dev/fd0' state=disconnected hdd0 (+) sata:0 image='/var/parallels/MyVM.pvm/MyVM-0.hdd' 65536Mb cdrom0 (+) sata:1 real='D: ' state=disconnected parallel0 (+) real='/dev/lp0' usb (+) net0 (+) dev='vme7bb11f5c.0' network='Bridged' mac=001C427B68E3 card=e1000 Host Shared Folders: (+) SmartMount: (-) VirtualUsbMouse: state=disabled Encrypted: no Offline management: (-)
The following table describes the main options displayed by prlctl list -i.
Option Description
ID
EnvID
Virtual machine identifier. Usually, you use this ID, along with the virtual machine name, when performing an operation on the virtual machine.
Kernel virtual machine identifier. This is the ID the kernel on the physical
Uptime
Autostart
Boot order
Offline management
this virtual machine.
Virtual machine name.
Virtual machine description.
Virtual machine state.
Guest operating system installed in a virtual machine.
Time that shows for how long a virtual machine has been running since counter reset.
Note: The uptime counter as well as count start date and time can be reset with the prlctl reset-uptime command.
Directory storing virtual machine files.
Shows whether Parallels Tools are installed in a virtual machine.
Shows whether a virtual machine is automatically started when you turn on the physical server.
Order in which the virtual machine devices are checked for an operating system.
Devices available in a virtual machine.
Denotes whether the offline management feature is enabled for the virtual machine, and if yes, lists the available offline services.
36
Managing Virtual Machines and Containers
Note: The options prlctl list displays for Containers are similar to those for virtual machines.

Managing Virtual Machine and Container Backups

A regular backing up of existing virtual machines and Containers is essential for any system reliability. In Parallels Cloud Server, you can use the following utilities to back up and restore your virtual machines and Containers:
prlctl
pbackup
prestore
Detailed information on these utilities is provided in the following subsections.

Backups Overview

Parallels Cloud Server backup utilities deal with three kinds of servers:
Source Server. This is the server where virtual machines and Containers are hosted during their backing up.
Backup Server. This is the server where virtual machine and Container backups are stored. A Backup Server can be any server running the Parallels Cloud Server software and having sufficient space for storing virtual machine and Container backups.
Destination Server. This is the server where virtual machine and Container backups are restored.
These servers are singled out by their functionality only. In reality, one and the same physical server can perform two or even three functions. Usually, the Source and Destination Servers are represented by one and the same server because you will likely want the virtual machines and Containers you back up to be restored to their original server. However, setting up a dedicated Backup Server is recommended.
37
Managing Virtual Machines and Containers
Creating Consistent Backups of Virtual Machines
Parallels Cloud Server allows you to back up both running and stopped virtual machines. However, to create a consistent backup of a running virtual machine, the virtual machine must meet the following requirements:
Have Parallels Tools installed.
Run one of the following operating systems:
Windows operating systems
Windows Server 2012
Windows Server 2008 R2
Windows Server 2008
Windows Server 2003
Windows 8
Windows 7
Windows XP
Linux operating systems
Red Hat Enterprise Linux 5 and 6
CentOS 5 and 6
Fedora 16 and 17
Debian 6
Ubuntu 11 and 12
SUSE Linux Enterprise Server 10
openSUSE 12

Using prlctl backup and prlctl restore

This section describes how to perform the basic backup-related operations using the prlctl utility.
Creating a Virtual Machine and Container Backup
You can use the prlctl backup command to back up virtual machines and Containers. This command is executed on the Source Server and can store the created virtual machine and Container backup on both the Source and Backup Servers. When creating a backup on the Source Server, you only need to specify the name of the virtual machine and Container to back up. For example, you can execute the following command to back up the MyVM virtual machine and store its backup archive on the Source Server:
38
Managing Virtual Machines and Containers
# prlctl backup MyVM
Backing up the VM MyVM ... The virtual machine has been successfully backed up with backup ID {746dba2a-3b10-4ced­9dd6-76a2blcl4a69}
The command output informs you that the virtual machine backup has been successfully created and assigned ID 746dba2a-3b10-4ced-9dd6-76a2blcl4a69. You can use this ID when managing the backup archive (e.g., remove the backup).
At the same time, you can run the following command to back up the MyVM virtual machine and store its backup archive on the Backup Server with the IP address of 129.129.10.10:
# prlctl backup MyVM -s root:1qaz2wsx@129.129.10.10
root:1qaz2wsx before the Destination Server IP address denotes the root credentials used to log in to this server. If you do not specify these credentials, you will be asked to do so during the command execution.
By default, all newly created backups are placed to the following directories:
/vz/backups for Containers
/var/parallels/backups for virtual machines
For Containers, you can configure the default directory by changing the value of the BACKUP_DIR parameter in the /etc/vzbackup.conf configuration file. In turn, to set the default backup directory for virtual machines, you should use the prlsrvctl set command.
Notes:
1. A Backup Server can be any server running the Parallels Cloud Server software and having sufficient space for storing virtual machine and Container backups.
2. For more information on the options you can pass to prlctl backup, refer to the Parallels Cloud Server 6.0 Command Line Reference Guide.
Listing the Existing Backups
You can use the prlctl backup-list command to view the backups existing on the physical server. For example:
# prlctl backup-list
ID Backup_ID Node Date Type Size {c1dee22f...} {209d54a0...} test.com 2011-05-30 10:19:32 f 411566405 [The ID and Backup ID are reduced for better readability.]
This command lists the backups existing on the Source Server. If you want to list the backups on the Backup Server, you need to specify the IP address of this server.
The command output shows that currently only one backup exists on the Source Server. This backup was assigned the ID of c1dee22f-8667-4870-9e11-278f1398eab0 (the full ID is skipped in the command output). The information on the backup is presented in the following table:
39
Managing Virtual Machines and Containers
Column Description
ID
Node
Date
and containing only the files changed
Size
Backup ID
Type
The ID uniquely identifying the virtual machine and Container.
The ID assigned to the backup archive. You need to specify this ID when performing any backup-related operations.
The hostname of the physical server storing the backup archive.
The date and time when the backup archive was created.
The backup type. Currently, you can create two types of backups:
A full backup indicated by f.
An incremental backup indicated by i
since the previous full or incremental backup. This is the default backup type.
The size of the backup archive, in bytes.
Removing a Virtual Machine and Container Backup
At any time, you can remove a backup that you do not need any more using the prlctl backup-delete command. To do this, you need to specify the ID of the backup to remove and
the ID of the respective virtual machine and Container. If you do not know these IDs, use the prlctl backup-list and check the ID and Backup ID columns. For example:
# prlctl backup-list
ID Backup_ID Node Date Type Size {c1dee22f...} {209d54a0...} test.com 2011-05-30 10:19:32 f 411566405 [The ID and Backup ID are reduced for better readability.]
# prlctl backup-delete c1dee22f-8667-4870-9e11-278f1398eab0 -t 209d54a0-e3b8-4a03-9ca8­d4cc7a2a27ca
Delete the VM backup The VM backup has been successfully removed.
You can also specify the virtual machine and Container name instead of its ID:
# prlctl backup-delete MyVM -t 209d54a0-e3b8-4a03-9ca8-d4cc7a2a27ca
If you have several backups of a particular virtual machine and Container and want to delete them all at once, indicate only the virtual machine and Container name or ID:
# prlctl backup-delete MyVM
This command removes all backups of the MyVM virtual machine from the local Backup Server. To remove backups stored remotely, you also need to specify the IP address of the remote Server:
# prlctl backup-delete MyVM -s root:1qaz2wsx@129.129.10.10
Restore a Virtual Machine and Container
To restore a backup of a virtual machine and Container, you can use the prlctl restore command. This command supports restoring backups to the Source Server only. For example, to restore a backup of the MyVM virtual machine stored on the Backup Server with the IP address of
10.10.100.1, you can run this command on the Source Node:
# prlctl restore MyVM -s root:1qaz2wsx@10.10.100.1
40
Managing Virtual Machines and Containers
If you have two or more backups of the MyVM virtual machine, the latest backup is restored. If you want to restore a particular virtual machine and Container backup, you need to specify the ID of this backup. You can use the prlctl backup-list command to list the existing backups and the IDs assigned to them:
# prlctl backup-list -s root:1qaz2wsx@10.10.100.1
ID Backup_ID Node Date Type Size {c1dee22f...} {209d54a0...} test.com 2011-05-30 10:19:32 i 11566405 {c1dee22f...} {24a3011c...} test.com 2011-05-21 11:12:35 f 356798701 [The ID and Backup ID are reduced for better readability.]
You can now indicate the desired ID after the -t option to tell prlctl backup to restore this particular backup. For example, to restore the backup for the virtual machine with the ID of c1dee22f-8667-4870-9e11-278f1398eab0 that was created on the 21st of May, you can execute this command:
# prlctl restore -t {24a3011c-8667-4870-9e11-278f1398eab0} -s root:1qaz2wsx@10.10.100.1
Note: Virtual machines created on servers running Parallels Cloud Server 6.0 cannot be restored on servers with Parallels Server 4 Bare Metal.

Using pbackup and prestore

Along with prlctl, you can use the following utilities to create and manage backups of your virtual machines and Containers:
pbackup. This utility is used to create backups of individual virtual machines and Containers or entire Parallels servers.
prestore. This utility is used to manage the existing backups of virtual machines and Containers.
Backing Up Virtual Machines and Containers
The pbackup utility is run on the Backup Server connecting via SSH to the Parallels server and backing up one or more virtual machines and Containers on this server. By default, the created Container backups are placed to the /vz/backups directory and the backups of virtual machines are put to the /var/parallels/backups directory. You can change the default backup directories
for Containers, by editing the /etc/vzbackup.conf file
for virtual machines, by using the --backup-path option of the prlsrvctl set command
Let us assume that you want to back up the entire Parallels server (that is, all virtual machines and Containers on this server) with the test.com hostname. In this case, you can run the following command on the Backup Server:
# pbackup test.com
During the command execution, you will be asked to provide the test.com credentials. After doing so, the command will back up all virtual machines and Containers on the test.com and put
41
Managing Virtual Machines and Containers
all backed up Containers to the Backup Server
all backed up virtual machines to the Source Server
To save the backed up virtual machines also on the Backup Server, you should additionally specify the -n option. This option is used to indicate the IP address or hostname of the Backup Server and its credentials:
# pbackup -n root:7ujn6yhb@192.168.10.199 test.com
If you wish to back up not all, but specific virtual machines and Containers from the specified server, use the –e or –x switches (to include or exclude the specified virtual machines and Containers, respectively). For example:
# pbackup -n root:7ujn6yhb@192.168.10.199 test.com -e 101 MyVM
In this session, only Container 101 and the MyVM virtual machine residing on the Source Server with the test.com hostname will be included in the backup, and their backups will be stored on the Backup Server.
Notes:
1. A Backup Server can be any server running the Parallels Cloud Server software and having sufficient space for storing virtual machine and Container backups.
2. For the full list of configuration parameters and command line options for pbackup, consult the Parallels Cloud Server 6.0 Command Line Reference Guide.
Restoring Backups
To restore any individual virtual machines and Containers or entire Parallels servers, you may want to view first the information about them. This can be done using the prestore -l command:
# prestore -l -n test.com test.com
root@test.com's password: ... Backups for node test.com: ID Backup_ID Node Date Type Size 101 2011-05-... test.com 2012-05-30 09:42:19 f 18721280 {cd91b90b...} {4ef87485...} test.com 2012-05-16 17:15:47 f 92617398 [The ID and Backup ID are reduced for better readability.]
The command output shows that currently only two backups exist for the test.com server on the Backup Server. If you omit the -n test.com option, the command will list:
all Container backups for the test.com server stored on the Backup Server
all virtual machine backups for the test.com server stored on the test.com server
42
Managing Virtual Machines and Containers
The information on the backups is presented in the following table:
ID
Node
Date
and containing only the files changed
Size
Column Description
Backup ID
Type
The ID uniquely identifying the virtual machine and Container.
The ID assigned to the backup archive. You need to specify this ID when performing any backup-related operations.
The hostname of the Source Server.
The date and time when the backup archive was created.
The backup type. Currently, you can create two types of backups:
A full backup indicated by f.
An incremental backup indicated by i
since the previous full or incremental backup. This is the default backup type.
The size of the backup archive, in bytes.
To restore Container 101 and the {cd91b90b-469d-42c6-acf4-fefee09cfa61} virtual machine, run this command:
# prestore -n test.com -e 101 {cd91b90b-469d-42c6-acf4-fefee09cfa61}
This command will restore the Container and the virtual machine to their Source Server.
You can also use the -d option to restore Container 101 to a Parallels server other than the Source Node. For example, this command
# prestore -d 192.168.10.199 test.com -e 101
restores Container 101 to the Destination Server with IP address 192.168.10.199. If you want to restore all Containers backups for the test.com Parallels server, just skip the -e option.
Notes:
1. The current version of Parallels Cloud Server supports restoring virtual machines to the Source Server only.
2. The prestore utility can also manage (list, restore, etc.) backups created using the prlctl backup command. However, you are highly recommended to use the same utility (either prlctl or prestore) during the life cycle of a particular backup.
3. For the full list of command line options for prestore, refer to the Parallels Cloud Server 6.0 Command Line Reference Guide.
Configuring Passwordless Access to the Source Node
You need to provide the Source Node credentials each time you execute the pbackup and prestore commands. However, you can allow these utilities to log in to the Source Node without
having to enter the root password. To do this, you need to provide each Source Node with authorized public SSH RSA keys:
43
Managing Virtual Machines and Containers
1 Log in to the Backup Server as root, and generate a pair of SSH keys - public and private:
# ssh-keygen -t rsa
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: c6:19:a8:2c:67:31:15:e6:30:23:2b:8a:b0:63:77:8f root@dhcp-130.parallels.com
Note that you must leave an empty passphrase in the above procedure. The private key is saved by default in /root/.ssh/id_rsa, and the public key is saved in /root/.ssh/id_rsa.pub.
2 Transfer your public key to the /root/.ssh directory on each Source Node (use some
intermediary name for the file not to overwrite the corresponding file on the Source Node):
# scp /root/.ssh/id_rsa.pub root@dhcp-129.parallels.com:/root/.ssh/temp_name
The authenticity of host 'dhcp-129.parallels.com (192.168.1.129)' can't be established. RSA key fingerprint is 01:fc:b6:e9:26:40:1f:1a:41:5f:7a:fb:cf:14:51. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'dhcp-129.parallels.com,192.168.1.129' (RSA) to the list of known hosts. root@dhcp-129.parallels.com's password: id_rsa.pub 100% |*****************************| 235 00:00
3 Add the contents of the transferred file to the authorized_keys file in this very directory on
the Source Node. To do this, log in to the Source Node, change to the /root/.ssh directory, and issue the following command:
# cat temp_name >> authorized_keys
Now the pbackup/prestore utilities should be able to log in to the Source Node as root without having to provide the root password.

Managing Templates

A template in Parallels Cloud Server is a pre-configured virtual machine or Container that can be easily and quickly deployed into a fully functional virtual machine or Container. Like any normal virtual machine or Container, a template contains hardware (virtual disks, peripheral devices) and the operating system. It can also have additional software installed. In fact, the only main difference between a virtual machine or Container and a template is that the latter cannot be started.
In Parallels Cloud Server, you can perform the following operations on templates:
create a new template
list the existing templates
create a virtual machine or Container from a template
These operations are described in the following subsections in detail.
44
Managing Virtual Machines and Containers

Creating Templates

In Parallels Cloud Server, you can create a template using the prlctl clone utility. Making a template may prove useful if you need to create several virtual machine or Container with the same configuration. In this case, your steps can be as follows:
1 You create a virtual machine or Container with the required configuration.
2 You make a template on the basis of the created virtual machine or Container.
3 You use the template to create as many virtual machine or Container as necessary.
Let us assume that you want to create a template of the MyVM virtual machine. To do this, you can run the following command:
# prlctl clone MyVM --name template1 --template
This command clones the MyVM virtual machine and saves it as the template1 template. After the template has been successfully created, you can use it for creating new virtual machines.

Listing Templates

Sometimes, you may need to get an overview of the templates available on your Parallels server. For example, this may be necessary if you plan to create a virtual machine or Container from a specific template, but do not remember its exact name. In this case, you can use the prlctl list command to list all templates on the Parallels server and find the necessary one:
# prlctl list -t
{4ad11c28-9f0e-4086-84ea-9c0487644026} win-2008 template1 {64bd8fea-6047-45bb-a144-7d4bba49c849} rhel template3 {6d3c9d6f-921a-484d-9772-bc7096f68df1} win-2008 template2
In this example, 3 templates exist on the server. The information on these templates is presented in the form of a table with the following columns (from left to right): the template ID, the operating system contained in the template, and the template name.

Deploying Templates

To convert a template into a virtual machine or Container, use the --ostemplate option of the prlctl create command. For example, to convert the template1 template to a virtual machine with the ConvertedVM name, you can run this command:
# prlctl create ConvertedVM --ostemplate template1
To check that the ConvertedVM virtual machine has been successfully created, use the prlctl list -a command:
# prlctl list -a
STATUS IP_ADDR NAME running 10.12.12.101 111 stopped 10.12.12.34 Converted_VM running 10.30.17.149 Windows7
45
Managing Virtual Machines and Containers
The template itself is left intact and can be used for creating other virtual machines:
# prlctl list -t
{4ad11c28-9f0e-4086-84ea-9c0487644026} win-2008 template1 {64bd8fea-6047-45bb-a144-7d4bba49c849} rhel template2

Managing Snapshots

In Parallels Cloud Server, you can save the current state of a virtual machine or Container by creating a snapshot. You can then continue working in your virtual machine or Container and return to the saved state any time you wish. Snapshots may be useful in the following cases:
Configuring applications with a lot of settings. You may wish to check how settings work before applying them to the application. So, before you start experimenting, you create a snapshot.
Participating in large-scale development projects. You may wish to mark development milestones by creating a snapshot for each. If anything goes wrong, you can easily revert to the previous milestone and resume the development.
In Parallels Cloud Server, you can create, list, revert to, and delete snapshots. These operations are described in the following subsections.

Creating Snapshots

To create a snapshot of a virtual machine or Container, use the prlctl snapshot command.
Creating Virtual Machine Snapshots
To create a snapshot of the virtual machine MyVM, do the following:
# prlctl snapshot MyVM
... The snapshot with ID {12w32198-3e30-936e-a0bbc104bd20} has been successfully created.
A newly created snapshot is saved to the /vz/VM_Name.pvm/Snapshots/Snapshot_ID.pvs file, where VM_Name is the corresponding virtual machine name and Snapshot_ID is a unique snapshot ID. In the above example, the snapshot with ID {12w32198-3e30-936e-
a0bbc104bd20} is saved to the file /vz/MyVM/Snapshots/{12w32198-3e30-936e­a0bbc104bd20}.pvs.
# ls /vz/MyVM.pvm/Snapshots/
{063615fa-f2a0-4c14-92d4-4c935df15840}.pvc
Snapshot IDs are needed to switch to and delete snapshots.
When creating a snapshot, you can also set its name and description:
# prlctl snapshot MyVM -n Clean_System -d "This snapshot was created right after installing Windows XP."
... The snapshot with ID {0i8798uy-1eo0-786d-nn9ic106b9ik} has been successfully created.
46
Managing Virtual Machines and Containers
You can then view the set name and description in the /vz/MyVM/Snapshots.xml file.
Creating Container Snapshots
To create a snapshot of Container 101, do the following:
# prlctl snapshot 101
... The snapshot with ID {08ddd014-7d57-4b19-9a82-15940f38e7f0} has been successfully created.
A newly created snapshot is saved to the /vz/private/<CT_ID>/dump/<snapshot_ID> file, where <CT_ID> is the Container ID and <snapshot_ID> is a snapshot ID. In the above example above, the snapshot with ID {08ddd014-7d57-4b19-9a82-15940f38e7f0} is saved to the file /vz/private/101/dump/{08ddd014-7d57-4b19-9a82-15940f38e7f0}.
# ls /vz/private/101/dump
{08ddd014-7d57-4b19-9a82-15940f38e7f0}
Snapshot IDs are needed to switch to and delete snapshots.
When creating a snapshot, you can also set its name and description:
# prlctl snapshot 101 --n Clean_System --d "This snapshot was created right after installing Windows XP."
... The snapshot with ID {e78bb2b8-7a99-4c8b-ab9a-491a47648c44} has been successfully created.
The set name and description are stored in the /vz/private/<CT_ID>/Snapshots.xml file.
Snapshot Branching
Snapshot branches can be useful for working with, testing or comparing similar configurations. A snapshot branch is created when you do the following:
1 Create several snapshots.
2 Revert to one of the snapshots.
3 Make changes to the virtual machine or Container.
4 Create a snapshot.
In this case, the newly created snapshot will start a new branch based on the snapshot from Step
2.
Restrictions and Recommendations
Virtual machine and snapshot names and snapshot descriptions containing spaces must be enclosed in quotation marks (e.g., "Windows XP") when supplying them to the prlctl command.
Before creating a snapshot, it is recommended that you finish any installations, downloads, and stop writing to external devices. You should also complete or cancel any transactions
47
Managing Virtual Machines and Containers
performed via the virtual machine in external databases.
ID
Name
Date
Current
State
Description

Listing Snapshots

To list all snapshots of a particular virtual machine or Container, use the prlctl snapshot­list command. For example, to check all current snapshots of the MyVM virtual machine, run this
command:
# prlctl snapshot-list MyVM
PARENT_SNAPSHOT_ID SNAPSHOT_ID {989f3415-3e30-4494-936e-a0bbc104bd20} {989f3415-3e30-4494-936e-a0bbc104bd20} *{063615fa-f2a0-4c14-92d4-4c935df15840}
This command shows that the MyVM virtual machine has two snapshots. The snapshot with ID {063615fa-f2a0-4c14-92d4-4c935df15840} is based on the snapshot with ID {989f3415-3e30-4494-936e-a0bbc104bd20}, i.e. the former is a child of the latter. The
asterisk marks the current snapshot.
To view the relationships between snapshots, use the -t option:
# prlctl snapshot-list MyVM -t
_{989f3415-3e30-4494-936e-a0bbc104bd20}_{063615fa-f2a0-4c14-92d4­4c935df15840}*{712305b0-3742-4ecc-9ef1-9f1e345d0ab8}
The command output shows you that currently two branches exist for the MyVM virtual machine. The snapshot with ID {989f3415-3e30-4494-936e-a0bbc104bd20} is the base for these branches.
To get detailed information on a particular snapshot, use the -i option with the snapshot ID:
# prlctl snapshot-list MyVM -i {063615fa-f2a0-4c14-92d4-4c935df15840}
ID: {063615fa-f2a0-4c14-92d4-4c935df15840} Name: Clean_System Date: 2012-07-22 22:39:06 Current: yes State: poweroff Description: <![CDATA[This snapshot was created right after installing Windows 7]]>
The prlctl snapshot-list command with the -i option displays the following information about snapshots:
Field Description
ID assigned to the snapshot.
Name assigned to the snapshot.
Date and time when the snapshot was created.
Denotes that this is the current snapshot of the virtual machine.
State the virtual machine was in at the time you took the snapshot.
The description set for the snapshot.
48
Managing Virtual Machines and Containers

Reverting to Snapshots

To revert to a snapshot, use the prlctl snapshot-switch command. When you revert to a snapshot, the current state of the virtual machine or Container is discarded, and all changes made to the system since the previous snapshot are lost. So, before reverting, you may want to save the current state by creating a new snapshot (see Creating Snapshots (p. 46)).
The prlctl snapshot-switch command requires the virtual machine or Container ID and the snapshot ID as arguments, for example:
# prlctl snapshot-switch MyVM --id {cedbc4eb-dee7-42e2-9674-89d1d7331a2d}
In this example, you revert to the snapshot {cedbc4eb-dee7-42e2-9674-89d1d7331a2d} for the virtual machine MyVM.

Deleting Snapshots

To delete unneeded snapshots of virtual machines or Containers, use the prlctl snapshot­delete command. For example:
# prlctl snapshot-delete MyVM --id {903c12ea-f6e6-437a-a2f0-a1d02eed4f7e}
When you delete a parent snapshot, child snapshots are not deleted, and the information from the former is merged into the latter.

Migrating Virtual Machines and Containers

The Parallels physical server is the system with higher availability requirements in comparison with a typical system. If you are running your company mail server, file server, and web server in different virtual machines and Containers on one and the same physical server, then shutting it down for hardware upgrade will make all these services unavailable at once. To facilitate hardware upgrades and load balancing between several Parallels servers, the Parallels Cloud Server software provides you with the ability to migrate virtual machines and Containers from one physical server to another.
Parallels Cloud Server is shipped with a special utility—pmigrateallowing you to perform different types of migration. Using this utility, you can migrate
Containers from one physical server to another
Parallels virtual machines from one physical server to another
a Container to a Parallels virtual machine
a Parallels virtual machine to a Container
a physical server to a virtual machine and Container
Xen virtual machines to Parallels virtual machines
All these operations are described in the following subsections.
49
Managing Virtual Machines and Containers

General Migration Requirements

Before deciding on the type of migration to perform, make sure that the source computer (i.e. the computer that you will migrate or that stores the virtual machine and Container before its migration) and the destination computer (i.e. the computer that runs Parallels Cloud Server and that will host the resulting virtual machine and Container) meet the requirements below.
Source computer requirements
The source computer can be a physical computer, a virtual machine, or a Container. The software requirements for source computers are given in the following table:
Operating System Physical Computers Virtual Machines Containers
Windows
Windows 8 (x32, x64) + + -
Windows 7 (x32, x64) + + -
Windows Server 2012 (x64) + + -
Windows Server 2008 R2 (x64) + + -
Windows Server 2003 (x32, x64) + + +
Windows Server 2008 (x32, x64) + + +
Windows XP (x32, x64) + + -
Linux
Red Hat Enterprise Linux 6 (x32, x64) + + +
Red Hat Enterprise Linux 5 (x32, x64) + + +
CentOS 6 (x32, x64) + + +
CentOS 5 (x32, x64) + + +
Fedora 17 (x32, x64) + + +
Fedora 16 (x32, x64) + + +
SUSE Linux Enterprise Server 11 (x86, x64)
SUSE Linux Enterprise Server 10 (x32, x64)
+ - +
+ + -
openSUSE 12.2 (x86, x64 + + -
openSUSE 12.1 (x86, x64) + - +
openSUSE 11.4 (x86, x64) + - +
Debian GNU/Linux 6 (x32, x64) + + +
Ubuntu 12.10 (x86, x64) + + +
Ubuntu 12.04 (x86, x64) + - +
Ubuntu 11.10 (x86, x64) + + +
50
Managing Virtual Machines and Containers
Ubuntu Linux 10.04 Server (x32, x64) + + +
Ubuntu Server 12.04 (x86, x64) + + -
Ubuntu Server 10.04 (x86, x64) + + -
Destination server requirements
The destination server must meet the following requirements:
Has enough hard disk space to store the resulting virtual machine and Container.
Has enough memory and CPU power to run the resulting virtual machine and Container.
Has a stable network connection with the source server.

Migrating Virtual Machines and Containers Between Parallels Servers

In Parallels Cloud Server, you can choose one of the following ways to migrate virtual machines and Containers:
Migrating virtual machines and Containers using the standard migration technology.
Migrating virtual machines and Containers using the zero-downtime migration technology.
Both ways of migrating virtual machines and Containers are described in the following subsections in detail.
Standard Migration
Using the standard migration technology, you can move
stopped, running, and suspended Containers
stopped and suspended virtual machines
Standard migration includes copying all files of a virtual machine or Container from one Parallels server to another and does not differ from copying a number of files from one server to another over the network. For a running Container, the migration procedure is a bit more complicated and is described below:
1 Once you start the migration, all Container data are copied to the destination server. During this
time, the Container on the source server continues running.
2 The Container on the source server is stopped.
3 The Container data copied to the destination server are compared with those on the source
server, and if any files were changed during the first migration step, they are copied to the destination server again and rewrite the outdated versions.
4 The Container on the destination server is started.
There is a short downtime needed to stop the Container on the source server, copy the changed data to the destination server, and start the Container on the destination server.
51
Managing Virtual Machines and Containers
Migrating Containers
The following session moves Container 101 from the source server to the destination server ts7.test.com:
# pmigrate c 101 c root:XXXXXXXXX@ts7.test.com/101
The c option in the command above tells pmigrate that you are moving a Container to a Container. If you do not indicate the credentials to log in to the destination server, you will need to do so during the migration.
Important! For the command to be successful, a direct SSH connection (on port 22) must be allowed between the source and destination servers.
By default, after the migration process is completed, the Container private area and configuration file are renamed on the source server by receiving the .migrated suffix. However, if you want the Container private area on the source server to be removed after the successful Container migration, you can override the default pmigrate behavior by changing the value of the REMOVEMIGRATED variable in the Parallels Cloud Server global configuration file (/etc/vz/vz.conf) to yes or by using the –r yes switch with the pmigrate command.
Migrating Virtual Machines
In turn, to migrate a virtual machine from the source server to ts7.test.com, you need just to specify v instead of c and the name of the resulting virtual machine instead of Container ID 101:
# pmigrate v MyVM v root:XXXXXXXXX@ts7.test.com/MyVM
This command moves the MyVM virtual machine from the local server to the destination server ts7.test.com. Once the migration is complete, the original virtual machine is removed from the
source server. However, you can use the --keep-src option to leave the original virtual machine intact.
For virtual machines, pmigrate also supports the migration from a remote Parallels server to the local one:
# pmigrate v ts7.test.com/MyVM v localhost
This command moves the MyVM virtual machine from the ts7.test.com server to the local server.
Note: For more information on options that you can pass to pmigrate, refer to the Parallels Cloud Server 6.0 Command Line Reference.
Zero-Downtime Migration
Using the zero-downtime migration technology, you can migrate paused and running virtual machines and running Containers from one Parallels server to another with zero downtime. The zero-downtime migration technology has the following main advantages over the standard one:
52
Managing Virtual Machines and Containers
The migration time is greatly reduced. In fact, the migration eliminates the service outage or interruption for end users.
The process of migrating a virtual machine or Container to another Parallels server is transparent for you and the Container applications and network connections. This means that no modifications of system characteristics and operational procedures inside the Container are performed on the source and destination servers.
The virtual machine or Container is restored on the destination server in the same state as it was at the beginning of the migration.
You can move virtual machines and Containers running applications that you do not want to be rebooted during the migration.
Note: Zero-downtime migration is not supported for virtual machines and Containers that have open sessions established with the prlctl enter command.
Migration requirements and restrictions
When performing a zero-downtime migration, take into account the requirements and restrictions below:
Before performing zero-downtime migration, it is recommended to synchronize the system time on the source and destination servers, for example, by means of NTP (http://www.ntp.org). The reason for this recommendation is that some processes running in virtual machines and Containers might rely on the system time being monotonic and thus might behave unpredictably if they see an abrupt step forward or backward in the time once they find themselves on the new server with different system clock parameters.
Your network must support data transfer rates of at least 1 Gb/s.
The source and destination servers must belong to the same subnetwork.
The CPUs on the source and destination servers must be manufactured by the same vendor,
and the CPU capabilities on the destination server must be the same or exceed those on the source server.
virtual machine and Container disks can be located on local disks, shared NFS and GFS2 storages, and ISCSI raw devices.
Migration process overview
The process of migrating virtual machines and Containers using the zero-downtime migration technology includes the following main steps:
1 Once you start the migration, Parallels Cloud Server checks whether the destination server
meets all migration requirements and the virtual machine or Container can be migrated to this server.
2 All virtual memory and disks of the virtual machine or Container are migrated to the destination
server.
3 The virtual machine or Container on the source server is suspended.
53
Managing Virtual Machines and Containers
4 The changed memory pages and virtual disk blocks, if any, are migrated to the destination
server.
5 The virtual machine or Container is resumed on the destination server.
The virtual machine or Container continues running during steps 1 and 2 and is not available to the end user during steps 3-5. But since the amount of memory pages and virtual disk blocks changed during step 2 is small, the service outage time for the end user is almost imperceptible.
Migrating virtual machines and Containers
Depending on whether you are migrating a virtual machine or Container, the command-line options you pass to the pmigrate slightly differ. For example, you can migrate Container 101 from the local server to the destination server destserver.com by executing the following command on the local server:
# pmigrate c 101 c --online destserver.com
Enter password: Connection to destination server (192.168.1.57) is successfully established ... Successfully completed
At the same time, to migrate the MyVM virtual machine to the same destination server destserver.com, you can run this command on the local server:
# pmigrate v MyVM v destserver.com
Migrate the VM MyVM to test.com ... The VM has been successfully migrated.
As you can see, to migrate a virtual machine, you skip the --online option and use the v option to specify that you are migrating a virtual machine.
Notes:
1. For more information on options you can use with the pmigrate utility, see the Parallels Cloud Server
6.0 Command Line Reference Guide.
2. After migration, the moved virtual machine may not be accessible over the network for several minutes due to latencies in the network equipment reconfiguration (for example, when switches need to update their dynamic VLAN membership tables).

Migrating Containers to Virtual Machines

The pmigrate utility allows you to migrate Containers to virtual machines. The source server, i.e. the server where the Container resides before its migration, can be one of the following:
a local server running Parallels Cloud Server
a remote server running Parallels Cloud Server
a remote server running Parallels Virtuozzo Containers
54
Managing Virtual Machines and Containers
Currently, the destination server, i.e. the server where the resulting virtual machine will be created, can be only a local server with Parallels Cloud Server.
The process of migrating a Container to a virtual machine differs depending on whether the server where the Container resides is running the Parallels Cloud Server or Parallels Virtuozzo Containers software.
Migrating Containers
You can use the pmigrate utility to migrate Containers that reside on both local and remote servers running Parallels Cloud Server. When migrating a Container from a local server, you only need to specify the Container ID and the name of the resulting virtual machine. For example, the following command migrates Container 101 to the VM_101 virtual machine on the same Parallels server:
# pmigrate c 101 v VM_101
The resulting virtual machine will be put to the /var/parallels directory on the destination server.
If you want to migrate a Container from a remote Parallels server, you should additionally indicate the source server IP address and the credentials of the root user on this server:
# pmigrate c root:8uhytv4@192.168.12.12/101 v VM_101
This command migrates Container 101 residing on the Parallels server with the IP address of
192.168.12.12 to the VM_101 virtual machine on the local server. If you do not specify the root
credentials on the source server, you will be asked to do so during the command execution.
Migrating Containers from Servers with Parallels Virtuozzo Containers
You can use the pmigrate utility to migrate Containers that reside on remote servers running the following versions of the Parallels Containers software:
Parallels Virtuozzo Containers 4.0 for Linux with update TU-4.0.0-464 or higher
Parallels Virtuozzo Containers 4.6 for Linux
Parallels Virtuozzo Containers 4.7 for Linux
Parallels Virtuozzo Containers 4.5 for Windows
Parallels Virtuozzo Containers 4.6 for Windows
Moving a Container from a remote Parallels Containers server to a virtual machine on the local server with Parallels Cloud Server involves completing the following steps:
1 Installing the Parallels agent on the server with Parallels Containers.
2 Running the pmigrate utility on the destination server to migrate the Container.
55
Managing Virtual Machines and Containers
Installing the Parallels for Containers Agent
First, you must install the Parallels agent on the source Parallels Containers server. During migration, the agent collects essential information on the Container to be moved and transfers it to the pmigrate utility on the destination server. To install the Parallels agent, do the following:
1 Log in to the source Parallels Containers server as a user with administrative rights.
2 Copy the Parallels agent installation file to the source server. The installation file is located in the
/usr/share/pmigrate/tools directory on the server with Parallels Cloud Server:
parallels-transporter-for-containers-XXXX.run. Use this file to install the
Parallels agent on servers running Parallels Virtuozzo Containers 4.0, 4.6, or 4.7 for Linux.
ParallelsTransporterForContainers-parallels-XXXX.exe. Use this file to
install the Parallels agent on servers running Parallels Virtuozzo Containers 4.5 or 4.6 for Windows.
3 Execute the installation file on the source server.
4 Follow the instructions of the wizard to install the Parallels agent.
Migrating the Container
Once the Parallels agent is installed, you can use the pmigrate utility to move a Container to a virtual machine. For example, you can run the following command on the destination server to migrate Container 101 from the remote server with IP address 192.168.12.12 to the VM_101 virtual machine:
# pmigrate c root:8uhytv4@192.168.12.12/101 v VM_101
Connecting to local agent... Querying configuration... Migrating... Operation progress 100% Registering VM... PVC to VM /var/parallels/VM_101.pvm/config.pvs migration succeeded.
The resulting virtual machine will be put to the /var/parallels directory on the destination server. If you do not specify the administrative credentials on the source server (for root on Linux servers and Administrator on Windows servers), you will be asked to do so during the command execution.

Migrating Physical Computers to Virtual Machines and Containers

You can use the pmigrate utility to migrate a standalone physical computer to a virtual machine or Container. The procedure includes copying the entire contents of a physical computer, including all files, directories, quota limits, settings, and so on, to a virtual machine or Container on a Parallels server. Migration of a computer produces its exact copy in the form of a virtual machine or Container, including operating system, assigned IP addresses, disk space, memory capacity, etc.
56
Managing Virtual Machines and Containers
Migrating a physical computer to a virtual machine or Container involves completing the following steps:
1 Installing the Parallels agent on the source physical computer (required for migrating to virtual
machines only).
2 Running the pmigrate utility on the destination server.
Installing Parallels Agent
The Parallels agent collects essential system data on the source physical computer and supplies it to the pmigrate utility on the destination Parallels server. To install the agent, do the following:
1 Make sure that the source physical computer meets the requirements for installing the agent.
See Requirements for Migrating to Virtual Machines (p. 59) for details.
2 Log in to the source physical computer as administrator.
3 Copy the correct agent installation file to the source physical computer from the
/usr/share/pmigrate/tools directory on the destination Parallels server:
For a Linux OS, choose parallels-transporter-agent-XXXX.run.
For a Windows OS, choose ParallelsTransporterAgent-parallels-XXXX.exe.
4 Run the installation file on the source physical computer and follow the wizard’s instructions.
5 Restart the source physical computer to complete the installation.
Note: The Parallels agent is launched automatically after restart. You do not need to run in manually.
Migrating Source Physical Computer
Once the source physical computer is up and running, you can migrate it to a virtual machine or Container on the destination Parallels server. For example, to migrate a physical computer to a virtual machine, run the following command on the destination server:
# pmigrate h root:1qsde34rt@192.168.1.130 v MyVM
Where:
h indicates that the migration source is a physical computer.
root:1qsde34rt@192.168.1.130 contains the source physical computer credentials and
IP address.
If you omit credentials, you will be asked to provide them during command execution.
v indicates that the migration destination is a virtual machine.
MyVM is the name of the resulting virtual machine on the destination Parallels server.
Once the procedure is complete, you will find the resulting virtual machine in the /var/parallels directory on the destination Parallels server.
57
Managing Virtual Machines and Containers
To migrate the same physical computer to a Container, just replace v with c and MyVM with a Container ID (e.g., 101). For example:
# pmigrate h root:1qsde34rt@192.168.1.130 c 101
Notes:
1. Migrating physical computers running Windows operating systems to Containers is not supported.
2. Migrating physical computers with ReiserFS system volumes is not supported.
Requirements for Migrating to Containers
To avoid delays and problems when migrating a physical server to a Container, make sure that the following requirements are met:
The Linux distribution installed on the source physical computer is supported by Parallels Cloud Server. To find that out, check the /etc/vz/conf/dists directory on the destination Parallels server and look for a corresponding Linux_Distribution_Name-version.conf configuration file (e.g., redhat-5.conf). If there is none, you can do one of the following:
Create a new distribution configuration file and place it in the /etc/vz/conf/dists
directory on the destination Parallels server. For more details, see Creating Configuration Files for New Linux Distribution (p. 181).
Start migration without a configuration file. In this case unknown.conf from the
/etc/vz/conf/dists directory will be used to configure the resulting Container.
However, you will not be able to use standard Parallels Cloud Server utilities (e.g., prlctl) to perform main operations on the newly created Container (e.g., set its IP address or configure DNS parameters) and have to do that manually from inside the Container.
ssh is installed on both the source physical computer and the destination Parallels server to provide secure encrypted and authenticated communication between the two. You can check if the ssh package is already installed by executing the ssh -V command.
rsync is installed on the source physical computer to copy the source contents to the resulting Container. If rsync on the source physical computer is incompatible with that on the destination Parallels server, use the latter, which is located in the /usr/local/share/vzlinmigrate directory.
Migration Restrictions for Containers
Listed below are the limitations you should take into account when migrating physical computers to Containers.
If the source physical computer has several IP addresses assigned to it, all of those are reassigned to the same venet0 device on the destination Parallels server. This virtual network adapter is used to interconnect all Containers on a Parallels server and the server itself. After migration, you can create additional virtual network adapters inside the resulting Container and assign necessary IP addresses to network adapters as you see fit. For more details, see
58
Managing Virtual Machines and Containers
Managing Adapters in Containers (p. 138).
During migration, you may specify only one partition on the source physical computer that will be migrated to a Container together with all its quotas. All other partitions will be copied without their quota limits. Moreover, the quota limits of the selected partition will be applied to the entire Container after migration.
While migrating a physical server running a Linux operating system with a security-enhanced (SE) Linux kernel, keep in mind that Parallels Cloud Server currently does not support SE Linux kernels, and the resulting Container will not support the SE features of the source.
If any of your files and/or directories on the source physical computer have extended attributes associated with them, these attributes will be lost after migration.
Raw devices on the source physical computer cannot and will not be migrated to the resulting Container on the destination Parallels server.
Any applications bound to the MAC address of the source physical computer will not run inside the resulting Container after migration. In this case, you can do one of the following:
Obtain new licenses for applications that require them and install those anew inside the
Container.
Try to reconfigure applications which do not require a license for working without being
bound to a MAC address.
If migration fails at a stage when rsync is transferring files and directories from the source physical computer to the resulting Container, the already copied files and directories will remain in the /vz/private/<CT_ID> directory on the destination Parallels server, probably occupying much disk space. You can keep this directory to speed up a new migration attempt, or you can delete it manually by using the rm utility.
Migrating physical computers with system volumes formatted as ReiserFS is not supported.
Migration of GUID Partition Table (GPT) disks is not supported.
Requirements for Migrating to Virtual Machines
Any physical computer to be migrated to a virtual machine must have the Parallels agent installed, for which the following requirements must be met.
Hardware Requirements
700 MHz or faster x86 or x64 processor (Intel or AMD).
256 MB or more RAM.
50 MB of free hard disk space for the Parallels agent.
Ethernet or Wi-Fi network adapter.
Software Requirements
See General Migration Requirements (p. 50).
59
Managing Virtual Machines and Containers
Additional Requirements for Migrating Servers with Parallels Cloud Server
To migrate a server running the Parallels Cloud Server software, you should first make sure that the snapapi26 and snumbd26 modules are not loaded on that server. To check this, you can use the following commands:
# lsmod | grep snapapi26 # lsmod | grep snumbd26
If necessary, unload the modules by running the rmmod command. You may need to stop the Parallels Cloud Server service first, as explained below:
1 Stop the service:
# /etc/init.d/vz stop
2 Unload the modules:
# rmmod snapapi26 # rmmod snumbd26
3 Start the service again:
# /etc/init.d/vz start
Once the modules are unloaded, proceed with migration.
Migration Restrictions for Virtual Machines
Listed below are the limitations you should take into account when migrating physical computers to virtual machines.
Migrating Windows dynamic volumes and Linux logical volumes (LVM) is not supported.
Migrating Windows software RAID configurations is not supported.
Migrating GUID Partition Table (GPT) disks is not supported.
Migrating physical computers with ReiserFS system volumes is not supported.

Migrating Virtual Machines to Containers

The process of migrating a virtual machine to a Container on the Parallels server is the same as migrating a physical computer to a Container. For example, you can execute the following command to move a virtual machine with the IP address of 192.168.1.130 to Container 101 on your Parallels server:
# pmigrate h root:1qsde34rt@192.168.1.130 c 101
You can omit the virtual machine credentials in the command above. In this case you will be asked to provide them during the command execution.
60
Managing Virtual Machines and Containers
Notes:
1. For more information on migrating physical computers to Containers, see Migrating Physical Computers to Virtual Machines and Containers (p. 56).
2. The requirements a virtual machine must meet are the same as for migrating physical computers; they are described in Requirements for Migrating to Containers (p. 58).

Migrating Xen Virtual Machines

You can use the pmigrate utility to migrate Xen virtual machines to virtual machines on the Parallels server. Moving a Xen virtual machine to a Parallels virtual machine involves completing the following steps:
1 Installing the Parallels agent on the physical server hosting the Xen virtual machine.
2 Migrating the Xen virtual machine by running the pmigrate utility on the server.
Both steps are described below in detail.
Installing the Agent
Before you start migrating a Xen virtual machine, you need first to install the Parallels agent on the Xen server where the virtual machine is residing. To install the Parallels agent, do the following:
1 Log in to the Xen server as a user with administrative rights.
2 Copy the Parallels agent installation file to the Xen server. The installation file is located in the
/usr/share/pmigrate/tools directory on the Parallels server and has the name parallels-transporter-agent-parallels-en_US-XXXX.run.
3 Execute the copied file, and follow the instructions to install the Parallels agent.
4 Start the Parallels agent:
# parallels-transporter-agent -c
Migrating the Xen virtual machine
Once the Parallels agent is running on the Xen server, you can migrate the Xen virtual machine. Let us assume the following:
You want to migrate the XenVM virtual machine from the Xen server to the MigratedVM virtual machine on the Parallels server.
root:1qsde34rt@192.168.1.130 is the IP address and credentials of the Xen server where the MigratedVM virtual machine resides.
To migrate the XenVM virtual machine, you can run the following command:
# pmigrate x root:1qsde34rt@192.168.1.130/XenVM v MigratedVM
61
Managing Virtual Machines and Containers
In this command, x denotes that you are migrating a Xen virtual machine, and v indicates that the Xen virtual machine is to be moved to a Parallels virtual machine. If you omit the credentials in the command above, you will be asked to provide them during the command execution. Once the migration is complete, you can find the resulting virtual machine in the /var/parallels directory on the Parallels server.
Note: You are recommended to check the settings of the migrated virtual machine (for example, memory and network settings) and, if necessary, configure them to meet your needs.
Troubleshooting the migration of paravirtualized Xen virtual machines
When migrating a paravirtualized Xen virtual machine, pmigrate first copies the whole of the virtual machine to the Parallels server and then replaces the paravirtualized kernel of the copied machine with a normal kernel from the corresponding Linux distribution. If it cannot replace the kernel, pmigrate displays an error but does not delete the virtual machine from the Parallels server. In this case, you can do the following:
Remove the copied virtual machine from the Parallels server and try to migrate the virtual machine again.
Configure the copied virtual machine on the Parallels server manually.
If you choose the second way, do the following:
1 Boot into the virtual machine in rescue mode using an ISO image of the Linux OS
corresponding to the OS installed in the virtual machine.
2 Detect where on the disk the root partition is located, and mount it.
3 Detect all other partitions on the disk (/boot, /usr, and so on), and mount them to the
corresponding directories on the root partition; also mount the /proc file system.
4 Install a normal Linux kernel (for example, from the ISO image you used to boot into the virtual
machine). The normal kernel must be of the same architecture as the paravirtualized Xen kernel.
5 Create the initrd image for the normal kernel if you have not already done so when installing
the kernel.
6 Configure the bootloader to load the normal kernel if you have not already done so when
installing the kernel.
7 Configure the /etc/inittab file to start getty and tty1-tty6.
8 Unmount the partitions.
9 Restart the virtual machine, and boot into the normal kernel.

Performing Container-Specific Operations

This section provides the description of operations specific to Containers.
62
Managing Virtual Machines and Containers

Reinstalling Containers

Reinstalling a Container may help if any required Container files have been inadvertently modified, replaced, or deleted, resulting in Container malfunction. You can reinstall a Container by using the prlctl reinstall command that creates a new Container private area from scratch according to its configuration file and relevant OS and application templates. For example:
# prlctl reinstall 101
Notes:
1. If any of the Container application templates cannot be added to the Container in a normal way, reinstallation will fail. This may happen, for example, if an application template was added to the Container using the --force option of the vzpkgadd or vzpkg install command (for more information on these commands, see the Parallels Cloud Server 6.0 Command Line Reference Guide).
2. Currently, the reinstall command may not be supported by the prlctl utility. Use vzctl instead.
To keep the personal data from the old Container, the utility also copies the old private area contents to the /vz/root/<CT_ID>/old directory of the new private area (unless the -­skipbackup option is given). This directory may be deleted after you copy the personal data where you need.
The prlctl reinstall command retains user credentials base, unless the --resetpwdb option is specified.
Customizing Container Reinstallation
The default reinstallation, as performed by the prlctl reinstall command, creates a new private area for the broken Container as if it were created by the prlctl create command and copies the private area of the broken Container to the /old directory in the new private area so that no file is lost. There is also a possibility of deleting the old private area altogether without copying or mounting it inside the new private area, which is done by means of the --skipbackup option. This way of reinstalling corrupted Containers might in certain cases not correspond exactly to your particular needs. It happens when you are accustomed to creating new Containers in some other way than just using the prlctl create command. For example, you may install additional software licenses into new Containers, or anything else. In this case you would naturally like to perform reinstallation in such a way so that the broken Container is reverted to its original state as determined by you, and not by the default behavior of the prlctl create command.
To customize reinstallation, you should write your own scripts determining what should be done with the Container when it is being reinstalled, and what should be configured inside the Container after it has been reinstalled. These scripts should be named vps.reinstall and vps.configure, respectively, and should be located in the /etc/vz/conf directory on the server. To facilitate your task of creating customized scripts, the Containers software is shipped with sample scripts that you may use as the basis of your own scripts.
63
Managing Virtual Machines and Containers
When the prlctl reinstall <CT_ID> command is called, it searches for the
--veid
--ve_private
vps.reinstall and vps.configure scripts and launches them consecutively. When the vps.reinstall script is launched, the following parameters are passed to it:
Option Description
--ve_private_tmp
Container ID.
The path to the Container temporary private area. This path designates where a new private area is temporarily created for the Container. If the script runs successfully, this private area is mounted to the path of the original private area after the script has finished.
The path to the Container original private area.
You may use these parameters within your vps.reinstall script.
If the vps.reinstall script finishes successfully, the Container is started, and the vps.configure script is called. At this moment the old private area is mounted to the /old directory inside the new one irrespective of the --skipbackup option. This is done in order to let you use the necessary files from the old private area in your script, which is to be run inside the running Container. For example, you might want to copy some files from there to regular Container directories.
After the vps.configure script finishes, the old private area is either dismounted and deleted or remains mounted depending on whether the --skipbackup option was provided.
If you do not want to run these reinstallation scripts and want to stick to the default prlctl reinstall behavior, you may do either of the following:
1 Remove the vps.reinstall and vps.configure scripts from the /etc/vz/conf
directory, or at least rename them;
2 Modify the last line of the vps.reinstall script so that it would read
exit 128
instead of
exit 0
The 128 exit code tells the utility not to run the scripts and to reinstall the Container with the default behavior.

Enabling VPN for Containers

Virtual Private Network (VPN) is a technology which allows you to establish a secure network connection even over an insecure public network. Setting up a VPN for a separate Container is possible via the TUN/TAP device. To allow a particular Container to use this device, the following steps are required:
Make sure the tun.o module is already loaded before Parallels Cloud Server is started:
# lsmod
64
Managing Virtual Machines and Containers
Allow the Container to use the TUN/TAP device:
# prlctl set 101 --devices c:10:200:rw
Note: Currently, the --devices option may not be supported by the prlctl utility. Use vzctl instead.
Create the corresponding device inside the Container and set the proper permissions:
# prlctl exec 101 mkdir -p /dev/net # prlctl exec 101 mknod /dev/net/tun c 10 200 # prlctl exec 101 chmod 600 /dev/net/tun
Configuring the VPN proper is carried out as a common Linux administration task, which is out of the scope of this guide. Some popular Linux software for setting up a VPN over the TUN/TAP driver includes Virtual TUNnel <http://vtun.sourceforge.net/> and OpenVPN
<http://openvpn.sourceforge.net/>.

Performing Virtual Machine-Specific Operations

This section focuses on operations specific to virtual machines.

Pausing Virtual Machines

Pausing a running virtual machine releases the resources, such as RAM and CPU, currently used by this virtual machine. The released resources can then be used by the Parallels server or other running virtual machines and Containers.
To pause a virtual machine, you can use the prlctl pause command. For example, the following command pauses the My_VM virtual machine:
# prlctl pause My_VM
Pause the VM... The VM has been successfully paused.
You can check that the virtual machine has been successfully paused by using the prlctl list
-a command:
# prlctl list -a
STATUS IP_ADDR NAME running 10.10.10.101 101 paused 10.10.10.201 My_VM
The command output shows that the My_VM virtual machine is paused at the moment. To continue running this virtual machine, execute this command:
# prlctl start My_VM
Starting the VM... The VM has been successfully started.

Managing Virtual Machine Devices

Parallels Cloud Server allows you to manage the following virtual machine devices:
65
Managing Virtual Machines and Containers
hard disk drives
cdrom
net
fdd
serial
parallel
sound
usb
CD/DVD-ROM drives
floppy disk drives
network adapters
serial and parallels ports
sound cards
USB controllers
The main operations you can perform on these devices are:
adding a new device to the virtual machine
configuring the device properties
removing a device from the virtual machine
Adding New Devices
This section provides information on adding new devices to your virtual machines. You can add new virtual devices to your virtual machine using the prlctl set command. The options responsible for adding particular devices are listed in the following table:
Option Description
hdd
Adds a new hard disk drive to the virtual machine. You can either connect an existing image to the virtual machine or create a new one.
Note: SATA disks can be added to running and stopped virtual machines while IDE and SCSI disks—to stopped virtual machines only.
Adds a new CD/DVD-ROM drive to the virtual machine.
Adds a new network adapter to the virtual machine.
Adds a new floppy disk drive to the virtual machine.
Adds a new serial port to the virtual machine.
Adds a new parallel port to the virtual machine.
Adds a new sound device to the virtual machine.
Adds a new USB controller to the virtual machine.
For example, you can execute the following command to add a new virtual disk to the MyVM virtual machine:
# prlctl set MyVM --device-add hdd
Creating hdd1 (+) sata:0 image='/var/parallels/MyVM.pvm/harddisk1.hdd Create the expanding disk, 65536... The VM has been successfully configured.
This command creates a new virtual disk with the following default parameters:
name: hdd1
66
Managing Virtual Machines and Containers
disk type: SATA
image file name and location: /var/parallels/MyVM.pvm/harddisk1.hdd
disk format: expanding
disk capacity: 65536 MB
You can redefine some of these parameters by specifying specific options during the command execution. For example, to create an IDE virtual disk that will have the capacity of 84 GB, you can run this command:
# prlctl set MyVM --device-add hdd --size 84000 --iface ide
Creating hdd1 (+) ide:1 image='/var/parallels/MyVM.pvm/harddisk1.hdd Create the expanding disk, 84000Mb... The VM has been successfully configured.
The virtual disk has been added to your virtual machine. However, before starting to use it, you must initialize the disk. Refer to the next subsection for information on how you can do it.
When managing devices, keep in mind the following:
Detailed information on all options that can be passed to prlctl set when creating a new virtual machine device is provided in the Parallels Cloud Server 6.0 Command Line Reference Guide.
You can connect up to 4 IDE devices, 6 SATA devices, and 15 SCSI devices (virtual disks or CD/DVD-ROM drives) to a virtual machine.
If you want to use an existing image file as a virtual CD/DVD-ROM drive, keep in mind that Parallels Cloud Server supports .iso, .cue, .ccd and .dmg (non-compressed and non­encrypted) image files.
A virtual machine can have only one floppy disk drive.
A virtual machine can have up to 16 virtual network adapters.
A virtual machine can have up to four serial ports.
A virtual machine can have up to three parallel ports.
Any virtual machine can have only one sound device.
A virtual machine can have only one USB controller.
Initialize a Newly Added Disk
After you added a new blank virtual hard disk to the virtual machine configuration, it will be invisible to the operating system installed inside the virtual machine until the moment you initialize it.
Initializing the New Virtual Hard Disk in Windows
To initialize a new virtual hard disk in a Windows guest OS, you will need the Disk Management utility available. For example, in Windows 7 and Windows XP you can access this utility by doing the following:
In Windows 7, click Start > Control Panel > System and Security > Administrative Tools >
67
Managing Virtual Machines and Containers
Computer Management Storage > Disk Management.
In Windows XP, click Start > Control Panel > Administrative Tools > Computer Management > Storage > Disk Management.
When you open the Disk Management utility, it automatically detects that a new hard disk was added to the configuration and launches the Initialize and Convert Disk wizard:
1 In the introduction window, click Next.
2 In the Select Disks to Initialize window, select the newly added disk and click Next.
3 In the Select Disks to Convert window, select the newly added disk and click Finish.
The added disk will appear as a new disk in the Disk Management utility window, but its memory space will be unallocated. To allocate the disk memory, right-click this disk name in the Disk Management utility window and select New Simple Volume in Windows Vista or New Volume in Windows XP. The New Simple Volume Wizard/New Volume Wizard window will appear. Follow the steps of the wizard and create a new volume in the newly added disk.
After that your disk will become visible in Computer/My Computer and you will be able to use it as a data disk inside your virtual machine.
Initializing the New Virtual Hard Disk in Linux
Initializing a new virtual hard disk in a Linux guest OS comprises two steps: (1) allocating the virtual hard disk space and (2) mounting this disk in the guest OS.
To allocate the space, you need to create a new partition on this virtual hard disk using the fdisk utility:
Note: To use the fdisk utility, you need the root privileges.
1 Launch a terminal window.
2 To list the IDE disk devices present in your virtual machine configuration, enter:
fdisk /dev/hd*
Note: If you added a SCSI disk to the virtual machine configuration, use the fdisk /dev/sd* command instead.
3 By default, the second virtual hard disk appears as /dev/hdc in your Linux virtual machine. To
work with this device, enter:
fdisk /dev/hdc
Note: If this is a SCSI disk, use the fdisk /dev/sdc command instead.
4 To get detailed information about the disk, enter:
p
5 To create a new partition, enter:
n
6 To create the primary partition, enter:
68
Managing Virtual Machines and Containers
p
7 Specify the partition number. By default, it is 1.
8 Specify the first cylinder. If you want to create a single partition on this hard disk, use the default
value.
9 Specify the last cylinder. If you want to create a single partition on this hard disk, use the default
value.
10 To create a partition with the specified settings, enter:
w
When you allocated the space on the newly added virtual hard disk, you should format it by entering the following command in the terminal:
mkfs -t <FileSystem> /dev/hdc1
Note: <FileSystem> stands for the file system you want to use on this disk. It is recommended to use ext3 or ext2.
When the added virtual hard disk is formatted, you can mount it in the guest OS.
1 To create a mount point for the new virtual hard disk, enter:
mkdir /mnt/hdc1
Note: You can specify a different mount point.
2 To mount the new virtual hard disk to the specified mount point, enter:
mount /dev/hdc1 /mnt/hdc1
When you mounted the virtual hard disk, you can use its space in your virtual machine.
Configuring Virtual Devices
In Parallels Cloud Server, you can use the --device-set option of the prlctl set command to configure the parameters of an existing virtual device. As a rule, the process of configuring the device properties includes two steps:
1 Finding out the name of the device you want to configure.
2 Running the prlctl set command to configure the necessary device properties.
Finding Out Device Names
To configure a virtual device, you need to specify its name when running the prlctl set command. If you do not know the device name, you can use the prlctl list command to learn it. For example, to obtain the list of virtual devices in the MyVM virtual machine, run this command:
# prlctl list --info MyVM
... Hardware: cpu 2 VT-x accl=high mode=32 memory 256Mb video 46Mb fdd0 (+) real='/dev/fd0' state=disconnected hdd0 (+) sata:0 image='/var/parallels/MyVM.pvm/harddisk.hdd' 27000Mb
69
Managing Virtual Machines and Containers
hdd1 (+) scsi:0 image='/var/parallels/MyVM.pvm/harddisk1.hdd' 32768Mb cdrom0 (+) ide:1 real='Default CD/DVD-ROM' parallel0 (+) real='/dev/lp0' usb (+) net0 (+) type=bridged iface='eth1' mac=001C4201CED0 ...
All virtual devices currently available to the virtual machine are listed under Hardware. In our case the MyVM virtual machine has the following devices: 2 CPUs, main memory, video memory, a floppy disk drive, 2 hard disk drives, a CD/DVD-ROM drive, a parallel port, a USB controller, and a
network card.
Configuring Virtual Devices
Once you know the virtual device name, you can configure its properties. For example, you can execute the following command to configure the current type of the virtual disk hdd1 in the MyVM virtual machine from SATA to SCSI:
# prlctl set MyVM --device-set hdd1 --iface scsi
The VM has been successfully configured.
To check that the virtual disk type has been successfully changed, use the prlctl list -­info command:
# prlctl list --info MyVM
... hdd0 (+) scsi:1 image='/var/parallels/MyVM.pvm/harddisk.hdd' 85000Mb
...
Connecting and Disconnecting Virtual Devices
In Parallels Cloud Server, you can connect or disconnect certain devices when a virtual machine is running. These devices include:
SATA hard drives
CD/DVD-ROM drives
floppy disk drives
network adapters
printer ports
serial ports
sound devices
USB devices
shared folders
Usually, all virtual devices are automatically connected to a virtual machine when you create them. To disconnect a device from the virtual machine, you can use the prlctl set command. For example, the following command disconnects the CD/DVD-ROM drive cdrom0 from the MyVM virtual machine:
# prlctl set MyVM --device-disconnect cdrom0
70
Managing Virtual Machines and Containers
Disconnect device: cdrom0
cdrom
net
fdd
serial
parallel
sound
usb
The VM has been successfully configured.
To connect the CD/DVD-ROM drive back, you can run the following command:
# prlctl set MyVM --device-connect cdrom0
Connect device: cdrom0 The VM has been successfully configured.
Deleting Devices
You can delete a virtual device that you do not need any more in your virtual machine using the -­device-del option of the prlctl set command. The options responsible for removing
particular devices are listed in the following table:
Option Description
hdd
Deletes the specified hard disk drive from the virtual machine.
Note: SATA disks can be removed from running and stopped virtual machines while IDE and SCSI disks—from stopped virtual machines only.
Deletes the specified CD/DVD-ROM drive from the virtual machine.
Deletes the specified network adapter from the virtual machine.
Deletes the floppy disk drive from the virtual machine.
Deletes the specified serial port from the virtual machine.
Deletes the specified parallel port from the virtual machine.
Deletes the sound device from the virtual machine.
Deletes the USB controller from the virtual machine.
As a rule deleting a virtual device involves performing two operations:
1 Finding out the name of the device to be deleted.
2 Deleting the device from the virtual machine.
Finding Out the Device Name
To remove a virtual device, you need to specify its name when running the prlctl set command. If you do not know the device name, you can use the prlctl list command to learn it. For example, to obtain the list of virtual devices in the MyVM virtual machine, run this command:
# prlctl list --info MyVM
... Hardware: cpu 2 VT-x accl=high mode=32 memory 256Mb video 46Mb fdd0 (+) real='/dev/fd0' state=disconnected hdd0 (+) ide:0 image='/var/parallels/MyVM.pvm/harddisk.hdd' 27Mb hdd1 (+) scsi:0 image='/var/parallels/MyVM.pvm/harddisk1.hdd' 32768Mb cdrom0 (+) ide:1 real='Default CD/DVD-ROM' parallel0 (+) real='/dev/lp0'
71
Managing Virtual Machines and Containers
usb (+) net0 (+) type=bridged iface='eth1' mac=001C4201CED0 ...
All virtual devices currently available to the virtual machine are listed under Hardware. In our case the MyVM virtual machine has the following devices: 2 CPUs, main memory, video memory, a floppy disk drive, 2 hard disk drives, a CD/DVD-ROM drive, a parallel port, a USB controller, and a
network card.
Deleting a Virtual Device
Once you know the virtual device name, you can remove it from your virtual machine. For example, you can execute the following command to remove the virtual disk hdd1 from the MyVM virtual machine:
# prlctl set MyVM --device-del hdd1
Remove the hdd1 device. The VM has been successfully configured.
When deleting virtual machine devices, keep in mind the following:
If you do not want to permanently delete a virtual device, you can temporarily disconnect if from the virtual machine using the --disable option.
Detailed information on all options that can be used with prlctl set when deleting a device is given in the Parallels Cloud Server 6.0 Command Line Reference Guide.

Making Screenshots

In Parallels Cloud Server, you can use the prlctl capture command to capture an image (or screenshot) of your virtual machine screen. You can take screenshots of running virtual machines only. The session below demonstrates how to take a screenshot of the MyVM virtual machine screen and save it to the /usr/screenshots/image1.png file:
1 Make sure that the virtual machine is running:
# prlctl list
STATUS IP_ADDR NAME running 10.10.10.101 101 running 10.10.10.201 MyVM
2 Take the virtual machine screenshot:
# prlctl capture MyVM --file /usr/screenshots/image1.png
3 Check that the image1.png file has been successfully created:
# ls /usr/screenshots/
image1.png

Assigning USB Devices to Virtual Machines

In Parallels Cloud Server, you can assign a USB device to a virtual machine so that the device is automatically connected to the virtual machine when you connect the USB device to the Parallels
72
Managing Virtual Machines and Containers
server or start the virtual machine. To assign a USB device to a virtual machine, you need to specify two parameters:
ID of the USB device. To get this information, use the prlsrvctl info command, for example:
# prlsrvctl info
... Hardware info: hdd '/dev/sda' hdd-part NTFS '/dev/sda2' hdd-part Linux '/dev/sda3' hdd-part Linux '/dev/sda5' hdd-part Linux swap '/dev/sda6' cdrom Optiarc DVD RW AD-7260S '/dev/scd0' net eth0 'eth0' usb Broadcom - USB Device 3503 '2-1.4.3|0a5c|3503|full|KM|Empty' usb Broadcom - USB Device 3502 '2-1.4.2|0a5c|3502|full|KM|Empty' usb LITEON Technology - USB Multimedia Keyboard '1-1.6|046d|c312|low|KM|Empty' serial /dev/ttyS0 '/dev/ttyS0' serial /dev/ttyS1 '/dev/ttyS1'
All USB devices available on the Parallels server are listed in the Hardware info section and start with usb.
ID of the virtual machine. To get this information, use the prlctl list --info command, for example:
# prlctl list --info
ID: {d8d516c9-dba3-dc4b-9941-d6fad3767035} Name: Windows 7 ...
The first line in the command output indicates the virtual machine ID; in our case, it is {d8d516c9-dba3-dc4b-9941-d6fad3767035}.
Once you know the USB device and virtual machine IDs, you can use the prlsrvctl usb set command to assign the USB device to the virtual machine. For example:
# prlsrvctl usb set '1-1.6|046d|c312|low|KM|Empty' {d8d516c9-dba3-dc4b-9941­d6fad3767035}
The server has been successfully configured.
This command assigns the USB device LITEON Technology - USB Multimedia Keyboard with ID '1-1.6|046d|c312|low|KM|Empty' to the virtual machine with ID {d8d516c9-dba3-dc4b-9941-d6fad3767035}. When running the command, remember to
specify the single quotes and curly brackets with the USB device and virtual machine IDs, respectively.
To check that the USB device has been successfully assigned to the virtual machine, use the prlsrvctl usb list command:
# prlsrvctl usb list
Broadcom - USB Device 3503 '2-1.4.3|0a5c|3503|full|KM|Empty' Broadcom - USB Device 3502 '2-1.4.2|0a5c|3502|full|KM|Empty' LITEON Technology - USB Multimedia Keyboard '1-1.6|046d|c312|low|KM|Empty' {d8d516c9-dba3-dc4b-9941-d6fad3767035}
73
Managing Virtual Machines and Containers
The command output shows that the USB device with ID '1-
1.6|046d|c312|low|KM|Empty' is now associated with the virtual machine with ID
{d8d516c9-dba3-dc4b-9941-d6fad3767035}. This means that the device is automatically
connected to the virtual machine every time you start this virtual machine and connect the device to the Parallels server.
To remove the assignment of the USB device with ID '1-1.6|046d|c312|low|KM|Empty', use the prlsrvctl usb del command:
# prlsrvctl usb del '1-1.6|046d|c312|low|KM|Empty'
The server has been successfully configured.
When assigning USB devices to virtual machines, keep in mind the following:
You cannot migrate a running virtual machine having one or more USB devices assigned.
After migrating a stopped virtual machine, all its assignments are lost.
All USB assignments are preserved if you restoring a virtual machine to its original location and
are lost otherwise.
The USB device assignment and a virtual machine is created for the user currently logged in to the system.

Configuring IP Address Ranges for Host-Only Networks

All virtual machines connected to networks of the host-only type receive their IP addresses from the Parallels DHCP server. This DHCP server is set up during the Parallels Cloud Server installation and includes by default IP addresses from 10.37.130.1 to 10.37.130.254. You can redefine the default IP address range for host-only networks and make virtual machines get their IP addresses from different IP address ranges. For example, you can run the following command to set the start and end IP addresses for the Host-Only network (this network is automatically created during the Parallels Cloud Server installation) to 10.10.11.1 and 10.10.11.254, respectively:
# prlsrvctl net set Host-Only --ip-scope-start 10.10.11.1 --ip-scope-end 10.10.11.254
You can also specify a custom IP address range directly when creating a new network of the host­only type. Assuming that you want to create a network with the Host-Only2 name and define for this network the IP addresses range from 10.10.10.1 to 10.10.10.254, you can execute the following command:
# prlsrvctl net add Host-Only2 -t host-only --ip-scope-start 10.10.10.1 --ip-scope-end
10.10.10.254
When working with IP address ranges, pay attention to the following:
The start and end IP addresses of an IP address range must belong to the same subnetwork.
IP address ranges can be defined for each network of the host-only type separately. For
example, you can set the IP address range from 10.10.11.1 to 10.10.11.254 for the Host­Only network and from 10.10.10.1 to 10.10.10.254 for the Host-Only2 network.
74
Managing Virtual Machines and Containers

Converting Third-Party Virtual Machines and Disks

In Parallels Cloud Server, you can convert third-party virtual machines and their disks to Parallels virtual machines and disks. Currently, you can convert the following third-party virtual machines and disks:
Microsoft Hyper-V
Microsoft Virtual PC
Virtual Box
VMware
Converting Virtual Machines
Let us assume that you want to convert a VMware virtual machine that runs the CentOS 5 operating system and has the name centos5. As the prlctl convert command can work only with virtual machines and disks that are available locally, you first need to copy the virtual machine to the Parallels server. Once the virtual machine is on your local server, you can start the conversion. Assuming that you have copied the virtual machine to the /var/parallels directory on the Parallels server and the full path to its configuration file is /var/parallels/centos5/config.xml, you can run the following command to perform the conversion:
# prlctl convert /var/parallels/centos5/config.xml
Once the conversion is complete, you can start the virtual machine and manage it in the same way you would manage a native Parallels virtual machine.
Converting Disks
You can also convert third-party virtual disks to Parallels virtual machines and disks using the prl_convert utility. Once you run the utility, it checks the disk and, depending on its type, does one of the following:
If the disk is a system disk—that is, has an operating system installed, 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. You can also specify the --allow-no-os option to force the conversion, but in this case you may have problems with starting and using the resulting virtual machine.
If the disk is a data disk, prl_convert converts it to a Parallels virtual disk.
When converting third-party virtual disks, you need to specify the full path to the original disk file. For example, to convert the system disk of the centos5 virtual machine (that is, the disk where the CentOS 5 operating system is installed) that has the full path of /var/parallels/centos5/centos5.vhd, you can use this command:
# prl_convert /var/parallels/centos5/centos5.vhd
75
Managing Virtual Machines and Containers
This command creates a ready-to-use Parallels virtual machine with the name centos5. You can start this virtual machine and manage it in the same way you would manage a native Parallels virtual machine. At the same time, if you convert a third-party virtual data disk, you will need first to add the resulting disk to an existing Parallels virtual machine using the prlctl set command.
Notes:
1. When adding a converted virtual disk to an existing Parallels virtual machine or creating a new virtual machine on its basis, make sure that the interface type of the disk is the same as it was in the source virtual machine. For example, if the original disk had the SCSI interface type, ensure that the interface type of the converted disk is also set to SCSI. If you do not configure the disk interface type, it will be set to SATA (this is the default interface type in Parallels virtual machines), which may cause your virtual machine to malfunction.
2. In the current version of Parallels Cloud Server, Hyper-V virtual machines can be converted using the prl_convert utility only. That means that you first need to convert all Hyper-V virtual disks and then add them to an existing virtual machine.
76
Monitoring Resources ............................................................................................. 114
C
HAPTER
4

Managing Resources

The main goal of resource control in Parallels Cloud Server is to provide Service Level Management or Quality of Service for virtual machines and Containers. Correctly configured resource control settings prevent serious impacts resulting from the resource over-usage (accidental or malicious) of any virtual machine and Container on the other virtual machines and Containers. Using resource control parameters for resources management also allows you to enforce fairness of resource usage among virtual machines and Containers and better service quality for preferred virtual machines and Containers, if necessary.
In This Chapter
What are Resource Control Parameters? ................................................................ 77
Managing CPU Resources ...................................................................................... 77
Managing Disk Quotas ........................................................................................... 83
Managing Virtual Disks ........................................................................................... 86
Managing Network Accounting and Bandwidth ....................................................... 90
Managing Disk I/O Parameters ............................................................................... 96
Managing Memory Parameters for Containers ......................................................... 101
Managing Memory Parameters for Virtual Machines ................................................ 105
Managing Container Resources Configuration ......................................................... 110
Managing Virtual Machine Configuration Samples ................................................... 113

What are Resource Control Parameters?

The system administrator can control the resources available to a virtual machine and Container through a set of resource management parameters. All these parameters can be set and configured using Parallels command-line utilities.

Managing CPU Resources

In the current version of Parallels Cloud Server, you can manage the following CPU resource parameters for virtual machines and Containers:
CPU units for virtual machines and Containers (p. 78)
CPU affinity for virtual machines and Containers (p. 78)
Managing Resources
CPU limits for virtual machines and Containers (p. 79)
NUMA nodes for Containers (p. 81)
CPU hotplug for virtual machines (p. 82)
Detailed information on these parameters is given in the following sections.

Configuring CPU Units

CPU units define how much CPU time one virtual machine or Container can receive in comparison with the other virtual machines and Containers on the server if all the CPUs of the server are fully used. For example, if Container 101 and the MyVM virtual machine are set to receive 1000 CPU units each and Container 102 is configured to get 2000 CPU units, Container 102 will get twice as much CPU time as Containers 101 or the MyVM virtual machine if all the CPUs of the Node are completely loaded.
By default, each virtual machine and Container on the Node gets 1000 CPU units. You can configure the default setting using the prlctl set command. For example, you can run the following commands to allocate 2000 CPU units to Container 101 and the MyVM virtual machine:
# prlctl set 101 --cpuunits 2000 # prlctl set MyVM --cpuunits 2000

Configuring CPU Affinity for Virtual Machines and Containers

If your physical server has several CPUs installed, you can bind a virtual machine or Container to specific CPUs so that only these CPUs are used to handle the processes running in the virtual machine or Container. The feature of binding certain processes to certain CPUs is known as CPU affinity. Establishing CPU affinity between virtual machines and Containers and physical processors may help you increase your system performance by up to 20%.
By default, any newly created virtual machine and Container can consume the CPU time of all processors installed on the physical server. To bind a virtual machine or Container to specific CPUs, you can use the --cpumask option of the prlctl set command. Assuming that your
physical server has 8 CPUs, you can make the processes in the MyVM virtual machine and Container 101 run on CPUs 0, 1, 3, 4, 5, and 6 by running the following commands:
# prlctl set MyVM --cpumask 0,1,3,4-6 # prlctl set 101 --cpumask 0,1,3,4-6
You can specify the CPU affinity mask—that is, the processors to bind to virtual machines and Containers—as separate CPU index numbers (0,1,3) or as CPU ranges (4-6). If you are setting the CPU affinity mask for a running virtual machine or Container, the changes are applied on the fly.
To undo the changes made to the MyVM virtual machine and Container 101 and set their processes to run on all available CPUs on the server, run these commands:
# prlctl set MyVM --cpumask all # prlctl set 101 --cpumask all
78
Managing Resources

Configuring CPU Limits for virtual machines and Containers

CPU limit indicates the maximum CPU power a virtual machine or Container may get for its running processes. The Container is not allowed to exceed the specified limit even if the server has enough free CPU power. By default, the CPU limit parameter is disabled for all newly created virtual machines and Containers. This means that any application in any virtual machine or Container can use all the free CPU power of the server.
To set a CPU limit for a virtual machine or Container, you can use one of these options:
--cpulimit
--cpus
Both options are described below in detail.
Using --cpulimit to set CPU limits
As a rule, you set a CPU limit for a virtual machine or Container by using the --cpulimit option with the prlctl set command. In the following example, Container 101 is set to receive no more than 25% of the server CPU time even if the CPUs on the server are not fully loaded:
# prlctl set 101 --cpulimit 25
This command sets the CPU limit for Container 101 to 25% of the total CPU power of the server. The total CPU power of a server in per cent is calculated by multiplying the number of CPU cores installed on the server by 100%. So if a server has 2 CPU cores, 2 GHz each, the total CPU power will equal 200% and the limit for Container 101 will be set to 500 MHz.
Now imagine the situation when you migrate Container 101 to another server with 2 CPU cores, 3 GHz each. On this server, Container 101 will be able to get 25% of 6 GHz—that is, 750 MHz. To ensure that Container 101 always has the same CPU limit on all servers, irrespective of their total CPU power, you can set the CPU limits in megahertz (MHz). For example, to make Container 101 consume no more than 500 MHz on any server, run the following command:
# prlctl set 101 --cpulimit 500m
Note: For more information on setting CPU limits for virtual machines and Containers, see also CPU Limit Specifics.
Using --cpus to set CPU limits
Another way of setting a CPU limit for a virtual machine or Container is to use the --cpus option with the prlctl set command. You may want to use this command if your server has several CPU cores. In this case, you can specify the desired number of CPU cores after --cpus and the CPU limit will be set to the sum of CPU powers of the specified cores. For example, if a server has 4 CPU cores, 3 GHz each, you can allow Container 101 to consume no more than 6 GHz of CPU power by running this command:
# prlctl set 101 --cpus 2
79
Managing Resources
To check that the CPU limit has been successfully set, you can execute the following command:
# vzlist -o cpulimitM 101
CPUL_M 6000
As you can see, the CPU limit for Container 101 is now set to 6000 MHz (or 6 GHz).
Note: To check the CPU limit set for a virtual machine, run the prlctl list -i VM_Name command and check the value of the cpulimit parameter in the command output.
Along with setting the CPU limit for a virtual machine or Container on the server, the --cpus option also defines how the information on available CPUs is shown to users. So in the example above, if you log in to Container 101 and run the cat /proc/cpuinfo command, you will see that only 2 CPUs are installed in the Container:
# prlctl exec 101 cat /proc/cpuinfo
processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 1 cpu MHz : 2993.581 cache size : 1024 KB ...
processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 1 cpu MHz : 2993.581 cache size : 1024 KB ...
Using --cpulimit and --cpus simultaneously
If you use both parameters (--cpulimit and --cpus) to set the CPU limit for a virtual machine or Container, the smallest limit applies. For example, running the following commands on a server with 4 CPUs, 2 GHZ each, will set the limit for Container 101 to 2 GB:
# prlctl set 101 --cpus 2 # prlctl set 101 --cpulimit 2000m
CPU Limit Specifics
Internally, Parallels Cloud Server sets the CPU limit for virtual machines and Containers in percent. On multi-core systems, each physical CPU core is considered to have the CPU power of 100%. So if a server has 4 CPU cores, the total CPU power of the server equals 400%.
You can also set a CPU limit in megahertz (MHz). If you specify the limit in MHz, Parallels Cloud Server uses the following formula to convert the CPU power of the server from MHz into percent:
CPULIMIT_% = 100% * CPULIMIT_MHz / CPUFREQ
80
Managing Resources
where
CPULIMIT_% is the total CPU power of the server in percent.
CPULIMIT_MHz is the total CPU power of the server in megahertz.
CPUFREQ is the CPU frequency of one core on the server.
When setting CPU limits, notice the following:
Make sure that the CPU limit you plan to set for a virtual machine or Container does not exceed the total CPU power of the server. So if a server has 4 CPUs, 1000 MHz each, do not set the CPU limit to more than 4000 MHz.
The processes running in a virtual machine or Container are scheduled for execution on all server CPUs in equal shares. For example, if a server has 4 CPUs, 1000 MHz each, and you set the CPU limit for a virtual machine or Container to 2000 MHz, the virtual machine or Container will consume 500 MHz from each CPU.
All running virtual machines and Containers on a server cannot simultaneously consume more CPU power than is physically available on the node. In other words, if the total CPU power of the server is 4000 MHz, the running virtual machines and Containers on this server will not be able to consume more than 4000 MHz, irrespective of their CPU limits. It is, however, perfectly normal that the overall CPU limit of all virtual machines and Containers exceeds the Node total CPU power because most of the time virtual machines and Containers consume only part of the CPU power assigned to them.

Binding CPUs to NUMA Nodes

On systems with a NUMA (Non-Uniform Memory Access) architecture, you can configure Containers to use CPUs from specific NUMA nodes only. Let us assume the following:
Your physical server has 8 CPUs installed.
The CPUs are divided into 2 NUMA nodes: NUMA node 0 and NUMA node 1. Each NUMA
node has 4 CPUs.
You want the processes in Container 101 to be executed on the processors from NUMA node
1.
To set Container 101 to use the processors from NUMA node 1, run the following command:
# prlctl set 101 --nodemask 1
To check that Container 101 is now bound to NUMA node 1, use this command:
# vzlist 101 -o nodemask
NODEMASK 1
To unbind Container 101 from NUMA node 1, execute this command:
# prlctl set 101 --nodemask all
Now Container 101 should be able to use all CPUs on the server again.
81
Managing Resources
Note: For more information on NUMA, visit http://lse.sourceforge.net/numa.

Enabling CPU Hotplug for Virtual Machines

If a guest operating system supports the CPU hotplug functionality, you can enable this functionality for the virtual machine. Once the CPU hotplug functionality is turned on, you can increase the number of CPUs available to your virtual machines even if they are running.
Note: Decreasing the number of CPUs available to a running virtual machine is not supported in the current version of Parallels Cloud Server.
Currently, the following systems come with the CPU hotplug support:
Linux (both x86 and x64 versions)
Linux operating systems based on the RHEL 5 kernel and higher (Red Hat Linux Enterprise 5, CentOS 5, and so on)
Windows
x64 version of Windows Server 2008 (Standard Edition)
x64 version of Windows Server 2008 (Enterprise Edition)
x64 version of Windows Server 2008 (Datacenter Edition)
x64 version of Windows Server 2008 R2 (Datacenter Edition)
By default, the CPU hotplug support is disabled for all newly created virtual machines. To enable this functionality, you can use the --cpu-hotplug option of the prlctl set command. For example, to enable the CPU hotplug support in the MyVM virtual machine that runs one of the supported operating systems, stop the MyVM virtual machine and run this command:
# prlctl set MyVM --cpu-hotplug on
set cpu hotplug: 1 The VM has been successfully configured.
Once the functionality is enabled, you can increase the number of CPUs in the MyVM virtual machine even it is running. Assuming that your physical server has 4 CPUs installed and the processes in the MyVM virtual machine are set to be executed on two CPUs, you can run the following command to assign 3 CPUs to the virtual machine:
# prlctl set MyVM --cpus 3
set cpus(4): 3 The VM has been successfully configured.
To disable the CPU hotplug support in the MyVM virtual machine, use this command:
# prlctl set MyVM --cpu-hotplug off
set cpu hotplug: 0 The VM has been successfully configured.
The changes will come into effect on the next virtual machine start.
82
Managing Resources

Managing Disk Quotas

DISK_QUOTA
DISKSPACE
This section explains the basics of disk quotas, describes disk quota parameters as well as the following operations:
enabling and disabling per-Container quotas (p. 84)
setting Per-Container quotas (p. 85)
enabling and disabling per-user and per-group quotas in Containers (p. 85)
setting per-user and per-group quotas from inside Containers (p. 85)

What are Disk Quotas?

In the current version of Parallels Cloud Server, system administrators can limit the amount of disk space Containers can use. Such quotas are known as per-Container or first-level quotas. In addition, administrators can enable or disable per-user and per-group quotas that are known as second-level quotas and allow you to limit disk space that individual users and groups in a Container can use.
By default, first-level quotas on your server are enabled (as defined in the /etc/vz/vz.conf configuration file), whereas second-level quotas must be turned on for each Container separately (in the corresponding Container configuration files). It is impossible to turn on second-level disk quotas for a Container if first-level disk quotas are off.

Disk Quota Parameters

The table below summarizes the disk quota parameters that you can control. The File column indicates that the parameter is defined in a Container configuration file (V) or in the global configuration file but can be overridden in a Container configuration file (GV).
Parameter Description File
Enables or disables per-Container quotas for all or particular Containers. GV
The total disk space a Container may consume, in kilobytes. V
83
Managing Resources
QUOTAUGIDLIMIT
Configures per-user and per-group quotas:
V
For Containers with the Container-in-an-image-file layout), it enables (if set to a value other than 0) and disables (if set to 0) quotas.
For VZFS Containers, it sets the maximum aggregate number of user IDs and group IDs for which disk quota will be accounted. If set to 0, the UID and GID quota are disabled.
Note: This guide describes how to manage per-user and per-group quotas for Containers with the Container-in-an-image-file layout. For information on managing these quotas for VZFS Containers, consult the documentation for Parallels Server Bare Metal 5.0.

Managing Per-Container Disk Quotas

This section explains how to manage per-Container disk quotas.
Enabling and Disabling Per-Container Quotas
Per-Container disk quotas can be enabled or disabled with the DISK_QUOTA parameter in the global configuration file (/etc/vz/vz.conf). The same parameter in a Container configuration file (/etc/vz/conf/<CT_ID>.conf) overrides the one in the global configuration file. To enable quota support for some Containers and disable it for other, it is recommended to set DISK_QUOTA to yes in the global configuration file and then set it to no in the corresponding Container configuration files.
In the example below, per-Container quotas are enabled globally but disabled for Container 101:
1 Check that quota is enabled.
# grep DISK_QUOTA /etc/vz/vz.conf
DISK_QUOTA=yes
2 Check available space on the /vz partition.
# df /vz
Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda2 8957295 1421982 7023242 17% /vz
3 Set DISK_QUOTA to no in the Container 101 configuration file.
# vi /etc/vz/conf/101.conf
4 Check that quotas are disabled for Container 101.
# grep DISK_QUOTA /etc/vz/conf/101.conf
DISK_QUOTA=no
# prlctl start 101 # prlctl exec 101 df
Filesystem 1k-blocks Used Available Use% Mounted on /dev/ploop1p1 8282373 747060 7023242 10% /
As shown in the example above, a Container with quotas disabled has only one disk space limit: the available space on the partition where the Container private area is.
84
Managing Resources
Setting Quota Parameters
To set disk quotas for Containers, you use the prlctl set command. In the example below, the disk space available to Container 101 is set to 20 GB:
# prlctl set 101 --diskspace 20971520
You can check the result as follows:
# prlctl exec 101 df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/ploop1p1 20642152 737692 18855888 4% / none 131072 4 131068 1% /dev
You can change the per-Container disk quota parameters for running Containers. The changes take effect immediately.

Managing Per-User and Per-Group Disk Quotas

This section explains how to manage per-user and per-group disk quotas for Containers.
Enabling and Disabling Quotas
You can enable or disable per-user and per-group disk quotas by using the prlctl set -­quotaugidlimit command and then restarting the Container.
To enable quotas, use:
# prlctl set 100 --quotaugidlimit 1
To disable quotas, use:
# prlctl set 100 --quotaugidlimit 0
Note: This command changes the QUOTAUGIDLIMIT parameter in the Container configuration file (/etc/vz/conf/<CT_ID>.conf).
Managing Quota Parameters
Parallels Cloud Server provides the standard Linux quota package for working inside Containers:
# prlctl exec 101 rpm -q quota
quota-3.17-16.el6.x86_64
This command shows that the quota package installed in the Container is built and shipped by Parallels. Use the utilities from this package (as is prescribed in your Linux manual) to set second­level quotas for the given Container. For example:
# prlctl enter 101 CT-101-bash-4.1# edquota root
Disk quotas for user root (uid 0): Filesystem blocks soft hard inodes soft hard /dev/ploop1p1 38216 50000 60000 45454 70000 70000
CT-101-bash-4.1# repquota -a
*** Report for user quotas on device /dev/ploop1p1
85
Managing Resources
Block grace time: 00:00; Inode grace time: 00:00 Block limits File limits User used soft hard grace used soft hard grace
---------------------------------------------------------------------­root -- 38218 50000 60000 45453 70000 70000
[the rest of repquota output is skipped]
CT-101-bash-4.1# dd if=/dev/zero of=test
dd: writing to `test': Disk quota exceeded 23473+0 records in 23472+0 records out
CT-101-bash-4.1# repquota -a
*** Report for user quotas on device /dev/ploop1p1 Block grace time: 00:00; Inode grace time: 00:00 Block limits File limits User used soft hard grace used soft hard grace
---------------------------------------------------------------------­root +- 50001 50000 60000 none 45454 70000 70000
[the rest of repquota output is skipped]
The above example shows the session when the root user has the disk space quota set to the hard limit of 60,000 1KB blocks and to the soft limit of 50,000 1-KB blocks; both hard and soft limits for the number of inodes are set to 70,000.
It is also possible to set the grace period separately for block limits and inodes limits with the help of the /usr/sbin/setquota command. For more information on using the utilities from the quota package, consult the system administration guide shipped with your Linux distribution or online manual pages included in the package.

Managing Virtual Disks

In Parallels Cloud Server, you can manage virtual disks as follows:
increase the capacity of your virtual disks,
reduce the capacity of your virtual disks,
compact virtual disks (reduce the size they occupy on the physical hard drive),
change the type of your virtual disks (currently, virtual machines only).
All these operations are described in the following subsections in detail.

Changing Virtual Machine Disk Type

A virtual disk can be one of the two types:
plain. A plain virtual hard disk has a fixed size from the moment of its creation.
expanding. An expanding virtual hard disk is small initially. Its size grows as you add
applications and data to it.
86
Managing Resources
A new virtual machine is created with an expanding virtual disk. However, you can change the type of the virtual disk using either the prlctl or prl_disk_tool utility. Let us assume that the current type of the hdd0 virtual disk in the MyVM virtual machine is expanding and you want to change it to plain. To do this, you can execute one of the following commands:
# prlctl set MyVM --device-set hdd0 --type plain
or
# prl_disk_tool convert --hdd /var/parallels/MyVM/harddisk.hdd --plain
The main difference between these two commands is that prlctl requires for its execution the disk name as it is shown by the prlctl list --info command (hdd0) while prl_disk_tool needs the full path to the virtual disk drive (/var/parallels/MyVM/harddisk.hdd).
To change the disk type back to expanding, run one of the following commands:
# prlctl set MyVM --device-set hdd0 --type expand
or
# prl_disk_tool convert --hdd /var/parallels/MyVM/harddisk.hdd --expanding

Increasing Disk Capacity

If you find that the capacity of the virtual hard disk of your virtual machine or Container does not fit your needs anymore, you can increase it using the prl_disk_tool utility. For example, you can execute the following command to set the capacity for the MyVM-0.hdd disk to 80 GB:
# prl_disk_tool resize --size 80000 --hdd /vz/MyVM.pvm/MyVM-0.hdd/
This command adds additional disk space as unallocated space. You can use standard means (e.g., the Disk Management tool in Windows-based virtual machines) to allocate this space by creating a new partition or expanding an existing one.
At the same time, you can use the --resize_partition option to automatically add additional space to the last partition on the virtual disk:
# prl_disk_tool resize --size 80000 --hdd /vz/MyVM.pvm/MyVM-0.hdd/ --resize_partition
When increasing the disk capacity, keep in mind the following:
You cannot increase the capacity of a virtual disk if the virtual machine or Container using this disk is running.
The virtual machine or Container using the virtual disk you want to configure must not have any snapshots. Otherwise, the operation will fail:
# prl_disk_tool resize --size 68000 --hdd /vz/MyVM.pvm/MyVM-0.hdd/
This disk has one or more snapshots and cannot be resized. You need to delete snapshots using the prlctl tool before resizing the disk.
In this case, you should delete all existing snapshots and run the command again. To learn how to delete snapshots of a virtual machine or Container, refer to Deleting Snapshots (p. 49).
The capacity of an expanding virtual disk shown from inside the virtual machine or Container
87
Managing Resources
and the size the virtual disk occupies on the server's physical disk may differ.
prl_disk_tool
--resize_partition
Minimum without resizing prl_disk_tool
--resize_partition

Reducing Disk Capacity

Parallels Cloud Server provides a possibility to reduce the size of an expanding virtual disk by setting the limit the disk cannot exceed. In general, the process of reducing a virtual disk includes these steps:
1 Finding out the minimum capacity to which the disk can be reduced.
2 Running the prl_dsk_tool resize command to reduce the disk.
Checking the minimum disk capacity
Before reducing a virtual disk, you may wish to see the minimum capacity to which it can be reduced. To do this, use the prl_disk_tool resize --info command. For example, you can run the following command to get detailed information on the MyVM-0.hdd disk:
# prl_disk_tool resize --info --hdd /vz/MyVM.pvm/MyVM-0.hdd
Disk information: Size: 65537M Minimum: 2338M Minimum without resizing the last partition: 65523M
The information on the virtual disk is presented in the form of the following table:
Column Description
Size
Minimum
the last partition
The virtual disk disk capacity, in megabytes, as it is seen from inside the virtual machine or Container.
The virtual disk capacity, in megabytes, after resizing the disk using the
utility with the
The virtual disk capacity, in megabytes, after resizing the disk using the
utility without the
option.
option.
Reducing disk size
Once you know the minimum capacity of the virtual disk, you can reduce it. For example, to reduce the MyVM-0.hdd disk to 30 GB, you can execute the following command:
# prl_disk_tool resize --size 30G --hdd /vz/MyVM.pvm/MyVM-0.hdd --resize_partition
When reducing the disk capacity, keep in mind the following:
You cannot reduce the capacity of a virtual disk if the virtual machine or Container using this disk is running.
The virtual machine or Container using the virtual disk you want to configure must not have any snapshots. Otherwise, you will be informed of this fact:
# prl_disk_tool resize --size 68000 --hdd /vz/MyVM.pvm/MyVM-0.hdd/
This disk has one or more snapshots and cannot be resized. You need to delete snapshots using the prlctl tool before resizing the disk.
In this case, you should delete all existing snapshots and run the command again. To learn how
88
Managing Resources
to delete snapshots of a virtual machine or Container, refer to Deleting Snapshots (p. 49).
The capacity of an expanding virtual disk shown from inside the virtual machine or Container and the size the virtual disk occupies on the server's physical disk may differ.

Compacting Disks

In Parallels Cloud Server, you can decrease the space your virtual machines and Containers occupy on the Parallels server's disk drive by compacting their virtual disks. Compacting virtual disks allows you to save your server's disk space and host more virtual machines and Containers on the server.
Note: Plain disks cannot be compacted.
To compact a virtual disk, you can use the prl_disk_tool compact command. For example, to compact the MyVM-0.hdd disk, you can run this command:
# prl_disk_tool compact --hdd /vz/MyVM.pvm/MyVM-0.hdd/
To check the space that was freed by compacting the virtual disk, you can use standard Linux utilities (for example, the df utility).

Managing Virtual Machine Disk Interfaces

By default, any virtual machine is created with a SATA (Serial Advanced Technology Attachment) virtual hard disk. If necessary, you can change the interface type of a disk from SATA to SCSI (Small Computer System Interface) or IDE (Integrated Drive Electronics). For example, to change the interface type of the default disk (hdd0) in the MyVM virtual machine from SATA to SCSI, you can run the following command:
# prlctl set MyVM --device-set hdd0 --iface scsi
The VM has been successfully configured
To check that the interface type has been successfully changed, use this command:
# prlctl list -i MyVM | grep hdd0
Boot order: hdd0 cdrom0 fdd0 net0 hdd0 (+) scsi:0 image='/var/parallels/VM_SCSI.pvm/harddisk.hdd' 65536Mb
The command output shows that now the interface type of the hdd0 disk is SCSI.
You can create additional disks for the MyVM virtual machine. For example, to add a new disk of the SCSI type to the virtual machine, execute the following command:
# prlctl set MyVM --device-add hdd --iface scsi
Creating hdd1 (+) scsi:1 image='/var/parallels/MyVM.pvm/harddisk1.hdd' 65536Mb Create the expanding image file, 65536Mb... The VM has been successfully configured.
You can also create an IDE disk. To do this, specify --iface ide instead of --iface scsi in the command above. If you omit the --iface option, a SATA disk is created by default.
89
Managing Resources
The maximum number of devices (both virtual hard disks and CD/DVD-ROM drives) you can add to
no
bandwidth
a virtual machine is given below:
4 IDE devices
6 SATA devices
15 SCSI devices
At any time, you can remove the hdd1 disk from the MyVM virtual machine:
# prlctl set MyVM --device-del hdd1
Remove the hdd1 device. The VM has been successfully configured.
Notes:
1. Virtual SATA disks can be added to or removed from both running and stopped virtual machines while operations with IDE and SCSI disks can be performed on stopped virtual machines only.
2. You need to initialize a newly added disk before you can start using it. To initialize the disk, use standard means provided by your guest operating system.
3. For more information on the prlctl utility and its options, see the Parallels Cloud Server 6.0 Command Line Reference Guide.

Managing Network Accounting and Bandwidth

This section explains how to perform the following tasks in Parallels Cloud Server:
configuring network classes
viewing network traffic statistics
turning on and off network bandwidth management
configuring bandwidth limits

Network Traffic Parameters

The table below summarizes the network traffic parameters that you can control in Parallels Cloud Server.
Parameter Description
traffic_shaping
totalrate
If set to yes, traffic limitations for outgoing traffic are set for virtual machines and Containers. The default is
This parameter lists all network adapters installed on the server and their bandwidth.
This parameter defines the bandwidth to allocate for each network class. It is active if traffic shaping is turned on.
.
90
Managing Resources
rate
If traffic shaping is turned on, this parameter specifies the bandwidth guarantee for virtual
totalrate
machines and Containers.
ratebound
If this parameter is set to yes, the bandwidth guarantee (the global rate parameter) is also the limit for the virtual machine or Container, and the virtual machine or Container cannot borrow the bandwidth from the
bandwidth pool.

Configuring Network Classes

Parallels Cloud Server allows you to track the inbound and outbound network traffic as well as to shape the outgoing traffic for a virtual machine and Container. To provide the ability to distinguish between domestic and international traffic, a concept of network classes is introduced. It is important to fully understand this notion, because network classes IDs are used in the values of some network traffic parameters. A network class is a range of IP addresses for which Parallels Cloud Server counts and shapes the traffic.
Classes are specified in the /etc/vz/conf/networks_classes file. The file is in the ASCII format, and all empty lines and lines starting with the # sign are ignored. Other lines have the following format:
<class_id> <IP_address>/<prefix_length>
where <class_id> defines the network class ID, and the <IP_address>/<prefix_length> pair defines the range of IP addresses for this class. There may be several lines for each class.
Classes 0 and 1 have special meanings:
Class 0 defines the IP address range for which no accounting is performed. Usually, it corresponds to the server subnet (the server itself and its virtual machines and Containers). Setting up class 0 is not required; however, its correct setup improves performance.
Class 1 is defined by Parallels Cloud Server to match any IP address. It must be always present in the network classes definition file. Therefore, it is suggested not to change the default line in the networks_classes file.
1 0.0.0.0/0
If your virtual machines and Containers are using IPv6 addresses, you can also add the following line to this file:
1 ::/0
Other classes should be defined after class 1. They represent exceptions from the "matching­everything" rule of class 1. The example below illustrates a possible configuration of the network classes definition file containing rules for both IPv4 and IPv6 addresses:
# server networks 0 192.168.0.0/16 0 fe80::/64
# any IP address (all traffic) 1 0.0.0.0/0 1 ::/0
# class 2 – addresses for the "foreign" traffic
91
Managing Resources
2 10.0.0.0/8 2 2001:db88::/64
# inside "foreign" network there # is a hole belonging to "local" traffic 1 10.10.16.0/24 1 2001:db88:3333::/64
In this example, IPv4 addresses in the range of 192.168.0.0 to 192.168.255.255 and IPv6 addresses in the range of fe80:: to fe80::ffff:ffff:ffff:ffff are treated as class 0 addresses and no accounting is done for the traffic from virtual machines and Containers destined to these addresses.
Class 2 matches the following IP addresses:
IPv4 addresses from 10.0.0.0 to 10.255.255.255 with the exception of addresses in the sub-range of 10.10.16.0 to 10.10.16.255, which are treated as class 1.
IPv6 addresses from 2001:db88:: to 2001:db88::ffff:ffff:ffff:ffff with the exception of addresses in the sub-range of 2001:db88:3333:: to 2001:db88:3333::ffff:ffff:ffff:ffff, which are also treated as class 1.
All other IP addresses (both IPv4 and IPv6) belong to class 1.
Note: After editing the /etc/vz/conf/networks_classes file, execute either the /etc/init.d/vz accrestart or service vz accrestart command for the changes made to
the file to take effect.

Viewing Network Traffic Statistics

In Parallels Cloud Server, you can view the current network traffic statistics for virtual machines and Containers using the pnetstat utility. For example:
# pnetstat
UUID Net.Class Input(bytes) Input(pkts) Output(bytes) Output(pkts)
47406484... 0 0 0 0 0
47406484... 1 5867489 37155 58033 1010
49b66605... 0 0 0 0 0 49b66605... 1 7357952 41424 1023555 1023 101 0 0 0 0 0 101 1 58140960 66635 1025931 19408 102 0 0 0 0 0 102 1 0 0 0 0
By default, pnetstat shows network statistics for both virtual machines and Containers. In the example above, the statistics are displayed for Containers with IDs 101 and 102 and two virtual
machines with UUIDs 47406484... and 49b66605.... Keep in mind that pnetstat displays
statistics only about virtual machines and Containers which were started at least once.
The pnetstat utility displays the following information:
Column Description
UUID
92
UUID assigned to virtual machine or Container.
Managing Resources
Net.Class
ID of the network class for which network statistics is calculated.
Input(bytes)
Input(pkts)
Output(bytes)
Output(pkts)
Amount of incoming traffic, in bytes.
Amount of incoming traffic, in packets.
Amount of outgoing traffic, in bytes.
Amount of outgoing traffic, in packets.
For example, from the command output above, you can see that around 58 MB of data were uploaded to Container 101, (2) about 10 MB were downloaded from it, and all the traffic was exchanged with servers from class 1 networks.
If necessary, you can view network traffic statistics separately for virtual machine or Container by passing the -t option to pnetstat:
For Containers only:
# pnetstat -t ct
UUID Net.Class Input(bytes) Input(pkts) Output(bytes) Output(pkts) 101 0 0 0 0 0 101 1 58140960 66635 1025931 19408 102 0 0 0 0 0 102 1 0 0 0 0
For virtual machines only:
# pnetstat -t vm
UUID Net.Class Input(bytes) Input(pkts) Output(bytes) Output(pkts)
47406484... 0 0 0 0 0
47406484... 1 5867489 37155 58033 1010
49b66605... 0 0 0 0 0 49b66605... 1 7357952 41424 1023555 1023
You can also view network statistics for a particular virtual machine or Container by specifying its ID after the -v option, for example:
# pnetstat -v 101
UUID Net.Class Input(bytes) Input(pkts) Output(bytes) Output(pkts) 101 0 0 0 0 0 101 1 58140960 66635 1025931 19408
This command displays statistics only for Container 101.

Turning On and Off Network Bandwidth Management

Traffic shaping (also known as network bandwidth management) allows you to control what network bandwidth a virtual machine or Container receives for outgoing traffic. Traffic shaping is off by default in Parallels Cloud Server and is controlled by the TRAFFIC_SHAPING parameter in the /etc/vz/vz.conf global configuration file.
Note: Incoming traffic cannot be controlled for virtual machines and Containers in Parallels Cloud Server.
To turn traffic shaping on, you need to complete the following steps:
1 Set the value of TRAFFIC_SHAPING to yes in the global configuration file.
93
Managing Resources
2 Correctly set up the BANDWIDTH and TOTALRATE parameters values.
3 Start traffic shaping with the /etc/init.d/vz shaperon command.
The BANDWIDTH variable is used for specifying the network rate, in kilobits per second, of available network adapters. By default, it is set to eth0:100000, which corresponds to a 100Mb/s Fast Ethernet card. If your server has more network adapters installed, update this parameter by listing
all the adapters participating in shaping. For example, if you have two Fast Ethernet cards, set the parameter to eth0:100000 eth1:100000.
The TOTALRATE variable specifies the size of the so-called bandwidth pool for each network class being shaped. The bandwidth from the pool can be borrowed by virtual machines and Containers when they need more bandwidth for communicating with hosts from the corresponding network class. It is used to limit the total available outgoing traffic virtual machines and Containers can consume. The format of this variable is <NIC>:<network_class>:<bandwidth_in_Kbits_per_second> and defines the pool size per network class for a given network adapter. Multiple entries for different network classes and adapters can be separated by spaces. The default value for TOTALRATE is eth0:1:4000, which corresponds to the pool size of 4Mb/s for Network Class 1 on the first Ethernet adapter.
In the /etc/vz/vz.conf configuration file, you can also define the RATE variable whose value amounts to the number of kilobits per second any virtual machine and Container is guaranteed to receive for outgoing traffic with a network class on an Ethernet device. The default value of this parameter is eth0:1:8, which means that any virtual machine and Container is guaranteed to receive the bandwidth of at least 8 Kbps for sending data to Class 1 hosts on the first Ethernet device. This bandwidth is not the limit for a virtual machine and Container (unless the RATEBOUND parameter is enabled for the virtual machine or Container); the virtual machine or Container can take the needed bandwidth from the TOTALRATE bandwidth pool if it is not used by other virtual machines and Containers.
After setting up the above parameters, start bandwidth management as follows:
# /etc/init.d/vz shaperon
Starting shaping: Ok Set shaping on running Container : vz WARNING: Can't get tc class for Container(101). vz WARNING: Can't access file /var/run/vz_tc_classes. \ Creating new one. vz WARNING: Can't get tc class for Container(1).
Now you have activated the network bandwidth limits. To turn traffic shaping off temporarily, use the /etc/init.d/vz shaperoff command. If you want to disable bandwidth management permanently, set the TRAFFIC_SHAPING variable to no in the /etc/vz/vz.conf configuration file.

Configuring Network Bandwidth Management

The network bandwidth for outgoing traffic a virtual machine and Container receives is controlled by two parameters: RATE and RATEBOUND.
94
Managing Resources
Note: Incoming traffic cannot be controlled in the current version of Parallels Cloud Server.
The RATE parameter specifies the guaranteed outgoing traffic rate that a virtual machine or Container receives. This rate can be specified differently for different network classes. Bandwidth values are specified in kilobits per second (Kbps). It is recommended to increase this value in 8 Kbps increments and set it to at least 8 Kbps. The example below demonstrates how to set the RATE parameter for the MyVM virtual machine and Container 101 to 16 Kbps for network class 1 on the eth0 network adapter:
# prlctl set MyVM --rate 1:16 # prlctl set 101 --rate eth0:1:16
Note: For Containers, you can also configure the RATE parameter for different network adapters. For virtual machines, you can set this parameter for the default network adapter (usually eth0) only. The rates for all other network adapters can be configured in the /etc/vz/vz.conf global configuration file.
The RATEBOUND parameter specifies whether the network bandwidth available to virtual machine or Container for outgoing traffic is limited by the bandwidth specified in the RATE variable. By default, this parameter is turned off for all newly created virtual machines and Containers. That means that virtual machines and Containers are allowed to take free bandwidth from the TOTALRATE pool. You can turn the RATEBOUND parameter on by using the --ratebound option of the prlctl set command, for example:
# prlctl set MyVM --ratebound on # prlctl set 101 --ratebound on
The actual network bandwidth available to virtual machines and Containers depends on the number of virtual machines and Containers and the total sum of the RATE values, and normally does not coincide with the bandwidth specified in their own RATE parameters. If the RATEBOUND parameter is turned on, the virtual machine or Container bandwidth is limited by the value of the RATE parameter.
If the the RATE and RATEBOUND parameters are not set for individual virtual machines and Containers, the values from the /etc/vz/vz.conf configuration file are taken. By default, Parallels Cloud Server does not set RATEBOUND, which corresponds to no, and RATE is set to eth0:1:8.
The network bandwidth management in Parallels Cloud Server works in the following way. The bandwidth pool for a given network class (configurable through the TOTALRATE variable in the global configuration file) is divided among the virtual machines and Containers transmitting data proportionally to their RATE settings. If the total value of the RATE variables of all virtual machines and Containers transmitting data does not exceed the TOTALRATE value, each virtual machine or Container gets the bandwidth equal or greater than its RATE value (unless the RATEBOUND variable is enabled for this virtual machine or Container). If the total value of the RATE variables of all virtual machines and Containers transmitting data exceeds the TOTALRATE value, each virtual machine or Container may get less than its RATE value.
95
Managing Resources
The example below illustrates the scenario when Containers 101 and 102 have RATEBOUND set to no, and the MyVM virtual machine has RATEBOUND set to yes. With the default TOTALRATE of 4096 Kbps and RATE of 8 Kbps, the bandwidth pool will be distributed according to the following table:
Container 101 Container 102 MyVM Consumed Bandwidth
transmits idle idle Container 101: 4096 Kbps
idle idle transmits MyVM: 8 Kbps
transmits transmits idle Container 101: 2048 Kbps
Container 102: 2048 Kbps
transmits idle transmits Container 101: 4032 Kbps
MyVM: 8 Kbps
transmits transmits transmits Container 101: 2016 Kbps
Container 102: 2016 Kbps Container 103: 8 Kbps
Once you configure the bandwidth settings, activate your changes by running the following command:
# /etc/init.d/vz shaperrestart
Stopping shaping: Ok Starting shaping: Ok Set shaping on running Container: Ok
This command clears off all existing shaping settings and sets them again using the configuration files of running virtual machines and Containers.

Managing Disk I/O Parameters

This section explains how to manage disk input and output (I/O) parameters in Parallels Cloud Server systems.

Configuring Priority Levels for Virtual Machines and Containers

In Parallels Cloud Server, you can configure the disk I/O (input/output) priority level of virtual machines and Containers. The higher the I/O priority level, the more time the virtual machine or Container will get for its disk I/O activities as compared to the other virtual machines and Containers on the server. By default, any virtual machine and Container on the server has the I/O priority level set to 4. However, you can change the current I/O priority level in the range from 0 to 7 using the --ioprio option of the prlctl set command. For example, you can issue the following command to set the I/O priority of Container 101 and the MyVM virtual machine to 6:
# prlctl set 101 --ioprio 6 # prlctl set MyVM --ioprio 6
To check the I/O priority level currently applied to Container 101 and the MyVM virtual machine, you can execute the following commands:
96
Managing Resources
For Container 101:
# grep IOPRIO /etc/vz/conf/101.conf
IOPRIO="6"
For the MyVM virtual machine:
# prlctl list --info | grep ioprio
cpu 2 VT-x accl=high mode=32 cpuunits=1000 ioprio=6 iolimit=0

Configuring Disk I/O Bandwidth

In Parallels Cloud Server, you can configure the bandwidth virtual machines and Containers are allowed to use for their disk input and output (I/O) operations. Limiting the disk I/O bandwidth can help you prevent the situations when high disk activities in one virtual machine or Container (generated, for example, by transferring huge amounts of data to/from the virtual machine or Container) can slow down the performance of other virtual machines and Containers on the Parallels server.
By default, the I/O bandwidth limit for all newly created virtual machines and Containers is set to 0, which means that no limits are applied to any virtual machines and Containers. To limit the disk I/O bandwidth for a virtual machine or Container, you can use the --iolimit option of the prlctl set command. For example, the following command sets the I/O bandwidth limit for the MyVM virtual machine to 10 megabytes per second (MB/s):
# prlctl set MyVM --iolimit 10
Set up iolimit: 10485760 The VM has been successfully configured.
To set the limit for a Container, just specify its ID instead of the virtual machine name, for example:
# prlctl set 101 --iolimit 10
Set up iolimit: 10485760 Saved parameters for Container 101
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 (1G).
K: sets the limit in kilobytes per second (10K).
B: sets the limit in bytes per second (10B).
Note: In the current version of Parallels Cloud Server, the maximum I/O bandwidth limit you can set for a virtual machine and Container is 2 GB per second.
To check that the I/O speed limit has been successfully applied to the MyVM virtual machine and Container 101, use the prlctl list command:
# prlctl list MyVM -o iolimit
110485760
# prlctl list 101 -o iolimit
IOLIMIT 10485760
97
Managing Resources
At any time, you can remove the I/O bandwidth limit set for the MyVM virtual machine and Container 101 by running these commands:
# prlctl set MyVM --iolimit 0
Set up iolimit: 0 The VM has been successfully configured.
# prlctl set 101 --iolimit 0
Set up iolimit: 0 Saved parameters for Container 101

Configuring the Number of I/O Operations Per Second

In Parallels Cloud Server, you can limit the maximum number of disk input and output operations per second virtual machines and Containers are allowed to perform (known as the IOPS limit). You may consider setting the IOPS limit for virtual machines and Containers with high disk activities to ensure that they do not affect the performance of other virtual machines and Containers on the Node.
By default, any newly created virtual machine or Container does not have the IOPS limit set and can perform so many disk I/O operations per second as necessary. To set the IOPS limit, you can use the --iopslimit option of the prlctl set command. For example, to allow Container 101 and the MyVM virtual machine to perform no more than 100 disk I/O operations per second, you can run the following commands:
# prlctl set 101 --iopslimit 100 # prlctl set MyVM --iopslimit 100
To ensure that the IOPS limit has been successfully applied to Container 101 and the MyVM virtual machine, use the pstat -A command:
# pstat -A
ST IOUSED IOWAIT IO IOPS NAME OK 0.00 0.00 0.0/---KB/s 0.0/100/s MyVM OK 0.00 0.00 0.0/---KB/s 0.0/100/s 101
The IOPS columns shows the IOPS limits currently applied to Container 101 and the MyVM virtual machine.
At any time, you can remove the set IOPS limits by running these commands:
# prlctl set 101 --iopslimit 0 # prlctl set MyVM --iopslimit 0

Viewing Disk I/O Statistics

In Parallels Containers 4.6, you can view disk input and output (I/O) statistics for virtual machines and Containers. To display the I/O statistics for all running virtual machines and Containers on the physical server, you can run the pstat utility with the -a option. For example:
# pstat -a
7:18pm, up 1 day, 1:29, 2 users, load average: 0.00, 0.01, 0.00 CTNum 1, procs 127: R 2, S 125, D 0, Z 0, T 0, X 0 CPU [ OK ]: CTs 0%, CT0 1%, user 0%, sys 2%, idle 98%, lat(ms) 12/0 Mem [ OK ]: total 1560MB, free 627MB/402MB (low/high), lat(ms) 0/0 ZONE0 (DMA): size 16MB, act 0MB, inact 0MB, free 11MB (0/0/0)
98
Managing Resources
ZONE1 (Normal): size 880MB, act 76MB, inact 104MB, free 616MB (3/4/5)
IOUSED%
IO
IOPS
ZONE2 (HighMem): size 684MB, act 116MB, inact 153MB, free 402MB (0/1/1) Mem lat (ms): A0 0, K0 0, U0 0, K1 0, U1 0 Slab pages: 65MB/65MB (ino 43MB, de 9MB, bh 2MB, pb 0MB) Swap [ OK ]: tot 2502MB, free 2502MB, in 0.000MB/s, out 0.000MB/s Net [ OK ]: tot: in 0.005MB/s 45pkt/s, out 0.000MB/s 1pkt/s lo: in 0.000MB/s 0pkt/s, out 0.000MB/s 0pkt/s eth0: in 0.005MB/s 45pkt/s, out 0.000MB/s 1pkt/s br0: in 0.000MB/s 0pkt/s, out 0.000MB/s 0pkt/s br1: in 0.000MB/s 0pkt/s, out 0.000MB/s 0pkt/s Disks [ OK ]: in 0.000MB/s, out 0.000MB/s
ST IOUSED IOWAIT IO IOPS NAME OK 0.00 0.00 0.0/---KB/s 0.0/--/s 101 OK 0.00 0.00 0.0/---KB/s 0.0/--/s MyVM
The information related to the virtual machines and Containers disk I/O statistics is at the end of the command output. The table below explains the displayed I/O parameters:
Parameter Description
IOWAIT%
Percentage of time the disks are used by the virtual machine or Container.
Percentage of time when at least one I/O transaction in the virtual machine or Container is waiting for being served.
I/O rate and limit, in bytes, kilobytes, megabytes, or gigabytes per second.
I/O operations rate and limit, in operations per second.
The pstat -a command outputs the disk I/O statistics for all virtual machines and Containers that are currently running on the physical server. In the example output above, this statistics is shown for Container 101 and for the MyVM virtual machine.
Note: For more information on pstat and its options, see the Parallels Cloud Server 6.0 Command Line Reference Guide.

Setting Disk I/O Limits for Container Backups and Migrations

The operations of backing up, restoring, and migrating Containers can generate a high disk I/O load on the server, thus slowing down the performance of other Containers or of the server itself. You can avoid such situations by setting disk I/O limits for these operations.
To set a disk I/O limit, do the following:
1 Open the Parallels Cloud Server global configuration file for editing, for example:
# vi /etc/vz/vz.conf
2 Locate the following section in the file:
# VZ Tools IO limit # To enable - uncomment next line, check the value - there should not be CT with the same ID # VZ_TOOLS_BCID=2 # Uncomment next line to specify required disk IO bandwidth in Bps (10485760 - 10MBps) # VZ_TOOLS_IOLIMIT=10485760
3 Edit this section as follows:
99
Managing Resources
a Uncomment the VZ_TOOLS_BCID parameter to enable disk I/O limits for backup, restore,
and migration operations. When defining the parameter, make sure that no Container with the specified ID exists on the server.
b Uncomment the VZ_TOOLS_IOLIMIT parameter, and set the disk I/O limit for backup,
restore, and migration operations. The value is set in bytes per second.
4 Save the file.
When setting disk I/O limits, pay attention to the following:
VZ_TOOLS_BCID and VZ_TOOLS_IOLIMIT are global parameters—that is, once these parameters are set, they have effect on all Containers on the server.
The VZ_TOOLS_BCID and VZ_TOOLS_IOLIMIT parameters control the disk I/O load only for backup, restore, and migration operations.

Locating Disk I/O Bottlenecks for Containers

In some situations, the disk I/O subsystem may bottleneck a Parallels Cloud Server server and reduce the performance of Containers or the server itself. Such I/O bottlenecks are often caused by disk-intensive processes running in Containers, for example, by transferring huge amounts of data to or from a Container.
To pinpoint Containers generating the highest disk I/O load, follow these steps:
1 On the problem server, run the pstat utility to display I/O statistics for all running Containers.
You may want to use the following I/O options with the utility: id, cpu_iowait, cpu_iowait_acc, io, iops, swapin. For example:
# pstat -o id,cpu_iowait,cpu_iowait_acc,io,iops,swapin
... CTID CPU IOWAIT ACC IOWAIT IO IOPS SWAPIN 1 0.00% 0.00% 0.0/---KB/s 0.0/--/s 0.0/s 101 0.00% 0.00% 0.0/---KB/s 0.0/--/s 0.0/s 111 25.0% 28.0% 23/---MB/s 419/--/s 0.0/s
2 In the command output, find the Container with the highest values. Most probably, this is the
Container that generates the highest I/O load on the server. In the example above, this is Container 111.
3 Once you have found the problem Container, run the vziotop -o -E <CT_ID> command
to show all threads running in this Container and generating I/O load. To sort the output by I/O load, use the left and right arrow keys to select the IO column. For example:
# vziotop -o -E 111
Total DISK READ : 4.77 M/s | Total DISK WRITE : 270.00 K/s Actual DISK READ: 4.77 M/s | Actual DISK WRITE: 354.63 K/s CTID TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND 111 1026959 be/4 root 932.72 K/s 250.00 K/s 0.00% 42.84% {output skipped]; 111 1026960 be/4 root 202.20 K/s 20.00 K/s 0.00% 11.53% {output skipped];
The command output shows that thread 1026959 produces the highest I/O load and might be responsible for the server performance degradation.
100
Loading...