Parallels Cloud Server - 6.0 User Manual

Parallels Cloud Server 6.0
Templates Management 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 ............................................................................................................... 5
About Parallels Cloud Server 6.0 ..................................................................................... 6
About This Guide ............................................................................................................ 7
Organization of This Guide .......................................................................................................7
Documentation Conventions ....................................................................................................7
Getting Help .................................................................................................................... 8
Feedback ........................................................................................................................ 9
Templates Overview ................................................................................................ 10
EZ Templates Basics ..................................................................................................... 12
EZ Template Directory Structure .................................................................................... 14
Differences Between OS and Application EZ Templates ................................................. 16
EZ Template Life Cycle .................................................................................................. 17
Managing EZ Templates ......................................................................................... 18
Creating an EZ Template ............................................................................................... 18
Creating a Template from Official Templates ......................................................................... 19
Creating a Template from Scratch ......................................................................................... 19
Setting Up Repositories and Proxy Servers for EZ Templates ......................................... 25
Managing Default Repositories .............................................................................................. 26
Creating a Local Repository .................................................................................................. 28
Setting Up a Proxy Server for EZ Templates .......................................................................... 32
Setting Up Repositories with vzcreaterepo ............................................................................ 35
Preparing an OS EZ Template for Container Creation ..................................................... 37
Installing Application EZ Templates on the Server ........................................................... 39
Viewing Installed EZ Templates on the Server ................................................................ 39
Viewing Available EZ Templates on the Server ............................................................... 40
Keeping EZ Templates Up To Date ................................................................................ 40
Updating EZ Templates on the Server ................................................................................... 41
Updating OS EZ Template Caches ........................................................................................ 42
Updating EZ Templates Packages Inside a Container ........................................................... 43
Contents
Adding Application EZ Templates to Containers ............................................................. 44
Copying EZ Templates to Another Server....................................................................... 45
Removing an Application from Containers ...................................................................... 46
Removing EZ Templates From the Server ...................................................................... 47
Glossary ................................................................................................................... 48
Index ........................................................................................................................ 50
Feedback ............................................................................................................... 9
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
Parallels Cloud Server basics (p. 6)
goals and target audience of the guide (p. 7)
guide organization (p. 7)
documentation conventions used in the guide (p. 7)
resources to consult to get more information on Parallels Cloud Server (p. 8)
ways to submit feedback to the Parallels documentation team (p. 9)
In This Chapter
About Parallels Cloud Server 6.0 ............................................................................. 6
About This Guide .................................................................................................... 7
Getting Help ........................................................................................................... 8
Introduction

About Parallels Cloud Server 6.0

Parallels Cloud Server 6.0 is a virtualization solution that allows you to simultaneously run multiple Parallels virtual machines and Containers on a single physical server. With Parallels Cloud Server, you can efficiently share your server's hardware resources among virtual machines and Containers.
Parallels Cloud Server is installed directly on the server hardware and does not need any operating system to function. Once it is installed, Parallels Cloud Server allows you to create virtual machines and Containers and manage them using the following tools:
Parallels command-line interface (CLI). The command-line interface comprises a set of
Parallels command-line utilities that you can use to manage virtual machines and Containers, both locally and remotely.
Parallels Virtual Automation (PVA). Parallels Virtual Automation is a remote management tool
that allows you to manage physical servers and their virtual machines and Containers with the help of a standard Web browser on any platform.
Graphically, a server with the Parallels Cloud Server software installed can be represented as follows:
6
Introduction

About This 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 your Parallels server resources (physical memory, disk space, etc.). In particular, you will learn how to create your own application templates and manage them in a number of different ways.
The primary audience for this guide is anyone who is intended to deploy one or several applications inside their Containers and looking for ways to do it with the maximal level of efficiency. To complete all the operations described in this guide, no more than basic Linux administration habits is required.

Organization of This Guide

This guide is organized in the following way:
Chapter 1, Introduction (p. 5), gives an overview of the Parallels Cloud Server product and this guide.
Chapter 2, Templates Overview (p. 10), provides general information on Parallels Cloud Server templates: what templates are, the advantages of their usage in Parallels-based systems, etc.
Chapter 3, Managing EZ Templates (p. 18), provides instructions on managing OS and application EZ templates. You will know how to create and install EZ templates on the Parallels server, add them to and remove them from Containers, make OS template caches and update them, etc.

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.
7
Introduction
Italics
Preformatted
Saved parameters for Container
Monospace Bold
C:\vzlist -a
Monospace
Key+Key Key combinations for which the
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.
user must press and hold down one key and then press another.
These are the so-called OS templates.
To remove a Container, type prlctl delete ctid.
Use prlctl start to start a Container.
101
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. Unlike 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 (for example, installing Parallels Cloud Server in unattended mode).
Parallels Cloud Server 6.0 User's Guide. This guide provides comprehensive information on Parallels Cloud Server covering the necessary theoretical conceptions as well as all practical aspects of working with the product. However, it does not deal with the process of installing and configuring your system.
Parallels 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.
8
Introduction

Feedback

If you spot a typo in this guide, or if you have an opinion about how to make this guide more helpful, you can share your comments and suggestions with us by completing the Documentation Feedback form on our website (http://www.parallels.com/en/support/usersdoc/).
9
EZ Templates Basics .............................................................................................. 12
C
HAPTER
2

Templates Overview

A template in Parallels Cloud Server 6.0 is a set of application and configuration files installed on a Parallels server in such a way as to be usable by any Container. Parallels Cloud Server provides tools for creating templates, installing and removing them on/from Parallels servers, adding them to Containers, and so on.
Using templates, you can:
Securely share RAM among similar applications running in different Containers to save hundreds of megabytes of memory
Install applications and patches simultaneously in many Containers
Use different versions of an application on different Containers (for example, perform an
upgrade only in certain Containers)
There are two types of templates in Parallels Cloud Server. These are OS templates and application templates. 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 pre-installed operating system. An application template is a set of repackaged software packages optionally accompanied with configuration scripts. Parallels Cloud Server uses application templates 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.
In Parallels Cloud Server, you can perform the following operations on templates:
create new application templates
list the templates currently installed on the Parallels server
install templates on and remove them from the Parallels server
add templates to Containers
remove templates from the Parallels server and from Containers
migrate templates from one Parallels server to another
All these operations are described in Managing EZ Templates (p. 18) in detail.
Note: The current version of Parallels Cloud Server does not support using templates in virtual machines.
In This Chapter
Templates Overview
EZ Template Directory Structure ............................................................................. 14
Differences Between OS and Application EZ Templates ........................................... 16
EZ Template Life Cycle ........................................................................................... 17
11
Templates Overview

EZ Templates Basics

All OS and application EZ templates are defined by the following features:
EZ templates do not carry the necessary package files inside themselves. They contain only the information about what packages should be installed on the Parallels server to make the templates fully operational and from what network repository these packages should be downloaded.
Note: For the sake of brevity, we will be saying throughout this guide that packages are included in EZ templates, which actually means that EZ templates contain the information on the corresponding packages without carrying the packages themselves.
The dependencies of software packages included in an EZ template are automatically resolved during the packages installation on the Parallels server. So, if the specified packages require other packages to be installed, these packages are also downloaded from the repository and installed on the server. In case a package has requirements that conflict with existing software on the server or any dependencies for the package being installed cannot be satisfied, the package installation process fails without making any changes to the system.
The EZ templates technology allows you to use the original OS and application vendor's packages and to receive the updated packages from a central repository right after their release.
One of the basic concepts in the EZ template technology is the concept of 'repository' where software packages for the given EZ template are stored. A repository is a prepared directory or website containing the packages and index files for Linux operating systems and/or any of their applications. An example of such a repository is the repository located at the http://mirrors.usc.edu/pub/linux/distributions/fedora/ website and storing software packages for Fedora Core releases. Using repositories gives you the following advantages:
Software packages included in the given EZ template do not contain versions, but only names (e.g. bash, crontabs). So, you always update any package included in the EZ template to its latest version available in the repository.
As a result of the fact that a list of packages does not provide their versions, EZ templates do not have versions either (e.g. redhat-el5-x86). Thus, you install any EZ template on the Parallels server only once and, after that, use the installed template to update the packages inside any Container where it is applied.
You can create several OS EZ template sets for one and the same Linux operating system. Any OS EZ template you are provided with has the default packages set included in it and is called the base OS EZ template. However, you can make your own OS EZ template sets (the so­called non-base OS EZ template sets) which may differ from the corresponding base template:
in the number of packages included in these EZ template sets
in the number and location of repositories to be used for these EZ template sets
in the number and kind of scripts to be executed on different EZ template sets life cycle
12
stages
Templates Overview
Non-base OS EZ template sets must have their own names and are created by appending a random identifier to the base OS EZ template name. For example, if you wish your Container to run Red Hat Enterprise Linux 5 and to function as a Linux-based server only, you can create the redhat-el5-x86-server OS EZ template set and include only those packages in it that are needed for performing main server tasks. So, you can specify packages to be used for setting up file and print sharing and exclude all the packages for graphical interfaces (GNOME and KDE).
Parallels Cloud Server provides you with a vzpkg tool allowing you to automatically locate and obtain the correct packages for your EZ templates from one or several package repositories. The packages are downloaded from the repository and installed on the Parallels server in one of the following cases:
when creating a cache for an OS EZ template
when updating an existing OS EZ template cache (if there are new packages available in the
repository)
when adding an application EZ template or package to the first Container
when updating EZ templates or software packages inside a destination Container
Note: For details on how to manage software package repositories, see Setting Up Repository and Proxy Servers for EZ Templates (p. 25).
13
Templates Overview

EZ Template Directory Structure

All EZ templates and the software packages included in them and installed on the Parallels server are located in the so-called template area the path to which is set as the value of the TEMPLATE variable in the /etc/vz/vz.conf file. By default, the /vz/template directory is used. The template area includes two main subdirectories:
The cache subdirectory where the tar archive of the potential private area of a Container based on the corresponding OS EZ template is stored. The tar archive is created during the OS EZ template caching. Keep in mind that the OS EZ template should be obligatorily cached before you can start creating Containers on its basis.
The template directory having the name of <os_name>/<os_version>/<arch> where:
<os_name> denotes the name of the Linux distribution for which the OS EZ template is
created (e.g. redhat, centos).
<os_version> is the version of the Linux distribution specified as <os_name> (e.g., 5 or
6).
<arch> denotes the microprocessor architecture where the OS EZ template is to be run
(x86, x86-64, ia64).
For example, after installing the 32-bit version of the Centos 6 EZ template, the /vz/template/centos/6/x86 directory on the Parallels server is created.
In its turn, the <arch> directory contains the following subdirectories and areas:
The template configuration subdirectory including:
The config/os/default directory where the appropriate configuration files for the base
OS EZ template are stored.
The config/os/<setname> directory where the appropriate configuration files for non-
base OS EZ templates, if any, are stored.
The config/app/<app_name>/default directory where the appropriate configuration
files for the base application EZ template are stored. This directory is created if at least one application EZ template for the given OS EZ template is installed on the Parallels server.
The config/app/<app_name>/<setname> directory where the appropriate
configuration files for non-base application EZ templates, if any, are stored.
The packages area containing a number of software packages downloaded from the repository and installed on the Parallels server. An installed package has the following structure:
<name>-<epoch>:<version>-<release>.<arch>
where:
<name> is the package name.
<epoch> denotes the package epoch.
14
Templates Overview
<version> indicates the package version.
<release> is the package release.
<arch> denotes the microprocessor architecture where the package is to be used.
One or several subdirectories containing the packages comprising the corresponding OS EZ
template. The directories have the following names:
baseN for the base OS template
<setname>N for the non-base OS template with the name of <setname>, if any
<appname>N for the base application template
<appname>-<setname>N for the application template with the name of <setname>, if
any
N denotes the index number of the URL specified in the repositories/mirrorlist file (see the information on the repositories/mirrorlist file below).
As has been mentioned above, the configuration directory (i.e. /<template_area>/<template_directory>/config) contains a number of subdirectories storing 'EZ templates'-related configuration files. The contents of these subdirectories can vary depending on whether it is a base OS EZ template or a non-base one and on the EZ template type (OS or application template). The most important configuration files are listed below:
Data files:
packages: contains a list of software packages names included in the corresponding EZ
template.
package_manager: specifies the packaging system used to handle the EZ template.
repositories: a list of repositories where the packages comprising the EZ template are
stored.
mirrorlist: one or several URLs to the file containing a list of repositories from where the
packages comprising the EZ template are to be downloaded.
distribution: the name of the Linux distribution for which the EZ template is created.
This file should be absent for application EZ templates.
summary: brief information on the EZ template.
description: detailed information on the EZ template. As distinct from the summary file,
it can contain additional data relevant for the EZ template.
environment: a list of environment variables set in the form of key=value.
Scripts:
pre-cache: this script is executed before installing the packages included in the EZ
template on the Parallels server.
post-cache: this script is executed after installing the packages included in the EZ
template on the Parallels server.
15
Templates Overview
pre-install: this script is executed before adding the EZ template to or installing the
package inside the Container.
post-install: this script is executed after adding the EZ template to or installing the
package inside the Container.
pre-upgrade: this script is executed before updating the packages inside the Container.
post-upgrade: this script is executed updating the packages inside the Container.
pre-remove: this script is executed before removing the application EZ template/package
from the Container.
post-remove: this script is executed after removing the application EZ template/package
from the Container.
Document files: one or several files with arbitrary names containing the information on the EZ template (e.g. README).
Note: Detailed information on the files contained in the OS template configuration directory is provided in the Parallels Cloud Server 6.0 Command Line Reference Guide.
While working with EZ template configuration files, keep in mind the following:
The packages file should be specified for all EZ templates.
The packages, package_manager, and repositories/mirrorlist files should be
specified for all base OS EZ templates.
The package_manager and distribution files should be specified for all base OS EZ templates and absent for non-base OS EZ templates and all application EZ templates.
The information from the repositories/mirrorlist files created for non-base OS and all application EZ templates is added to that in the repositories/mirrorlist files for the base OS EZ template.

Differences Between OS and Application EZ Templates

Listed below are the major differences between OS and application EZ templates:
OS templates are used to create new Containers, whereas application templates provide additional software for already created Containers.
OS templates may and usually do use action scripts, whereas application templates cannot use action scripts in the current version of Parallels Cloud Server.
You may define a list of compatible templates and a list of required templates for application templates.
16
Loading...
+ 35 hidden pages