<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aandreev</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Aandreev"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Aandreev"/>
	<updated>2026-04-30T02:55:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC_configuration_examples&amp;diff=3210</id>
		<title>UBC configuration examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC_configuration_examples&amp;diff=3210"/>
		<updated>2007-06-27T12:41:26Z</updated>

		<summary type="html">&lt;p&gt;Aandreev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UBC toc}}&lt;br /&gt;
&lt;br /&gt;
Table [[UBC configuration examples table]] contains example settings of the system resources&lt;br /&gt;
parameters. There are 4 example configurations — A, B, C and D, in the&lt;br /&gt;
order of increasing Virtual Environment power.&lt;br /&gt;
&lt;br /&gt;
“Power” represents the power of the Virtual Environment. It is shown&lt;br /&gt;
as the RAM size of the computer slash number of Virtual Environments of&lt;br /&gt;
this type that can be run on such a computer. &lt;br /&gt;
&lt;br /&gt;
In all examples it's assumed, that the system has swap space twice bigger than the RAM, so total virtual memory size is 3*(RAM size). But it's not OpenVZ specific requirement to have so much swap space - you can configure your swap as you usually do in linux and even don't have it at all.&lt;br /&gt;
&lt;br /&gt;
“Helper values” are intermediate values, produced during computation&lt;br /&gt;
of the resource control parameter limits. These values help to understand&lt;br /&gt;
the process of computing the limits and verify the result. “Total mem”&lt;br /&gt;
represents the total amount of RAM allowed to be used to each Virtual&lt;br /&gt;
Environment, “kernel mem” is its kernel fraction (consisting of &amp;lt;code&amp;gt;kmemsize&amp;lt;/code&amp;gt;&lt;br /&gt;
and all socket buffers) and “user mem” is the memory allowed to be allocated&lt;br /&gt;
to processes. &amp;lt;code&amp;gt;Avnumproc&amp;lt;/code&amp;gt; is the expected avarage number of processes, as used&lt;br /&gt;
in recommendations in [[UBC consistency check]].&lt;br /&gt;
&lt;br /&gt;
For parameters having distinctive &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt; the values of the&lt;br /&gt;
barrier and the limit are shown separated by “/” sign.&lt;br /&gt;
&lt;br /&gt;
All values are given in their “natural units of measurement” (except were&lt;br /&gt;
the units are explicitly specified). The natural units of measurement are the&lt;br /&gt;
units in which the values are accepted by [[vzctl]] command and stored in&lt;br /&gt;
Virtual Environment configuration file.&lt;br /&gt;
&lt;br /&gt;
For parameters with names ending in “pages” the natural units of measurement are pages.&lt;br /&gt;
For other memory parameters (&amp;lt;code&amp;gt;[[kmemsize]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[dcachesize]]&amp;lt;/code&amp;gt;&lt;br /&gt;
and all socket buffers) the units are bytes. For the remaining parameters&lt;br /&gt;
(such as &amp;lt;code&amp;gt;[[numproc]]&amp;lt;/code&amp;gt;) the units are items.&lt;br /&gt;
&lt;br /&gt;
== Explanation of the examples ==&lt;br /&gt;
&lt;br /&gt;
=== Example A === &lt;br /&gt;
This is a configuration of a most “light” Virtual Environment.&lt;br /&gt;
It has 15 processes on average and can have up to 40 network connections.&lt;br /&gt;
This configuration allows to run a simple Web server, handling static and&lt;br /&gt;
dynamic pages produced by simple scripts and accessible over ssh and ftp.&lt;br /&gt;
Configurations of apache and FTP servers must be adjusted to reduce the&lt;br /&gt;
number of spawned processes and memory consumption.&lt;br /&gt;
&lt;br /&gt;
A computer with 2GB of RAM (+ 4GB swap) can run up to 400 of such Virtual Environments.&lt;br /&gt;
&lt;br /&gt;
Here is an example &amp;lt;code&amp;gt;pstree(1)&amp;lt;/code&amp;gt; output inside such a Virtual Environment:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@test /root]# pstree&lt;br /&gt;
init-+-crond&lt;br /&gt;
     |-httpd---20*[httpd]&lt;br /&gt;
     |-sendmail&lt;br /&gt;
     |-sshd&lt;br /&gt;
     |-syslogd&lt;br /&gt;
     `-xinetd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example B ===&lt;br /&gt;
Example B is a configuration for a not “heavy” and not very loaded server.&lt;br /&gt;
It can be a dynamic Web server, mail, FTP or DNS server (but not a combination of them).&lt;br /&gt;
The configuration assumes 40 processes on average and&lt;br /&gt;
up to 80 network connections.&lt;br /&gt;
&lt;br /&gt;
A computer with 2GB of RAM (+ 4GB swap) can run up to 120 of such Virtual Environmentrs.&lt;br /&gt;
&lt;br /&gt;
=== Example C ===&lt;br /&gt;
A configuration for a “heavy” server: Web application&lt;br /&gt;
server with a database backend or any other server consuming a considerable&lt;br /&gt;
amount of memory and other resources. Mail and FTP servers having&lt;br /&gt;
up to 200 simultaneous clients can also work with this configuration. The&lt;br /&gt;
configuration is designed for 200 processes on average, up to 500 network&lt;br /&gt;
connections and about 250MB of RAM for each Virtual Environment.&lt;br /&gt;
&lt;br /&gt;
=== Example D ===&lt;br /&gt;
Example D is a configuration for 1 Virtual Environment on a computer&lt;br /&gt;
and emulates a stand-alone server. It roughly corresponds to the default&lt;br /&gt;
configuration of a stand-alone Linux system.&lt;br /&gt;
&lt;br /&gt;
'''Caution''': it is not a safe configuration. Like a stand-alone Linux system,&lt;br /&gt;
it can hang if too much memory is consumed. It isn't a security problem,&lt;br /&gt;
because it is a configuration for only 1 Virtual Environment on a computer.&lt;br /&gt;
However, to make the configuration more robust and protect the system from&lt;br /&gt;
silent hangs, &amp;lt;code&amp;gt;[[numproc]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[kmemsize]]&amp;lt;/code&amp;gt; and&lt;br /&gt;
other parameters should be limited to lower values. For example, a&lt;br /&gt;
configuration produced by multiplying the limits&lt;br /&gt;
from [[{{PAGENAME}}#Example C|Example C]] by 4 is a safe configuration.&lt;br /&gt;
&lt;br /&gt;
== Not specified values ==&lt;br /&gt;
&lt;br /&gt;
For compatibility with future versions, the &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt;s of &amp;lt;code&amp;gt;[[vmguarpages]]&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;[[oomguarpages]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[physpages]]&amp;lt;/code&amp;gt; should be set to [[MAX_ULONG]]. The &amp;lt;code&amp;gt;barrier&amp;lt;/code&amp;gt; of&lt;br /&gt;
&amp;lt;code&amp;gt;[[physpages]]&amp;lt;/code&amp;gt; should be set to 0.&lt;/div&gt;</summary>
		<author><name>Aandreev</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=2398</id>
		<title>Quick installation (legacy)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=2398"/>
		<updated>2006-10-12T09:32:56Z</updated>

		<summary type="html">&lt;p&gt;Aandreev: /* rpm or yum? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document briefly describes the steps needed to install OpenVZ on your machine.&lt;br /&gt;
&lt;br /&gt;
This document is also available in the following languages: [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=35&amp;amp;amp;#msg_35 French],  [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=1805&amp;amp;amp;#msg_1805 German].&lt;br /&gt;
&lt;br /&gt;
OpenVZ consists of a kernel, user-level tools, and VE templates. This guide tells how to install the kernel and the tools.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
This guide assumes you are running recent release of Fedora Core (like FC5) or RHEL/CentOS 4. Currently, OpenVZ kernel tries to support the same hardware that Red Hat kernels support. For full hardware compatibility list, see [http://www.virtuozzo.com/en/products/virtuozzo/hcl/ Virtuozzo HCL].&lt;br /&gt;
&lt;br /&gt;
=== rpm or yum? ===&lt;br /&gt;
&lt;br /&gt;
In case you have yum utility available on your system, you may want to use it effectively to install and update OpenVZ packages. In case you don't have yum, or don't want to use it, you can use plain old rpm. Instructions for both rpm and yum are provided below.&lt;br /&gt;
&lt;br /&gt;
=== yum pre-setup ===&lt;br /&gt;
If you want to use yum, you should set up OpenVZ yum repository first.&lt;br /&gt;
&lt;br /&gt;
Download [http://download.openvz.org/openvz.repo openvz.repo] file and put it to your &amp;lt;code&amp;gt;/etc/yum.repos.d/&amp;lt;/code&amp;gt; repository. This can be achieved by the following commands, as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /etc/yum.repos.d&lt;br /&gt;
# wget http://download.openvz.org/openvz.repo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you can not cd to /etc/yum.repos.d, it means either yum is not installed on your system, or yum version is too old. In that case, just stick to rpm installation method.&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the kernel yourself rather than use the one provided by OpenVZ, see [[kernel build]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what “flavor” of the kernel you want to install. Please refer to [[Kernel flavors]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
Run the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install ovzkernel[-flavor]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
Get the kernel binary RPM from the [http://openvz.org/download/kernel/ Download » Kernel] page, or directly from [http://download.openvz.org/kernel/ download.openvz.org/kernel], or from one of its [[Download mirrors|mirrors]]. You need only one kernel RPM so please [[Kernel flavors|choose the appropriate one]] depending on your hardware.&lt;br /&gt;
&lt;br /&gt;
Next, install the kernel RPM you chose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ihv ovzkernel[-flavor]*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;tt&amp;gt;rpm -U&amp;lt;/tt&amp;gt; (where &amp;lt;tt&amp;gt;-U&amp;lt;/tt&amp;gt; stands for ''upgrade'') should '''not''' be used, otherwise all currently installed kernels will be uninstalled.}}&lt;br /&gt;
&lt;br /&gt;
== Configuring the bootloader ==&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/grub.conf&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title Fedora Core (2.6.8-022stab029.1)&lt;br /&gt;
       root (hd0,0)&lt;br /&gt;
       kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=0x31B&lt;br /&gt;
       initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;Fedora Core&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;OpenVZ&amp;lt;/tt&amp;gt; (just for clarity reasons, so the OpenVZ kernels will not be mixed up with non OpenVZ ones). Remove extra arguments from the kernel line, leaving only the &amp;lt;tt&amp;gt;root=...&amp;lt;/tt&amp;gt; parameter. The modifed portion of &amp;lt;tt&amp;gt;/etc/grub.conf&amp;lt;/tt&amp;gt; should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title OpenVZ (2.6.8-022stab029.1)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5&lt;br /&gt;
        initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
Please make sure the following steps are performed before rebooting into OpenVZ kernel.&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There is a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SELinux ===&lt;br /&gt;
&lt;br /&gt;
SELinux should be disabled. To that effect, put the following line to &amp;lt;code&amp;gt;/etc/sysconfig/selinux&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELINUX=disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conntracks ===&lt;br /&gt;
&lt;br /&gt;
In the stable OpenVZ kernels (those that are 2.6.8-based) netfilter connection tracking for [[VE0]] is disabled by default. If you have a stateful firewall enabled on the host node (it is there by default) you should either disable it, or enable connection tracking for [[VE0]].&lt;br /&gt;
&lt;br /&gt;
To enable conntracks for VE0, add the following line to &amp;lt;code&amp;gt;/etc/modprobe.conf&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
options ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|in kernels later than 2.6.8, connection tracking is enabled by default}}&lt;br /&gt;
&lt;br /&gt;
== Rebooting into OpenVZ kernel ==&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose &amp;quot;OpenVZ&amp;quot; on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ.&lt;br /&gt;
&lt;br /&gt;
== Installing the utilities ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
&lt;br /&gt;
Download the binary RPMs of these utilities from [http://openvz.org/download/utils/ Download » Utils], or directly from [http://download.openvz.org/utils/ download.openvz.org/utils], or from one of its [[Download mirrors|mirrors]]. Install them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -Uhv vzctl*.rpm vzquota*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If rpm complains about unresolved dependencies, you'll have to satisfy them first, then repeat the installation.&lt;br /&gt;
&lt;br /&gt;
When all the tools are installed, start the OpenVZ subsystem.&lt;br /&gt;
&lt;br /&gt;
== Starting OpenVZ ==&lt;br /&gt;
&lt;br /&gt;
As root, execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /sbin/service vz start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all the needed OpenVZ kernel modules. This script should also start all the VPSs marked to be auto-started on machine boot (there aren't any yet).&lt;br /&gt;
&lt;br /&gt;
During the next reboot, this script should be executed automatically.&lt;br /&gt;
&lt;br /&gt;
== Next steps ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ is now set up on your machine. To load OpenVZ kernel by default, edit the default line in the /boot/grub/grub.conf file to point to the OpenVZ kernel. For example, if the OpenVZ kernel is the first kernel mentioned in the file, put it as default 0. See man grub.conf for more details.&lt;br /&gt;
&lt;br /&gt;
The next step is to prepare the [[OS template]]: please continue to [[OS template cache preparation]] document.&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Aandreev</name></author>
		
	</entry>
</feed>