SWsoft, Inc. OpenVZ User's Guide Version 2.7.0-8 © 2005
Preface 10 General Conventions Be aware of the following conventions used in this book. Chapters in this guide are divided into sections, which
Reference 100 vzctl exec, vzctl exec2, and vzctl enter These commands are used to run arbitrary commands inside a Virtual Private Server being auth
Reference 101 -o parameter[.specifier] This option is used to display only particular information about the VPSs. The parameters and their specifie
Reference 102 kmemsize .m, .b, .l, .f KMEMSIZE Size of unswappable kernel memory (in bytes), allocated for internal kernel structures of the proces
Reference 103 numpty .m, .b, .l, .f NPTY Number of pseudo-terminals. For example, ssh session, screen, xterm application consumes pseudo-terminal
Reference 104 Allowed CPU power. This is a positive integer number, which determines the minimal guaranteed share of the CPU the Virtual Private Se
Reference 105 OpenVZ quota works on a file system sub-tree or area. If this area has additional file systems mounted to its subdirectories quota wi
Reference 106 -e, --block-exptime time Required. Expiration time for excess of the block soft limit. Time can be specified in two formats: dd:h
Reference 107 vzquota on and vzquota off These commands are used to turn quota on and off. Their syntax is as follows: vzquota [options] on vpsid [
Reference 108 -b, --block-softlimit num -B, --block-hardlimit num -e, --block-exptime time -i, --inode-softlimit num -I, --inode-hardlimit num -n,
Reference 109 vzquota stat and vzquota show These commands are used for querying quota statistics. The syntax is as below: vzquota [options] show v
11 C HAPTER 2 OpenVZ Philosophy In This Chapter About OpenVZ Software ...
Reference 110 Template Management Utilities A template is basically a set of packages from some Linux distribution used to populate a VPS. An OS te
Reference 111 vzpkgcache This utility creates/updates template caches for OS templates. You should run this utility before you can use a newly inst
Reference 112 Supplementary Tools vzdqcheck This utility counts inodes and disk space used using the same algorithm as OpenVZ quota. It has the fol
Reference 113 Quotas must be turned off when the vzdqload utility is working. Mind that only 2nd-level disk quotas are handled by the utilities. v
Reference 114 vzsplit This utility is used to generate a sample VPS configuration file with a set of system resource control parameters. The syntax
Glossary 115 Glossary Hardware Node (or Node) is a computer where OpenVZ is installed for hosting Virtual Private Servers. HN is an abbreviation of
Glossary 116 VPS is an abbreviation of Virtual Private Server. VENET device is a virtual networking device, a gateway from a VPS to the external ne
117 Index Failure to Start VPS • 78 A Feedback • 10 Finding Kernel Function That Caused D Process State • 77 About OpenVZ Software • 11 About This
Index 118 Supplementary Tools • 112 Matrix of OpenVZ Command Line Utilities • 91 System Requirements • 20 Matrix of OpenVZ Configuration Files • 81
Index 119 W What are Disk Quotas? • 48 What are Resource Control Parameters? • 46 What is OpenVZ • 11 Who Should Read This Guide • 7
OpenVZ Philosophy 12 OpenVZ Applications OpenVZ provides a comprehensive solution for Hosting Service Providers allowing them to: Have hundreds
OpenVZ Philosophy 13 OS Virtualization From the point of view of applications and Virtual Private Server users, each VPS is an independent system.
OpenVZ Philosophy 14 Resource Management OpenVZ Resource Management controls the amount of resources available to Virtual Private Servers. The con
OpenVZ Philosophy 15 Main Principles of OpenVZ Operation Basics of OpenVZ Technology In this section we will try to let you form a more or less pr
OpenVZ Philosophy 16 OpenVZ is installed in such a way that you will be able to boot your computer either with OpenVZ support or without it. This
OpenVZ Philosophy 17 Understanding Templates A template is a VPS building block. An OS template is a set of packages needed to operate a VPS. Temp
OpenVZ Philosophy 18 Understanding Licenses The OpenVZ software consists of the OpenVZ kernel and user-level tools, which are licensed by means of
OpenVZ Philosophy 19 Hardware Node Availability Considerations Hardware Node availability is more critical than the availability of a typical PC s
ISBN: N/A SWsoft Inc 13755 Sunrise Valley Drive Suite 325 Herndon, VA 20171 USA Tel: +1 (703) 815 5670 Fax: +1 (703) 815 5675 Copyright © 2005 by SWs
20 C HAPTER 3 Installation and Preliminary Operations The current chapter provides exhaustive information on the process of installing and deployin
Installation and Preliminary Operations 21 Hardware Compatibility The Hardware Node requirements for the standard 32-bit edition of OpenVZ are the
Installation and Preliminary Operations 22 Network Requirements The network pre-requisites enlisted in this subsection will help you avoid delays
Installation and Preliminary Operations 23 Installing and Configuring Host Operating System on Hardware Node This section explains how to install
Installation and Preliminary Operations 24 Disk Partitioning On the Disk Partitioning Setup screen, select Manual partition with Disk Druid. Do no
Installation and Preliminary Operations 25 It is suggested to use the ext3 file system for the /vz partition. This partition is used for holding a
Installation and Preliminary Operations 26 Finishing OS Installation After the proper partitioning of your hard drive(s), proceed in accordance wi
Installation and Preliminary Operations 27 Installing OpenVZ Software Downloading and Installing OpenVZ Kernel First of all, you should download t
Installation and Preliminary Operations 28 # On Hardware Node we generally need # packet forwarding enabled and proxy arp disabled net.ipv4.ip_for
Installation and Preliminary Operations 29 Downloading and Installing OpenVZ Packages After you have successfully installed and booted the OpenVZ
3 Contents Preface 7 About This Guide ...
Installation and Preliminary Operations 30 You can also use one of the already pre-cached OS templates available at http://openvz.org/download/tem
31 C HAPTER 4 Operations on Virtual Private Servers This chapter describes how to perform day-to-day operations on separate Virtual Private Servers
Operations on Virtual Private Servers 32 Choosing Virtual Private Server ID Every Virtual Private Server has a numeric ID, also known as VPS ID, a
Operations on Virtual Private Servers 33 Choosing OS Template Next, you shall decide on which OS template you want to base the new VPS. There migh
Operations on Virtual Private Servers 34 In principle, now you are ready to start your newly created Virtual Private Server. However, typically yo
Operations on Virtual Private Servers 35 Setting Network Parameters In order to be accessible from the network, a Virtual Private Server shall be
Operations on Virtual Private Servers 36 Setting root Password for VPS By default, the root account is locked in a newly created VPS, and you cann
Operations on Virtual Private Servers 37 Starting, Stopping, Restarting, and Querying Status of Virtual Private Server When a Virtual Private Serv
Operations on Virtual Private Servers 38 vzctl has a two-minute timeout for the VPS shutdown scripts to be executed. If the VPS is not stopped in
Operations on Virtual Private Servers 39 Listing Virtual Private Servers Very often you may want to get an overview of the Virtual Private Servers
Contents 4 Configuring Virtual Private Server...34 S
Operations on Virtual Private Servers 40 Deleting Virtual Private Server You can delete a Virtual Private Server that is not needed anymore with t
Operations on Virtual Private Servers 41 Running Commands in Virtual Private Server Usually, a Virtual Private Server administrator logs in to the
42 C HAPTER 5 Managing Templates A template is basically a set of packages from some Linux distribution used to populate a VPS. An OS template cons
Managing Templates 43 List of packages this template comprises Locations of (network) package repositories Scripts needed to be executed
Managing Templates 44 Listing Templates The vzpkgls utility allows you to list the templates installed on the Hardware Node. They may be already u
Managing Templates 45 Working with VPS If you need to update an already existing VPS with the newer packages available from distribution repositor
46 C HAPTER 6 Managing Resources The main goal of resource control in OpenVZ is to provide Service Level Management or Quality of Service (QoS) for
Managing Resources 47 System This group of parameters defines various aspects of using system memory, TCP sockets, IP packets and like parameters
Managing Resources 48 What are Disk Quotas? Disk quotas enable system administrators to control the size of Linux file systems by limiting the amo
Managing Resources 49 Turning On and Off Per-VPS Disk Quotas The parameter that defines whether to use first-level disk quotas is DISK_QUOTA in th
Contents 5 Reference 80 Configuring OpenVZ...
Managing Resources 50 Setting Up Per-VPS Disk Quota Parameters Three parameters determine how much disk space and inodes a Virtual Private Server
Managing Resources 51 Turning On and Off Second-Level Quotas for Virtual Private Server The parameter that controls the second-level disk quotas i
Managing Resources 52 Setting Up Second-Level Disk Quota Parameters In order to work with disk quotas inside a VPS, you should have standard quota
Managing Resources 53 Checking Quota Status As the Hardware Node system administrator, you can check the quota status for any Virtual Private Serv
Managing Resources 54 cpuunitsThis is a positive integer number that determines the minimal guaranteed share of the CPU time the corresponding Vir
Managing Resources 55 Managing System Parameters The resources a Virtual Private Server may allocate are defined by the system resource control pa
Managing Resources 56 tcprcvbufThe total size of receive buffers for TCP sockets, i.e. the amount of kernel memory allocated for the data received
Managing Resources 57 Monitoring System Resources Consumption It is possible to check the system resource control parameters statistics from withi
Managing Resources 58 # for res in tcpsendbuf tcprcvbuf unixsockbuf sockrcvbuf kmemsize; \ do echo;echo "$res usage for all VEs, in MB:"
Managing Resources 59 Monitoring Memory Consumption You can monitor a number of memory parameters for the whole Hardware Node and for particular V
6 Table of Figures Figure 1: OpenVZ Technology ...15
Managing Resources 60 The union of RAM and swap space is the main computer resource determining the amount of memory available to applications. If
Managing Resources 61 2 Using OpenVZ specialized utilities for preparing configuration files in their entirety. The tasks these utilities perform
Managing Resources 62 Validating Virtual Private Server Configuration The system resource control parameters have complex interdependencies. Viola
63 C HAPTER 7 Advanced Tasks In This Chapter Determining VPS ID by Process ID...
Advanced Tasks 64 Determining VPS ID by Process ID Each process is identified by a unique PID (process identifier), which is the entry of that pro
Advanced Tasks 65 root@vps101's password: Last login: Mon Oct 28 23:25:58 2002 from 10.100.40.18 [root@vps101 root]# date Mon Oct 28 23:31:57
Advanced Tasks 66 Accessing Devices from Inside Virtual Private Server It is possible to grant a Virtual Private Server read, write, or read/write
Advanced Tasks 67 p primary partition (1-4) p Partition number (1-4): 2 First cylinder (256-2231, default 256): Using default value 256 Last
Advanced Tasks 68 Moving Network Adapter to Virtual Private Server By default, all the VPSs on a Node are connected among themselves and with the
Advanced Tasks 69 Enabling VPN for VPS Virtual Private Network (VPN) is a technology which allows you to establish a secure network connection eve
7 C HAPTER 1 Preface In This Chapter About This Guide...
Advanced Tasks 70 Loading iptables Modules to Hardware Node To have certain iptables modules loaded on the Hardware Node startup, you should provi
Advanced Tasks 71 Rebooting Virtual Private Server When you issue the reboot command at your Linux box console, the command makes the reboot syste
72 C HAPTER 8 Troubleshooting This chapter provides the information about those problems that may occur during your work with OpenVZ and suggests t
Troubleshooting 73 General Considerations The general issues to take into consideration when troubleshooting your OpenVZ system are listed below. Y
Troubleshooting 74 Nmap run completed -- 1 IP address (1 host up) scanned in 169 seconds to check if any ports are open that should normally b
Troubleshooting 75 Kernel Troubleshooting Using ALT+SYSRQ Keyboard Sequences Press ALT+SYSRQ+H (3 keys simultaneously) and check what's printe
Troubleshooting 76 Saving Kernel Fault (OOPS) You can use the following command to check for the kernel messages that should be decoded and reporte
Troubleshooting 77 Finding Kernel Function That Caused D Process State If there are too many processes in the D state and you can't find out w
Troubleshooting 78 Failure to Start VPS An attempt to start a Virtual Private Server fails. Solution 1 If there is a message on the system console:
Troubleshooting 79 Solution 2 Make sure the routing to the Virtual Private Server is properly configured. Virtual Private Servers can use the defau
Preface 8 Organization of This Guide Chapter 2, OpenVZ Philosophy, is a must-read chapter that helps you grasp the general principles of OpenVZ ope
80 C HAPTER 9 Reference In order to make OpenVZ successfully accomplish its tasks you need to understand how to configure OpenVZ correctly. This se
81 Configuring OpenVZ In order to make OpenVZ successfully accomplish its tasks you need to understand how to configure OpenVZ correctly. This chap
Reference 82 Global OpenVZ Configuration File OpenVZ keeps its system wide configuration parameters in the /etc/sysconfig/vz configuration file. Th
Reference 83 Disk quota parameters allow you to control the disk usage by the Virtual Private Servers: Parameter Description Default value DISK_Q
Reference 84 Supplementary parameters define other OpenVZ settings: Parameter Description Default value VZWDOGDefines whether the vzwdog module i
Reference 85 Resource management parameters control the amount of resources a VPS can consume. They are described in the Managing Resources chapter
Reference 86 AVNUMPROCNumber of processes expected to run in the Virtual Private Server on average. This is informational parameter used by utiliti
Reference 87 NUMFILENumber of files opened by all VPS processes. 512…8192NUMFLOCKNumber of file locks created by all VPS processes. 50…200 – 60…220
Reference 88 Overview Along with OpenVZ configuration files responsible for the OpenVZ system configuration, there are a number of OpenVZ scripts a
Reference 89 The normal order of executing action scripts is shown in the figure below. The mount and umount scripts run in the context of the Host
Preface 9 Typographical Conventions The following kinds of formatting in the text identify special information. Formatting convention Type of Infor
Reference 90 Action scripts are located in the same directory as VPS configuration files and have names like vpsid.action. The global scripts are n
91 OpenVZ Command Line Interface OpenVZ is shipped with a number of command line tools. This chapter documents the utilities, which are supported i
Reference 92 vzctl vzctl is the primary tool for Virtual Private Server management. To use it, you have to log in to the Hardware Node as the root
Reference 93 vzctl create This command is used to create a new Virtual Private Server. It has the following syntax: vzctl create vpsid [--ostemplat
Reference 94 vzctl destroy The syntax of this command is: vzctl destroy vpsid This command is used to delete a Virtual Private Server, which is no
Reference 95 You should use action scripts (mount/umount and start/stop) if you would like to carry out some actions upon VPS startup/shutdown. The
Reference 96 --noatime yes|no Sets the noatime flag (do not update inode access times) on the VPS file system. The default is yes for a Class 1 VPS
Reference 97 Resource management settings control the amount of resources a VPS can consume. If the setting has bar:lim after it than this setting
Reference 98 --othersockbuf bar:lim Total size in bytes of UNIX-domain socket buffers, UDP and other datagram protocol send buffers. --dgramrcvbuf
Reference 99 --diskspace bar:lim Total size of disk space consumed by VPS, in 1 Kb blocks. When the space used by a Virtual Private Server hits the
Kommentare zu diesen Handbüchern