<?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=Grin</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=Grin"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Grin"/>
	<updated>2026-06-13T22:31:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User_talk:Kir&amp;diff=13358</id>
		<title>User talk:Kir</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User_talk:Kir&amp;diff=13358"/>
		<updated>2013-01-29T10:33:35Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* G+ */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi Kir - thanks for your updates to the [[DHCP]] page. Do you use #openvz on freenode? [[User:Mrjcleaver|Mrjcleaver]] 10:53, 1 June 2008 (EDT)&lt;br /&gt;
: Yes, I am usually in the channel during work hours (my timezone is GMT+3, Moscow) --[[User:Kir|Kir]] 21:33, 1 June 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Hi Kir, please add the following warning to the list of precreated templates page. Cheers, Chris.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
WARNING: DO NOT USE the CentOS 6 template: it has this bug:&lt;br /&gt;
&lt;br /&gt;
https://www.virtualmin.com/node/21124&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== G+ ==&lt;br /&gt;
&lt;br /&gt;
Your G+ forwarder doesn't. ;-) --[[User:Grin|Grin]] ([[User talk:Grin|talk]]) 05:33, 29 January 2013 (EST)&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC_interdependencies_table&amp;diff=13357</id>
		<title>UBC interdependencies table</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC_interdependencies_table&amp;diff=13357"/>
		<updated>2013-01-29T10:19:23Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* See also */ code here too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UBC toc}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Interdependency !! Importance&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;kmemsize_{bar} \ge 40KB \cdot avnumproc + dcachesize_{lim}&amp;lt;/math&amp;gt; || {{mandatory}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;privvmpages_{bar} \ge vmguarpages_{bar}&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;tcpsndbuf_{lim} - tcpsndbuf_{bar} \ge 2.5KB \cdot numtcpsock&amp;lt;/math&amp;gt; || {{mandatory}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt; othersockbuf_{lim} - othersockbuf_{bar} \ge 2.5KB \cdot numothersock&amp;lt;/math&amp;gt; || {{mandatory}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;tcprcvbuf_{lim} - tcprcvbuf_{bar} \ge 2.5KB \cdot numtcpsock&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;tcprcvbuf_{bar} \ge 64KB&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;tcpsndbuf_{bar} \ge 64KB&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;dgramrcvbuf_{bar} \ge 129KB&amp;lt;/math&amp;gt; || {{optional}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;othersockbuf_{bar} \ge 129KB&amp;lt;/math&amp;gt; || {{optional}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;numfile \ge avnumproc \cdot 32&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;dcachesize_{bar} \ge numfile \cdot 384\ \rm(bytes)&amp;lt;/math&amp;gt; || {{recommended}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;barrier \le limit&amp;lt;/math&amp;gt; || {{mandatory}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[UBC consistency check]]&lt;br /&gt;
* [[user:grin/openvz checker.pl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC_consistency_check&amp;diff=13356</id>
		<title>UBC consistency check</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC_consistency_check&amp;diff=13356"/>
		<updated>2013-01-29T10:15:34Z</updated>

		<summary type="html">&lt;p&gt;Grin: code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UBC toc}}&lt;br /&gt;
&lt;br /&gt;
System resource control parameters have certain interdependencies. Constraints on the parameter settings are listed below. Indexes &amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lim&amp;lt;/code&amp;gt; in the formulae below mean the barrier and the limit of the parameters, respectively.&lt;br /&gt;
&lt;br /&gt;
Configuration of resource control parameters for a container&lt;br /&gt;
is invalid if these constraints are not satisfied. The best way to ensure the&lt;br /&gt;
validity of the configuration is to use the {{man|vzcfgvalidate|8}} utility.&lt;br /&gt;
&lt;br /&gt;
All the interdependencies discussed below and their importance are summarized in [[UBC interdependencies table]].&lt;br /&gt;
&lt;br /&gt;
The configured limits can be checked through&lt;br /&gt;
* &amp;lt;code&amp;gt;/proc/user_beancounters&amp;lt;/code&amp;gt; interface;&lt;br /&gt;
* container configuration files in &amp;lt;code&amp;gt;/etc/vz/conf/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== kmemsize should be enough for the expected number of processes ==&lt;br /&gt;
&amp;lt;math&amp;gt;kmemsize_{bar} \ge 40KB \cdot avnumproc + dcachesize_{lim}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;code&amp;gt;avnumproc&amp;lt;/code&amp;gt; here stands for the expected average number of processes).&lt;br /&gt;
&lt;br /&gt;
This constraint is important for applications to work reliably in the&lt;br /&gt;
container.&lt;br /&gt;
If it is not satisfied, applications will start to fail in the middle of&lt;br /&gt;
operations instead of failing while spawning more processes&lt;br /&gt;
and the application's ability to handle resource shortage will be very&lt;br /&gt;
limited.&lt;br /&gt;
&lt;br /&gt;
== Memory allocation limits should not be less than the guarantee ==&lt;br /&gt;
&amp;lt;math&amp;gt; privvmpages_{bar} \ge vmguarpages_{bar}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this constraint is not satisfied, &amp;lt;code&amp;gt;vmguarpages&amp;lt;/code&amp;gt; will not work.&lt;br /&gt;
&lt;br /&gt;
== Send buffers should have enough space for all sockets ==&lt;br /&gt;
&amp;lt;math&amp;gt;tcpsndbuf_{lim} - tcpsndbuf_{bar} \ge 2.5KB \cdot numtcpsock&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;othersockbuf_{lim} - othersockbuf_{bar} \ge 2.5KB \cdot numothersock&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These constraints are also important.&lt;br /&gt;
If they are not satisfied, transmission of data over the sockets&lt;br /&gt;
may hang in some circumstances.&lt;br /&gt;
&lt;br /&gt;
== Other TCP socket buffers should be big enough ==&lt;br /&gt;
&amp;lt;math&amp;gt;tcprcvbuf_{lim} - tcprcvbuf_{bar} \ge 2.5KB \cdot numtcpsock&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;tcprcvbuf_{bar} \ge 64KB&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;tcpsndbuf_{bar} \ge 64KB&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Selecting the left side equal to the right side in the inequalities&lt;br /&gt;
above ensures minimal performance of network communications.&lt;br /&gt;
Increasing the left side will increase performance to a certain extent.&lt;br /&gt;
&lt;br /&gt;
== UDP socket buffers should be large enough if the system is not tight on memory ==&lt;br /&gt;
&amp;lt;math&amp;gt;dgramrcvbuf_{bar} \ge 129KB&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;othersockbuf_{bar} \ge 129KB&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These constraints are desired, but not essential.&lt;br /&gt;
Large enough buffers for UDP sockets improve reliability of datagram delivery.&lt;br /&gt;
However, note that if the UDP traffic is so bursty that it needs larger&lt;br /&gt;
buffers, the datagrams will likely be lost not because of resource control&lt;br /&gt;
limits, but because of other memory and performance limitations.&lt;br /&gt;
&lt;br /&gt;
== Number of files limit should be adequate for the expected number of processes ==&lt;br /&gt;
&amp;lt;math&amp;gt;numfile \ge avnumproc \cdot 32&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that each process after a &amp;lt;code&amp;gt;execve(2)&amp;lt;/code&amp;gt; system call&lt;br /&gt;
requires a file for each loaded shared library.&lt;br /&gt;
A too low &amp;lt;code&amp;gt;numfile&amp;lt;/code&amp;gt; limit will increase the chances of failures&lt;br /&gt;
during &amp;lt;code&amp;gt;execve(2)&amp;lt;/code&amp;gt; calls with error messages that are not clear&lt;br /&gt;
to the users.&lt;br /&gt;
&lt;br /&gt;
== The limit on the total size of &amp;lt;code&amp;gt;dentry&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;inode&amp;lt;/code&amp;gt; structures locked in memory should be adequate for allowed number of files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;dcachesize_{bar} \ge numfile \cdot 384\ \rm(bytes)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A too low &amp;lt;code&amp;gt;dcachesize&amp;lt;/code&amp;gt; limit will increase the chances of&lt;br /&gt;
file operation refusals resulting in unexpected application failures. &lt;br /&gt;
&lt;br /&gt;
== Barrier should be less or equal than limit ==&lt;br /&gt;
In addition to the conditions listed above,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;barrier \le limit&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should be maintained for each parameter.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
See [[User:Grin/openvz checker.pl]] for a contributed code to check the consistency.&lt;br /&gt;
&lt;br /&gt;
[[Category:Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC&amp;diff=13355</id>
		<title>UBC</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC&amp;diff=13355"/>
		<updated>2013-01-29T10:13:14Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* See also */  program to check the settings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''UBC''', or '''User Beancounters''' — a set of limits and guarantees controlled per [[container]]. UBC is the major component of OpenVZ [[resource management]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
{{UBC toc/body}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* http://blog.maxgarrick.com/understanding-openvz-resource-limits/&lt;br /&gt;
* [[User:Grin/openvz checker.pl]]&lt;br /&gt;
&lt;br /&gt;
[[Category: UBC]]&lt;br /&gt;
[[Category: Definitions]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin/openvz_checker.pl&amp;diff=13354</id>
		<title>User:Grin/openvz checker.pl</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin/openvz_checker.pl&amp;diff=13354"/>
		<updated>2013-01-29T10:12:29Z</updated>

		<summary type="html">&lt;p&gt;Grin: sharing is caring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/perl&lt;br /&gt;
#$Id: openvz_checker.pl,v 1c29ac915688 2009/12/09 21:17:13 grin $&lt;br /&gt;
#(c)Peter &amp;quot;grin&amp;quot; Gervai, 2009; grin(a)grin(dot)hu&lt;br /&gt;
# GPLv2 / CC-BY-SA 3.0&lt;br /&gt;
#&lt;br /&gt;
# check openvz resource settings&lt;br /&gt;
# based on wiki pages&lt;br /&gt;
#&lt;br /&gt;
# Usage: just run it on the VE0 (host) system as root.&lt;br /&gt;
&lt;br /&gt;
use strict;&lt;br /&gt;
use warnings;&lt;br /&gt;
&lt;br /&gt;
use IO::File;&lt;br /&gt;
use Data::Dumper;&lt;br /&gt;
&lt;br /&gt;
my $dir_bc = &amp;quot;/proc/bc&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
my $CUR=0;&lt;br /&gt;
my $MAX=1;&lt;br /&gt;
my $BAR=2;&lt;br /&gt;
my $LIM=3;&lt;br /&gt;
&lt;br /&gt;
# ia32...&lt;br /&gt;
my $PAGESIZE=4096;&lt;br /&gt;
&lt;br /&gt;
my @allsocketbuf = qw( tcprcvbuf  tcpsndbuf  dgramrcvbuf  othersockbuf );&lt;br /&gt;
&lt;br /&gt;
opendir( DIR, $dir_bc );&lt;br /&gt;
my @veids = grep { /^\d+/ &amp;amp;&amp;amp; -d &amp;quot;$dir_bc/$_&amp;quot; }  readdir(DIR);&lt;br /&gt;
closedir( DIR );&lt;br /&gt;
&lt;br /&gt;
my %res;&lt;br /&gt;
for my $veid ( @veids ) {&lt;br /&gt;
    next if $veid == 0;&lt;br /&gt;
    my $f = new IO::File &amp;quot;&amp;lt; $dir_bc/$veid/resources&amp;quot; or next;&lt;br /&gt;
    while( &amp;lt;$f&amp;gt; ) {&lt;br /&gt;
        chomp;&lt;br /&gt;
        # trim spaces&lt;br /&gt;
        s/^\s*(.*?)\s*$/$1/;&lt;br /&gt;
        my @data = split /\s+/;&lt;br /&gt;
        #                        held, maxheld, barrier, limit, failcnt&lt;br /&gt;
        $res{$veid}{$data[0]} = [ @data[1..5] ];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
## total ram&lt;br /&gt;
my $ram = qx( free | grep Mem: ); chomp $ram;&lt;br /&gt;
$ram = (split /\s+/, $ram)[1];&lt;br /&gt;
print &amp;quot;RAM=$ram\n&amp;quot;;&lt;br /&gt;
$ram *= 1024;&lt;br /&gt;
&lt;br /&gt;
## swap&lt;br /&gt;
my $swap = qx( free | grep Swap: ); chomp $swap;&lt;br /&gt;
$swap = (split /\s+/, $swap)[1];&lt;br /&gt;
print &amp;quot;SWAP=$swap\n&amp;quot;;&lt;br /&gt;
$swap *= 1024;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my $sum;&lt;br /&gt;
### low mem x86_32&lt;br /&gt;
# max lowram 832MB&lt;br /&gt;
my $lowram = $ram &amp;gt; 832000000 ? 832000000 : $ram;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################&lt;br /&gt;
####### system wide config&lt;br /&gt;
###############################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################&lt;br /&gt;
## utilisation&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'kmemsize'}-&amp;gt;[$CUR];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$CUR];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Low memory (x86_32) Utilisation: &amp;quot;, &amp;amp;pretty($sum / (0.4 * $lowram));&lt;br /&gt;
print &amp;quot;  ( &amp;lt;1 OK; &amp;lt;2 unsafe; &amp;gt;2 dangerous)\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################&lt;br /&gt;
## commitment level&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'kmemsize'}-&amp;gt;[$LIM];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$LIM];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Low memory (x86_32) Commitment: &amp;quot;, &amp;amp;pretty($sum / (0.4 * $lowram));&lt;br /&gt;
print &amp;quot;  ( &amp;lt;1 OK; &amp;lt;1.5 acceptable; &amp;gt;2 not recommended)\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
############################&lt;br /&gt;
#### total ram&lt;br /&gt;
## utilisation&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'physpages'}-&amp;gt;[$CUR] * $PAGESIZE;&lt;br /&gt;
    $b += $res{$veid}{'kmemsize'}-&amp;gt;[$CUR];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$CUR];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
print &amp;quot;Total RAM utilisation: &amp;quot;, &amp;amp;pretty($sum / $ram);&lt;br /&gt;
print &amp;quot;  ( &amp;lt;0.8 low; &amp;lt;1 ok; &amp;gt;1 impossible)\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
############################&lt;br /&gt;
#### total ram+swap&lt;br /&gt;
## utilisation&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'oomguarpages'}-&amp;gt;[$CUR] * $PAGESIZE;&lt;br /&gt;
    $b += $res{$veid}{'kmemsize'}-&amp;gt;[$CUR];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$CUR];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
print &amp;quot;RAM+swap utilisation: &amp;quot;, &amp;amp;pretty($sum / ($ram+$swap));&lt;br /&gt;
my $low_bound = &amp;amp;pretty($ram / ($ram+$swap));&lt;br /&gt;
my $hi_bound  = &amp;amp;pretty(($ram + 0.5*$swap) / ($ram+$swap));&lt;br /&gt;
print &amp;quot;  ( &amp;lt;$low_bound low; between ok; &amp;gt;$hi_bound bad)\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## commitment&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'oomguarpages'}-&amp;gt;[$BAR] * $PAGESIZE;&lt;br /&gt;
    $b += $res{$veid}{'kmemsize'}-&amp;gt;[$LIM];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$LIM];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
print &amp;quot;RAM+swap commitment: &amp;quot;, &amp;amp;pretty($sum / ($ram+$swap));&lt;br /&gt;
print &amp;quot;  ( &amp;lt;0.8 low; &amp;lt;1 ok; &amp;gt;1 not recommended)\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## allocations&lt;br /&gt;
$sum=0;&lt;br /&gt;
foreach my $veid (keys %res) {&lt;br /&gt;
    my $b = $res{$veid}{'privvmpages'}-&amp;gt;[$LIM] * $PAGESIZE;&lt;br /&gt;
    $b += $res{$veid}{'kmemsize'}-&amp;gt;[$LIM];&lt;br /&gt;
    foreach my $sb (@allsocketbuf) {&lt;br /&gt;
        $b += $res{$veid}{$sb}-&amp;gt;[$LIM];&lt;br /&gt;
    }&lt;br /&gt;
    $sum += $b;&lt;br /&gt;
}&lt;br /&gt;
print &amp;quot;RAM+swap allocations: &amp;quot;, &amp;amp;pretty($sum / ($ram+$swap));&lt;br /&gt;
print &amp;quot;  ( &amp;lt;1.5 low; &amp;lt;4 ok; &amp;gt;4 not recommended [oom])\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################&lt;br /&gt;
####### per VE configs&lt;br /&gt;
###############################&lt;br /&gt;
foreach my $veid (sort { $a &amp;lt;=&amp;gt; $b }  keys %res) {&lt;br /&gt;
    #            &amp;lt;numproc&amp;gt; should be average process num&lt;br /&gt;
    &amp;amp;compare( $veid, $res{$veid}{'kmemsize'}-&amp;gt;[$BAR],&lt;br /&gt;
    40*1024*$res{$veid}{'numproc'}-&amp;gt;[$CUR] + $res{$veid}{'dcachesize'}-&amp;gt;[$LIM],&lt;br /&gt;
            &amp;quot;kmemsize(bar)&amp;quot;, &amp;quot;numproc~dcachesize&amp;quot;, &amp;quot;kmemsize low for # of processes&amp;quot; );&lt;br /&gt;
    &lt;br /&gt;
    &amp;amp;compare( $veid, $res{$veid}{'privvmpages'}-&amp;gt;[$BAR], $res{$veid}{'vmguarpages'}-&amp;gt;[$BAR],&lt;br /&gt;
    &amp;quot;privvmpages&amp;quot;,&amp;quot;vmguarpages&amp;quot;, &amp;quot;mem alloc less than guarantee&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    &amp;amp;compare( $veid, $res{$veid}{'tcpsndbuf'}-&amp;gt;[$LIM] - $res{$veid}{'tcpsndbuf'}-&amp;gt;[$BAR], &lt;br /&gt;
    2.5*1024*$res{$veid}{'numtcpsock'}-&amp;gt;[$LIM], &lt;br /&gt;
    &amp;quot;tcpsndbuf(lim-bar)&amp;quot;, &amp;quot;numtcpsock(lim{bytes})&amp;quot;, &amp;quot;tcp may hang&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &amp;amp;compare( $veid, $res{$veid}{'othersockbuf'}-&amp;gt;[$LIM] - $res{$veid}{'othersockbuf'}-&amp;gt;[$BAR],&lt;br /&gt;
    2.5*1024*$res{$veid}{'numothersock'}-&amp;gt;[$LIM],&lt;br /&gt;
    &amp;quot;othersockbuf(lim-bar)&amp;quot;, &amp;quot;numothersock{bytes}&amp;quot;, &amp;quot;othersock may hang&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &amp;amp;compare( $veid, $res{$veid}{'tcprcvbuf'}-&amp;gt;[$LIM] - $res{$veid}{'tcprcvbuf'}-&amp;gt;[$BAR],&lt;br /&gt;
    2.5*1024*$res{$veid}{'numothersock'}-&amp;gt;[$LIM],&lt;br /&gt;
    &amp;quot;tcprcvbuf(lim-bar)&amp;quot;,&amp;quot;numothersock{bytes}&amp;quot;,&amp;quot;may slow tcp&amp;quot; );&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    if( $res{$veid}{'tcprcvbuf'}-&amp;gt;[$BAR] &amp;lt; 65535 ) {&lt;br /&gt;
        print &amp;quot;$veid: tcprcvbuf too low (&amp;lt;64k)\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    if( $res{$veid}{'tcpsndbuf'}-&amp;gt;[$BAR] &amp;lt; 65535 ) {&lt;br /&gt;
        print &amp;quot;$veid: tcpsndbuf too low (&amp;lt;64k)\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    if( $res{$veid}{'dgramrcvbuf'}-&amp;gt;[$BAR] &amp;lt; 131200 ) {&lt;br /&gt;
        print &amp;quot;$veid: dgramrcvbuf too low (&amp;lt;129k)\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    if( $res{$veid}{'othersockbuf'}-&amp;gt;[$BAR] &amp;lt; 131200 ) {&lt;br /&gt;
        print &amp;quot;$veid: othersockbuf too low (&amp;lt;129k)\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    # numfile &amp;lt; avgnumproc*32&lt;br /&gt;
    # ...&lt;br /&gt;
    &lt;br /&gt;
    if( $res{$veid}{'dcachesize'}-&amp;gt;[$BAR] &amp;lt; &lt;br /&gt;
      $res{$veid}{'numfile'}-&amp;gt;[$MAX] * 384 ) {&lt;br /&gt;
        print &amp;quot;$veid: dcachesize likely low for dentry and inode allocs\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    foreach my $param (keys %{$res{$veid}}) {&lt;br /&gt;
        &amp;amp;compare( $veid, $res{$veid}{$param}-&amp;gt;[$LIM], $res{$veid}{$param}-&amp;gt;[$BAR],&lt;br /&gt;
                &amp;quot;limit&amp;quot;, &amp;quot;barrier&amp;quot;, &amp;quot;problem with $param&amp;quot; );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub compare {&lt;br /&gt;
    my ($veid, $large, $small, $ltext, $stext, $text) = @_;&lt;br /&gt;
    &lt;br /&gt;
    if( $large &amp;lt; $small ) {&lt;br /&gt;
        # bad...&lt;br /&gt;
        print &amp;quot;VE $veid: $text ($ltext=$large &amp;lt; $stext=$small)\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
sub pretty($) {&lt;br /&gt;
    return sprintf(&amp;quot;%6.4f&amp;quot;, shift);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=13353</id>
		<title>User:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=13353"/>
		<updated>2013-01-29T09:40:46Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* resource management */ source code ;)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About me ==&lt;br /&gt;
See me [http://hu.wikipedia.org/wiki/user:grin there] on Wikipedia (or in the [http://hu.wikipedia.org/wiki/user:grin english] one).&lt;br /&gt;
&lt;br /&gt;
== About my openvz ==&lt;br /&gt;
I use OpenVZ to completely separate @#$%^&amp;amp;*!ing ''PHP'' users from the rest of the sane uncracked world. I run ''Debian/GNU Linux'' and try to send my changes upstream. ;-)&lt;br /&gt;
&lt;br /&gt;
=== Why do I use OpenVZ ===&lt;br /&gt;
* I do not require full virtualisation&lt;br /&gt;
* I do not require different operating systems, kernels or actually environment for VEs&lt;br /&gt;
* I need a lightweight solution&lt;br /&gt;
* I need easy remote management&lt;br /&gt;
* I need open source, libre software&lt;br /&gt;
* I need statistics (''small lie, big lie, statistics'', but anyway :))&lt;br /&gt;
* I need an upstream who is arrogant enough that their changes ''can'' find their way into the mainline kernel ;-)&lt;br /&gt;
&lt;br /&gt;
=== My opinion about OpenVZ ===&lt;br /&gt;
So far I believe it delivers what it promises. Maybe the secret is not to promise much. ;=)&lt;br /&gt;
&lt;br /&gt;
== My opinion about this wiki ==&lt;br /&gt;
Extremely unstructured, extremely hard to use, badly needs some organisation, which I plan to try someday. Something along a FAQ what's thematically organised and linking everywhere from the questions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Wiki structure planning ==&lt;br /&gt;
=== Better entry points ===&lt;br /&gt;
* [[One more entry point]]&lt;br /&gt;
&lt;br /&gt;
=== resource management ===&lt;br /&gt;
* [[/openvz_checker.pl]]&lt;br /&gt;
&lt;br /&gt;
==== quotas ====&lt;br /&gt;
* [[OpenVZ disk quota, df and stat weird behaviour]]&lt;br /&gt;
* [[Checking disk quota]]&lt;br /&gt;
* [[Resource shortage]]&lt;br /&gt;
* [[FAQ#What_filesystems_should_I_choose_for_saving_my_VEs.3F]] (no support for xfs, fsck it)&lt;br /&gt;
* [[Resource management]]&lt;br /&gt;
* [[Disk quota]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=7984</id>
		<title>Talk:Physical to container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=7984"/>
		<updated>2009-12-09T20:22:16Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* /proc in fstab */ fine&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RSync Command ==&lt;br /&gt;
Please check the following command,  Ive used with success:&lt;br /&gt;
 rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp --exclude mnt --exclude sys -e &amp;quot;ssh -l root@a.b.c.d&amp;quot; root@a.b.c.d:/ /vz/private/123/&lt;br /&gt;
&lt;br /&gt;
== Migration Script ==&lt;br /&gt;
&lt;br /&gt;
I composed a little Script to migrate a Debian Sarge Box to OpenVZ. (Some System specific steps have been removed)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
echo &amp;quot;Stopping VE 300...&amp;quot;&lt;br /&gt;
vzctl stop 300&lt;br /&gt;
echo &amp;quot;Creating base filesystem /dev /proc ...&amp;quot;&lt;br /&gt;
mknod /vz/private/300/dev/ptmx c 5 2&lt;br /&gt;
mkdir /vz/private/300/dev/pts&lt;br /&gt;
rm -f /vz/private/300/dev/null&lt;br /&gt;
mknod /vz/private/300/dev/null c 1 3&lt;br /&gt;
chmod o+rw /vz/private/300/dev/null&lt;br /&gt;
echo &amp;quot;Copy the tty's to VE and Set Permissions&amp;quot;&lt;br /&gt;
cp -r /dev/ttyp* /dev/ptyp* /vz/private/300/dev/&lt;br /&gt;
chmod o+wx /vz/private/300/dev/*typ*&lt;br /&gt;
echo &amp;quot;Creating /dev/random and Set Permissions&amp;quot;&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/random c 1 8&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/urandom c 1 9&lt;br /&gt;
chown root:root /vz/private/300/dev/random /vz/private/300/dev/urandom&lt;br /&gt;
echo &amp;quot;clearing mtab / fstab...&amp;quot;&lt;br /&gt;
echo -n &amp;gt; /vz/private/300/etc/fstab&lt;br /&gt;
rm /vz/private/300/etc/mtab&lt;br /&gt;
ln -s /proc/mounts /vz/private/300/etc/mtab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Dummy ==&lt;br /&gt;
&lt;br /&gt;
Having been completely clueless about Openvz three days ago I first created a dummy container based on the same distribution I wanted to migrate. This helped me greatly to understand what was needed and also allowed to use the dummy as a template for /dev and the conf file. Disregarding the time to setup the host system the actual migration from the physical machine with tar ball took me two hours and the migrated container started up on second attempt after first complaining about disk size. I increased that and it runs. I am very impressed by the ease of it all.&lt;br /&gt;
&lt;br /&gt;
== /proc in fstab ==&lt;br /&gt;
&lt;br /&gt;
Often it is ''wise'' to keep proc mount in fstab, if the OS doesn't make it by itself. --[[User:Grin|Grin]] 11:49, 9 December 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Thanks for noting this! I have modified the page accordingly, please check --[[User:Kir|Kir]] 11:56, 9 December 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Seems fine, thanks, Kir. --[[User:Grin|Grin]] 20:22, 9 December 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=7981</id>
		<title>Talk:Physical to container</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Talk:Physical_to_container&amp;diff=7981"/>
		<updated>2009-12-09T11:49:59Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* /proc in fstab */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== RSync Command ==&lt;br /&gt;
Please check the following command,  Ive used with success:&lt;br /&gt;
 rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp --exclude mnt --exclude sys -e &amp;quot;ssh -l root@a.b.c.d&amp;quot; root@a.b.c.d:/ /vz/private/123/&lt;br /&gt;
&lt;br /&gt;
== Migration Script ==&lt;br /&gt;
&lt;br /&gt;
I composed a little Script to migrate a Debian Sarge Box to OpenVZ. (Some System specific steps have been removed)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/sh&lt;br /&gt;
echo &amp;quot;Stopping VE 300...&amp;quot;&lt;br /&gt;
vzctl stop 300&lt;br /&gt;
echo &amp;quot;Creating base filesystem /dev /proc ...&amp;quot;&lt;br /&gt;
mknod /vz/private/300/dev/ptmx c 5 2&lt;br /&gt;
mkdir /vz/private/300/dev/pts&lt;br /&gt;
rm -f /vz/private/300/dev/null&lt;br /&gt;
mknod /vz/private/300/dev/null c 1 3&lt;br /&gt;
chmod o+rw /vz/private/300/dev/null&lt;br /&gt;
echo &amp;quot;Copy the tty's to VE and Set Permissions&amp;quot;&lt;br /&gt;
cp -r /dev/ttyp* /dev/ptyp* /vz/private/300/dev/&lt;br /&gt;
chmod o+wx /vz/private/300/dev/*typ*&lt;br /&gt;
echo &amp;quot;Creating /dev/random and Set Permissions&amp;quot;&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/random c 1 8&lt;br /&gt;
mknod -m 644 /vz/private/300/dev/urandom c 1 9&lt;br /&gt;
chown root:root /vz/private/300/dev/random /vz/private/300/dev/urandom&lt;br /&gt;
echo &amp;quot;clearing mtab / fstab...&amp;quot;&lt;br /&gt;
echo -n &amp;gt; /vz/private/300/etc/fstab&lt;br /&gt;
rm /vz/private/300/etc/mtab&lt;br /&gt;
ln -s /proc/mounts /vz/private/300/etc/mtab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use Dummy ==&lt;br /&gt;
&lt;br /&gt;
Having been completely clueless about Openvz three days ago I first created a dummy container based on the same distribution I wanted to migrate. This helped me greatly to understand what was needed and also allowed to use the dummy as a template for /dev and the conf file. Disregarding the time to setup the host system the actual migration from the physical machine with tar ball took me two hours and the migrated container started up on second attempt after first complaining about disk size. I increased that and it runs. I am very impressed by the ease of it all.&lt;br /&gt;
&lt;br /&gt;
== /proc in fstab ==&lt;br /&gt;
&lt;br /&gt;
Often it is ''wise'' to keep proc mount in fstab, if the OS doesn't make it by itself. --[[User:Grin|Grin]] 11:49, 9 December 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Vestat&amp;diff=7161</id>
		<title>Vestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Vestat&amp;diff=7161"/>
		<updated>2009-03-23T15:50:08Z</updated>

		<summary type="html">&lt;p&gt;Grin: let's meet reality when converting measures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:resource management]]&lt;br /&gt;
The '''/proc/vz/vestat''' file contains statistics for VE CPU usage. &lt;br /&gt;
&lt;br /&gt;
The ''guessed'' content (may the Gods - blessed thy fingers - acknowledge or reject my humble info here):&lt;br /&gt;
&lt;br /&gt;
* '''VEID''': The VE ID, obviously.&lt;br /&gt;
* '''user, nice, system, uptime''': usage in [[jiffy|jiffies]]. These are the equivalents of &amp;lt;code&amp;gt;/proc/stat&amp;lt;/code&amp;gt;, but there is no ''idle'' because it cannot be measured this way.&lt;br /&gt;
* '''idle, strv, uptime, used''': usage in [[cycle|cycles]]. ''idle'' and ''uptime'' are obvious, ''strv'' isn't used, and ''used'' is the used cycles by VE on all CPUs.&lt;br /&gt;
* '''maxlat, totlat, numsched''': latency statistics in cycles. ''maxlat'' is max latency in cycles meaning how long VE process has to wait before it actually got CPU time; ''totlat/numsched'' gives average scheduling latency. '''These do not seem work in OpenVZ, only in Virtuozzo.'''&lt;br /&gt;
&lt;br /&gt;
== Measure conversions ==&lt;br /&gt;
Using jiffies:&lt;br /&gt;
*seconds = ''measurement'' / jiffies_per_seconds&lt;br /&gt;
&lt;br /&gt;
Using cycles:&lt;br /&gt;
*seconds = ''measurement'' / frequency_of_your_cpu&lt;br /&gt;
&lt;br /&gt;
Variables:&lt;br /&gt;
* ''jiffies_per_second'' = 1000 '''(more often ''100'', unless you have changed that in kernel config, check CONFIG_HZ= in kernel .config or /proc/config.gz)'''&lt;br /&gt;
* ''cycles_per_jiffy'' = ''frequency_of_your_cpu'' / ''jiffies_per_second''&lt;br /&gt;
* ''frequency_of_your_cpu'' (in Hz) can be read from /proc/cpuinfo, as:&lt;br /&gt;
** &amp;lt;code&amp;gt;cpu MHz : ''megahertz''&amp;lt;/code&amp;gt;, and thus ''frequency_of_your_cpu'' = ''megahertz'' * 1048576 (for multiCPU machines this is based on the speed of one cpu only)&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Vestat&amp;diff=7160</id>
		<title>Vestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Vestat&amp;diff=7160"/>
		<updated>2009-03-23T12:39:35Z</updated>

		<summary type="html">&lt;p&gt;Grin: fix tipography a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:resource management]]&lt;br /&gt;
The '''/proc/vz/vestat''' file contains statistics for VE CPU usage. &lt;br /&gt;
&lt;br /&gt;
The ''guessed'' content (may the Gods - blessed thy fingers - acknowledge or reject my humble info here):&lt;br /&gt;
&lt;br /&gt;
* '''VEID''': The VE ID, obviously.&lt;br /&gt;
* '''user, nice, system, uptime''': usage in [[jiffy|jiffies]]. These are the equivalents of &amp;lt;code&amp;gt;/proc/stat&amp;lt;/code&amp;gt;, but there is no ''idle'' because it cannot be measured this way.&lt;br /&gt;
* '''idle, strv, uptime, used''': usage in [[cycle|cycles]]. ''idle'' and ''uptime'' are obvious, ''strv'' isn't used, and ''used'' is the used cycles by VE on all CPUs.&lt;br /&gt;
* '''maxlat, totlat, numsched''': latency statistics in cycles. ''maxlat'' is max latency in cycles meaning how long VE process has to wait before it actually got CPU time; ''totlat/numsched'' gives average scheduling latency. '''These do not seem work in OpenVZ, only in Virtuozzo.'''&lt;br /&gt;
&lt;br /&gt;
== Measure conversions ==&lt;br /&gt;
Using jiffies:&lt;br /&gt;
*seconds = ''measurement'' / jiffies_per_seconds&lt;br /&gt;
&lt;br /&gt;
Using cycles:&lt;br /&gt;
*seconds = ''measurement'' / cycles_per_jiffy / jiffies_per_seconds.&lt;br /&gt;
&lt;br /&gt;
Variables:&lt;br /&gt;
* ''jiffies_per_second'' = 1000 '''(unless you have changed that in kernel config?)'''&lt;br /&gt;
* ''cycles_per_jiffy'' = ''frequency_of_your_cpu'' / ''jiffies_per_second''&lt;br /&gt;
* ''frequency_of_your_cpu'' (in Hz) can be read from /proc/cpuinfo, as:&lt;br /&gt;
** &amp;lt;code&amp;gt;cpu MHz : ''frequency_of_your_cpu''&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Disk_quota&amp;diff=6455</id>
		<title>Disk quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Disk_quota&amp;diff=6455"/>
		<updated>2008-09-18T15:09:12Z</updated>

		<summary type="html">&lt;p&gt;Grin: dont work for xfs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Basic disk quota management:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set disk space, run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  vzctl set CTID --diskspace $SoftLimit$:$HardLimit$ --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl set 101 --diskspace 6G:7G --save&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could verify the space available with this command (ie : CTID =101)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl exec 101 df -h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want remove disk quota:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DISK_QUOTA=no&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Filesystem dependency ==&lt;br /&gt;
If your host filesystem is not ext2/3 (like ''XFS'') the disk quotas will not work inside containers.&lt;br /&gt;
&lt;br /&gt;
[[Category: Disk quota]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=CPU_Fair_scheduler&amp;diff=5982</id>
		<title>CPU Fair scheduler</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=CPU_Fair_scheduler&amp;diff=5982"/>
		<updated>2008-05-30T07:56:08Z</updated>

		<summary type="html">&lt;p&gt;Grin: stub&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Fair scheduler''' distributes CPU resources among the VEs, and controls CPU resource management. &lt;br /&gt;
&lt;br /&gt;
It is a two-level implementation of [[fair-share scheduling]] strategy.&lt;br /&gt;
&lt;br /&gt;
On the first level scheduler decides which VE is give the CPU time slice to, based on per-VE &amp;lt;code&amp;gt;cpuunits&amp;lt;/code&amp;gt; values. On the second level the standard Linux scheduler decides which process to run in that container, using standard Linux process priorities and such.&lt;br /&gt;
&lt;br /&gt;
OpenVZ administrator can set up different values of &amp;lt;code&amp;gt;cpuunits&amp;lt;/code&amp;gt; for different containers, and the CPU time will be given to those proportionally.&lt;br /&gt;
&lt;br /&gt;
Also there is a way to limit CPU time, e.g. say that this container is limited to, say, 10% of CPU time available. &lt;br /&gt;
&lt;br /&gt;
''...Stay tuned for more info...''&lt;br /&gt;
&lt;br /&gt;
== Monitoring ==&lt;br /&gt;
The scheduler can be monitored by using the &amp;lt;code&amp;gt;/proc/vz/[[vestat]]&amp;lt;/code&amp;gt; file.&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Vestat&amp;diff=5981</id>
		<title>Vestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Vestat&amp;diff=5981"/>
		<updated>2008-05-30T07:49:44Z</updated>

		<summary type="html">&lt;p&gt;Grin: category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:resource management]]&lt;br /&gt;
The '''/proc/vz/vestat''' file contains statistics for VE CPU usage. &lt;br /&gt;
&lt;br /&gt;
The ''guessed'' content (may the Gods - blessed thy fingers - acknowledge or reject my humble info here):&lt;br /&gt;
&lt;br /&gt;
* '''VEID''': The VE ID, obviously.&lt;br /&gt;
* '''user, nice, system, uptime''': usage in [[jiffy|jiffies]]. These are the equivalents of &amp;lt;code&amp;gt;/proc/stat&amp;lt;/code&amp;gt;, but there is no ''idle'' because it cannot be measured this way.&lt;br /&gt;
* '''idle, strv, uptime, used''': usage in [[cycle|cycles]]. idle and uptime are obvious, strv isn't used, and used is the used cycles by VE on all CPUs.&lt;br /&gt;
* '''maxlat, totlat, numsched''': latency statistics in ''cycles''. maxlat is max latency in cycles meaning how long VE process has to wait before it actually got CPU time; totlat/numsched gives average scheduling latency. '''These do not seem work in OpenVZ, only in Virtuozzo.'''&lt;br /&gt;
&lt;br /&gt;
== Measure conversions ==&lt;br /&gt;
Using jiffies:&lt;br /&gt;
*seconds = ''measurement'' / jiffies_per_seconds&lt;br /&gt;
&lt;br /&gt;
Using cycles:&lt;br /&gt;
*seconds = ''measurement'' / cycles_per_jiffy / jiffies_per_seconds.&lt;br /&gt;
&lt;br /&gt;
Variables:&lt;br /&gt;
* ''jiffies_per_second'' = 1000 '''(unless you have changed that in kernel config?)'''&lt;br /&gt;
* ''cycles_per_jiffy'' = ''frequency_of_your_cpu'' / ''jiffies_per_second''&lt;br /&gt;
* ''frequency_of_your_cpu'' (in Hz) can be read from /proc/meminfo, as:&lt;br /&gt;
** &amp;lt;code&amp;gt;cpu MHz : ''frequency_of_your_cpu''&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Vestat&amp;diff=5980</id>
		<title>Vestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Vestat&amp;diff=5980"/>
		<updated>2008-05-30T07:45:11Z</updated>

		<summary type="html">&lt;p&gt;Grin: let it be&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''/proc/vz/vestat''' file contains statistics for VE CPU usage. &lt;br /&gt;
&lt;br /&gt;
The ''guessed'' content (may the Gods - blessed thy fingers - acknowledge or reject my humble info here):&lt;br /&gt;
&lt;br /&gt;
* '''VEID''': The VE ID, obviously.&lt;br /&gt;
* '''user, nice, system, uptime''': usage in [[jiffy|jiffies]]. These are the equivalents of &amp;lt;code&amp;gt;/proc/stat&amp;lt;/code&amp;gt;, but there is no ''idle'' because it cannot be measured this way.&lt;br /&gt;
* '''idle, strv, uptime, used''': usage in [[cycle|cycles]]. idle and uptime are obvious, strv isn't used, and used is the used cycles by VE on all CPUs.&lt;br /&gt;
* '''maxlat, totlat, numsched''': latency statistics in ''cycles''. maxlat is max latency in cycles meaning how long VE process has to wait before it actually got CPU time; totlat/numsched gives average scheduling latency. '''These do not seem work in OpenVZ, only in Virtuozzo.'''&lt;br /&gt;
&lt;br /&gt;
== Measure conversions ==&lt;br /&gt;
Using jiffies:&lt;br /&gt;
*seconds = ''measurement'' / jiffies_per_seconds&lt;br /&gt;
&lt;br /&gt;
Using cycles:&lt;br /&gt;
*seconds = ''measurement'' / cycles_per_jiffy / jiffies_per_seconds.&lt;br /&gt;
&lt;br /&gt;
Variables:&lt;br /&gt;
* ''jiffies_per_second'' = 1000 '''(unless you have changed that in kernel config?)'''&lt;br /&gt;
* ''cycles_per_jiffy'' = ''frequency_of_your_cpu'' / ''jiffies_per_second''&lt;br /&gt;
* ''frequency_of_your_cpu'' (in Hz) can be read from /proc/meminfo, as:&lt;br /&gt;
** &amp;lt;code&amp;gt;cpu MHz : ''frequency_of_your_cpu''&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=UBC_systemwide_configuration&amp;diff=5977</id>
		<title>UBC systemwide configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=UBC_systemwide_configuration&amp;diff=5977"/>
		<updated>2008-05-30T06:48:43Z</updated>

		<summary type="html">&lt;p&gt;Grin: backlink to ubc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UBC toc}}&lt;br /&gt;
&lt;br /&gt;
The [[UBC consistency check]] article discussed validation of a [[resource management|resource control]] configuration for a single container. This article discusses checks that the configuration of the&lt;br /&gt;
'''whole''' system is '''valid'''.&lt;br /&gt;
&lt;br /&gt;
Configurations where resources allowed for containers exceed system&lt;br /&gt;
capacity&amp;lt;ref&amp;gt;More precisely, configurations with excessive&lt;br /&gt;
overcommitment, as explained below.&amp;lt;/ref&amp;gt; are not valid&lt;br /&gt;
and dangerous from stability point of view.&lt;br /&gt;
They may result in abnormal termination of the applications,&lt;br /&gt;
bad responsiveness of the system and, sometimes, system hangs.&lt;br /&gt;
Whereas the configuration validation discussed in [[UBC consistency check]]&lt;br /&gt;
addressed application functionality,&lt;br /&gt;
the validation considered in this section is aimed at security and stability&lt;br /&gt;
of the whole system.&lt;br /&gt;
&lt;br /&gt;
The best way to make sure that the configuration of the whole system&lt;br /&gt;
is valid is to run periodic automatic checks, based on the formulae described&lt;br /&gt;
below.&lt;br /&gt;
&lt;br /&gt;
== Resource utilization and commitment level ==&lt;br /&gt;
&lt;br /&gt;
Several resources of the whole system (such as RAM) are discussed below&lt;br /&gt;
in terms of '''utilization''' and '''commitment level'''.&lt;br /&gt;
&lt;br /&gt;
'''Utilization''' shows the amount of resources consumed by all&lt;br /&gt;
containers at the given time.&lt;br /&gt;
In general, low utilization values mean that the system is under-utilized.&lt;br /&gt;
Often, it means that the system is capable of supporting more Virtual&lt;br /&gt;
Environment if the existing containers continue to maintain&lt;br /&gt;
the same load and resource consumption level.&lt;br /&gt;
High utilization values (in general, more than &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;)&lt;br /&gt;
mean the the system is overloaded and the service level&lt;br /&gt;
of the containers is degraded.&lt;br /&gt;
&lt;br /&gt;
'''Commitment level''' shows how much resources are “promised” to the existing&lt;br /&gt;
containers. Low commitment levels mean that the system&lt;br /&gt;
is capable of supporting more containers.&lt;br /&gt;
Commitment levels more than &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; mean that the&lt;br /&gt;
containers are promised more resources&lt;br /&gt;
than the system has, and in this case the system is said to be&lt;br /&gt;
overcommitted.&lt;br /&gt;
If the system runs a lot of containers,&lt;br /&gt;
it is usually acceptable to have some overcommitment, because it is unlikely that all Virtual&lt;br /&gt;
Environments will request resources at the same time.&lt;br /&gt;
However, higher commitment levels (as discussed below for each resource&lt;br /&gt;
individually) will cause containerss to experience failures to&lt;br /&gt;
allocate and use the resources promised to them.&lt;br /&gt;
&lt;br /&gt;
== “Low memory” (x86 specific) ==&lt;br /&gt;
Because of specifics of architecture of Intel's x86 processors, the RAM of the&lt;br /&gt;
computer can't be used uniformly.&lt;br /&gt;
The most important memory area is so called “low memory”, a part of memory&lt;br /&gt;
residing at lower addresses and directly accessible by the kernel.&lt;br /&gt;
For current Linux kernels, the size of low memory area is 832MB&lt;br /&gt;
(or, if the computer has less RAM than 832MB, the size of the RAM).&lt;br /&gt;
&lt;br /&gt;
Note that 64-bit kernels (i.e. x86_64, ia64 etc.) can access all memory&lt;br /&gt;
directly and are not using “low memory” area.&lt;br /&gt;
=== Utilization ===&lt;br /&gt;
The lower bound estimation of low memory utilization is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (kmemsize_{cur}+allsocketbuf_{cur})}&lt;br /&gt;
    {0.4\cdot\min(RAM\ size, {\rm 832MB})}\rm,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
allsocketbuf=tcprcvbuf+tcpsndbuf+dgramrcvbuf+othersockbuf\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Utilization of low memory below &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is normal.&lt;br /&gt;
Utilization above &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; is not safe, and utilization above &amp;lt;math&amp;gt;2&amp;lt;/math&amp;gt;&lt;br /&gt;
is dangerous is very likely to cause bad system responsiveness,&lt;br /&gt;
application stalls for seconds or more and termination of some applications.&lt;br /&gt;
&lt;br /&gt;
=== Commitment level ===&lt;br /&gt;
The commitment level can be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (kmemsize_{lim}+allsocketbuf_{lim})}&lt;br /&gt;
    {0.4\cdot\min(RAM\ size, {\rm 832MB})}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commitment levels below &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; are normal.&lt;br /&gt;
Levels between &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt; are usually acceptable for systems with about&lt;br /&gt;
100 containers.&lt;br /&gt;
Systems with more containers may have the commitment level&lt;br /&gt;
increased, to about &amp;lt;math&amp;gt;1.5&amp;lt;/math&amp;gt;—&amp;lt;math&amp;gt;2&amp;lt;/math&amp;gt; for 400 containers.&lt;br /&gt;
Higher commitment levels for this resource are not recommended,&lt;br /&gt;
because the consequences of exceeding the low memory capacities&lt;br /&gt;
are severe and affect the whole system and all the containers.&lt;br /&gt;
&lt;br /&gt;
== Total RAM ==&lt;br /&gt;
This subsection discusses usage of the whole RAM and its utilization.&lt;br /&gt;
Usage of swap space and the sum of used RAM and swap space are discussed&lt;br /&gt;
below in subsection [[{{PAGENAME}}#Memory and swap space|Memory and swap space]].&lt;br /&gt;
&lt;br /&gt;
Current version of OpenVZ can't guarantee availability of certain&lt;br /&gt;
amount of memory (in opposite to the sum of memory and swap space),&lt;br /&gt;
so the commitment level is not applicable to the total RAM.&lt;br /&gt;
Such guarantees will be implemented in future versions.&lt;br /&gt;
&lt;br /&gt;
=== Utilization ===&lt;br /&gt;
&lt;br /&gt;
The amount of RAM consumed by all containers can be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\sum_{all\ containers}&lt;br /&gt;
    (physpages_{cur}\cdot4096+kmemsize_{cur}+allsocketbuf_{cur})\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference between memory usage shown by &amp;lt;code&amp;gt;free(1)&amp;lt;/code&amp;gt;&lt;br /&gt;
or &amp;lt;code&amp;gt;/proc/meminfo&amp;lt;/code&amp;gt; and the total amount of RAM consumed by&lt;br /&gt;
containers is the memory used by system daemons&lt;br /&gt;
and different caches.&lt;br /&gt;
&lt;br /&gt;
The memory utilization can be computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (physpages_{cur}\cdot4096+&lt;br /&gt;
         kmemsize_{cur}+allsocketbuf_{cur})}&lt;br /&gt;
    {RAM\ size}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Utilization levels from &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; are normal.&lt;br /&gt;
Lower utilization means that the system is under-utilized, and,&lt;br /&gt;
if other system resources and their commitment levels permit,&lt;br /&gt;
the system can host more containers.&lt;br /&gt;
By the nature of the accounting of &amp;lt;code&amp;gt;physpages&amp;lt;/code&amp;gt; and other parameters,&lt;br /&gt;
total RAM utilization can't be bigger than &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Memory and swap space ==&lt;br /&gt;
The main resource of the computer determining the amount of memory&lt;br /&gt;
applications can use is the sum of RAM and swap sizes.&lt;br /&gt;
If the total size of the used memory exceeds the RAM size,&lt;br /&gt;
Linux kernel moves some data to swap and and loads it back when the&lt;br /&gt;
application needs it.&lt;br /&gt;
More frequently used data tends to stay in RAM, less frequently used&lt;br /&gt;
data spends more time in swap.&lt;br /&gt;
&lt;br /&gt;
Swap-in and swap-out activity reduces the system performance to some extent.&lt;br /&gt;
However, if this activity is not excessive, the performance decrease is not&lt;br /&gt;
very noticeable.  On the other hand, the benefits of using swap space are&lt;br /&gt;
quite big, allowing to increase the number of containers in the&lt;br /&gt;
system about 2 times.&lt;br /&gt;
&lt;br /&gt;
Swap space is essential for handling system load bursts.&lt;br /&gt;
System with enough swap just slows down at high load bursts,&lt;br /&gt;
whereas the system without swap reacts to high load bursts by refusing&lt;br /&gt;
memory allocations (causing applications to refuse to accept clients or&lt;br /&gt;
terminate) and by direct killing of some applications.&lt;br /&gt;
Additionally, the presence of swap space helps the system to better&lt;br /&gt;
balance memory and move data between “low memory” and the rest of the RAM.&lt;br /&gt;
&lt;br /&gt;
In all OpenVZ installations it is strongly recommended&lt;br /&gt;
to have swap of size not less than the RAM size.&lt;br /&gt;
&lt;br /&gt;
Also, it is not recommended to create swap space of the size&lt;br /&gt;
of more than 4 times RAM size because of performance degradation&lt;br /&gt;
related to swap-in and swap-out activity.&lt;br /&gt;
That is, the system should be configured so that&lt;br /&gt;
&amp;lt;math&amp;gt;RAM\ size \le swap\ size \le 4\cdot RAM\ size\rm.&amp;lt;/math&amp;gt;&lt;br /&gt;
The optimal configuration is when swap size is twice more than the RAM size.&lt;br /&gt;
&lt;br /&gt;
=== Utilization ===&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (oomguarpages_{cur}\cdot4096+&lt;br /&gt;
         kmemsize_{cur}+allsocketbuf_{cur})}&lt;br /&gt;
    {RAM\ size + swap\ size}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normal utilization of memory plus swap ranges between&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{RAM\ size}{RAM\ size + swap\ size}&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{RAM\ size + \frac12swap\ size}{RAM\ size + swap\ size}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lower utilization means that the system memory is under-utilized&lt;br /&gt;
at the moment of checking the utilization.&lt;br /&gt;
Higher utilization is likely to cause gradual performance degradation because&lt;br /&gt;
of swap-in and swap-out activity and is a sign of overloading of the system.&lt;br /&gt;
&lt;br /&gt;
=== Commitment level ===&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (oomguarpages_{bar}\cdot4096+&lt;br /&gt;
         kmemsize_{lim}+allsocketbuf_{lim})}&lt;br /&gt;
    {RAM\ size + swap\ size}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normal commitment level is about &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;—&amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Commitment levels more than &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; means that the Virtual Environmens are&lt;br /&gt;
guaranteed more memory than the system has.&lt;br /&gt;
Such overcommitment is strongly not recommended, because in that case&lt;br /&gt;
if all the memory is consumed, random applications, including the ones&lt;br /&gt;
belonging to the host system, may be killed and the system may become&lt;br /&gt;
inaccessible by &amp;lt;code&amp;gt;ssh(1)&amp;lt;/code&amp;gt; and lose other important functionality.&lt;br /&gt;
&lt;br /&gt;
It is better to guarantee containers less and have less commitment&lt;br /&gt;
levels than to accidently overcommit the system by memory plus swap.&lt;br /&gt;
If the system has spare memory and swap, containers will&lt;br /&gt;
transparently be able to use the memory and swap above their guarantees.&lt;br /&gt;
Guarantees given to containers should not be big, and it is normal&lt;br /&gt;
if memory and swap usage for some containers stays above their&lt;br /&gt;
guarantee.&lt;br /&gt;
It is also normal to give guarantees only to containers with&lt;br /&gt;
preferred service.&lt;br /&gt;
But administrators should not guarantee container more&lt;br /&gt;
than the system actually has.&lt;br /&gt;
&lt;br /&gt;
== Allocated memory ==&lt;br /&gt;
&lt;br /&gt;
This subsection considers standard memory allocations made by&lt;br /&gt;
applications in the container.&lt;br /&gt;
The allocations for each container are controlled by&lt;br /&gt;
two parameters: &amp;lt;code&amp;gt;vmguarpages&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt;,&lt;br /&gt;
discussed in sections FIXME.&lt;br /&gt;
&lt;br /&gt;
Allocated memory is a more “virtual” system resource than the RAM or RAM&lt;br /&gt;
plus swap size.&lt;br /&gt;
Applications can allocate memory but start to use it only later, and&lt;br /&gt;
the amount of system's free memory will decrease only at the moment of the&lt;br /&gt;
use.&lt;br /&gt;
The sum of allocated memory size of all containers is an estimation&lt;br /&gt;
of how much physical memory will be used when (and if) all applications&lt;br /&gt;
claim the allocated memory.&lt;br /&gt;
&lt;br /&gt;
=== Utilization ===&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (privvmpages_{cur}\cdot4096+&lt;br /&gt;
         kmemsize_{cur}+allsocketbuf_{cur})}&lt;br /&gt;
    {RAM\ size + swap\ size}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This utilization level is the ratio of the amount of allocated memory&lt;br /&gt;
to the capacity of the system.&lt;br /&gt;
&lt;br /&gt;
Low utilization level means that the system can support more&lt;br /&gt;
containers, if other resources permit.&lt;br /&gt;
High utilization levels may, but doesn't necessarily mean that&lt;br /&gt;
the system is overloaded.&lt;br /&gt;
As it was explaned above, not all applications use all the allocated memory,&lt;br /&gt;
so this utilization level may exceed &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Computing this utilization level is useful for comparing&lt;br /&gt;
it with the commitment level and the level of memory allocation restrictions,&lt;br /&gt;
discussed below, to configure memory allocation restrictions&lt;br /&gt;
for the container.&lt;br /&gt;
&lt;br /&gt;
=== Commitment level ===&lt;br /&gt;
Allocation guarantee commitment level&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (vmguarpages_{bar}\cdot4096+&lt;br /&gt;
         kmemsize_{lim}+allsocketbuf_{lim})}&lt;br /&gt;
    {RAM\ size + swap\ size}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is the ratio of the memory space guaranteed to be available for&lt;br /&gt;
allocations to the capacity of the system.&lt;br /&gt;
Similarly to the commitment level of memory plus swap space (as discussed&lt;br /&gt;
in subsection [[{{PAGENAME}}#Memory and swap space|Memory and swap space]]),&lt;br /&gt;
this level should be kept below &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
If the level is above &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;, it significantly increases the chances of&lt;br /&gt;
applications to be killed instead of be notified in case the system&lt;br /&gt;
experiences a memory shortage.&lt;br /&gt;
&lt;br /&gt;
It's better to provide lower guarantees than accidently guarantee more than&lt;br /&gt;
the system has, because containers are allowed to allocated memory&lt;br /&gt;
above their guarantee if the system is not tight on memory.&lt;br /&gt;
It is also normal to give guarantees only to containers with&lt;br /&gt;
preferred service.&lt;br /&gt;
&lt;br /&gt;
== Limiting memory allocations ==&lt;br /&gt;
In addition to providing allocation guarantees, it is possible&lt;br /&gt;
to impose restrictions on the amount of memory allocated by&lt;br /&gt;
containers.&lt;br /&gt;
&lt;br /&gt;
If a system has multiple containers,&lt;br /&gt;
it is important to make sure that for each container&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;privvmpages_{lim}\cdot4096 \le 0.6\cdot {RAM\ size}\rm.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If this condition is not satisfied, a single container may easily&lt;br /&gt;
cause an excessive swap-out and very bad performance of the whole system.&lt;br /&gt;
Usually, for each container &amp;lt;code&amp;gt;privvmpages&amp;lt;/code&amp;gt; limitations are&lt;br /&gt;
to values much less than the size of the RAM.&lt;br /&gt;
&lt;br /&gt;
The resource control parameters should be configured in a way,&lt;br /&gt;
so that in case of memory shortage applications are given chance&lt;br /&gt;
to notice the shortage and exit gracefully, instead of being terminated&lt;br /&gt;
by the kernel.&lt;br /&gt;
For this purpose, it is recommended to maintain reasonable&lt;br /&gt;
total level of memory allocation restrictions, computed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\displaystyle\sum_{all\ containers}&lt;br /&gt;
        (privvmpages_{lim}\cdot4096+&lt;br /&gt;
         kmemsize_{lim}+allsocketbuf_{lim})}&lt;br /&gt;
    {RAM\ size + swap\ size}\rm.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This number shows how much memory applications are allowed to allocate&lt;br /&gt;
in comparison with the capacity of the system.&lt;br /&gt;
&lt;br /&gt;
In practice, a lot of applications do not use the memory very efficiently&lt;br /&gt;
and, sometimes, allocated memory will never be used later.&lt;br /&gt;
For example, Apache Web server at start time it allocates about&lt;br /&gt;
20–30%% more memory that it will ever use.&lt;br /&gt;
Some multi-threaded applications are especially bad at using their memory,&lt;br /&gt;
and their rate of allocated to used memory may happen to be 1000%.&lt;br /&gt;
&lt;br /&gt;
The bigger the level of memory allocation restrictions,&lt;br /&gt;
the more chances are that applications will be killed instead&lt;br /&gt;
of getting an error on next memory allocation in case&lt;br /&gt;
the system experiences memory shortage.&lt;br /&gt;
The levels ranging in &amp;lt;math&amp;gt;1.5&amp;lt;/math&amp;gt;–&amp;lt;math&amp;gt;4&amp;lt;/math&amp;gt; can be considered acceptable.&lt;br /&gt;
Administrators can find experimentally the optimal setting for their load,&lt;br /&gt;
basing on the frequency of messages “Out of Memory: killing process”&lt;br /&gt;
in system logs, saved by &amp;lt;code&amp;gt;klogd(8)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;syslogd(8)&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, for stability-critical applications, it's better to keep&lt;br /&gt;
the level not exceeding &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5968</id>
		<title>Downloading and installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5968"/>
		<updated>2008-05-27T12:30:02Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* Downloading the kernel */ internal DL link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page organises the pages related to downloading ''kernel'' and ''user-space components'', and pages about ''installation'' on different systems.&lt;br /&gt;
&lt;br /&gt;
== Downloading the kernel ==&lt;br /&gt;
* [http://download.openvz.org/ The download directory] &lt;br /&gt;
* [[Download]] / [[Download/kernel|kernel]] - the download instructions page and the kernel download page, pointing to the latest versions&lt;br /&gt;
* [[Kernel build#Rebuilding kernel from sources]] - generic instructions on getting and compiling the kernel&lt;br /&gt;
* [[Kernel configuration]] - instructions on configuring the kernel source&lt;br /&gt;
* [[Kernel download structure]] - description of the whole OpenVZ download directory structure and [[Kernel download structure|versioning system]]&lt;br /&gt;
&lt;br /&gt;
=== Debian specific ===&lt;br /&gt;
* [[Compiling the OpenVZ kernel (the Debian way)]] - using pre-packaged kernel source and openvz patch&lt;br /&gt;
&lt;br /&gt;
=== RPM specific ===&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Kernel build#Rebuilding kernel from SRPM]] - getting and compiling the kernel from SRPMs&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal ===&lt;br /&gt;
* [[Bare Metal Installer]] - installing OpenVZ on an &amp;quot;empty&amp;quot; system (with no operating system) booting a DVD&lt;br /&gt;
&lt;br /&gt;
== Installation and setup ==&lt;br /&gt;
* [[Installation on Debian]], [[Debian template creation]]&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Ubuntu template]]&lt;br /&gt;
* [[Known problems]] - with kernels and their solutions&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5967</id>
		<title>Downloading and installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5967"/>
		<updated>2008-05-27T10:20:41Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* Downloading the kernel */ extlink of the Dl dir&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page organises the pages related to downloading ''kernel'' and ''user-space components'', and pages about ''installation'' on different systems.&lt;br /&gt;
&lt;br /&gt;
== Downloading the kernel ==&lt;br /&gt;
* [http://download.openvz.org/ The download directory] &lt;br /&gt;
* [[Kernel build#Rebuilding kernel from sources]] - generic instructions on getting and compiling the kernel&lt;br /&gt;
* [[Kernel configuration]] - instructions on configuring the kernel source&lt;br /&gt;
* [[Kernel download structure]] - description of the whole OpenVZ download directory structure and [[Kernel download structure|versioning system]]&lt;br /&gt;
&lt;br /&gt;
=== Debian specific ===&lt;br /&gt;
* [[Compiling the OpenVZ kernel (the Debian way)]] - using pre-packaged kernel source and openvz patch&lt;br /&gt;
&lt;br /&gt;
=== RPM specific ===&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Kernel build#Rebuilding kernel from SRPM]] - getting and compiling the kernel from SRPMs&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal ===&lt;br /&gt;
* [[Bare Metal Installer]] - installing OpenVZ on an &amp;quot;empty&amp;quot; system (with no operating system) booting a DVD&lt;br /&gt;
&lt;br /&gt;
== Installation and setup ==&lt;br /&gt;
* [[Installation on Debian]], [[Debian template creation]]&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Ubuntu template]]&lt;br /&gt;
* [[Known problems]] - with kernels and their solutions&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=One_more_entry_point&amp;diff=5966</id>
		<title>One more entry point</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=One_more_entry_point&amp;diff=5966"/>
		<updated>2008-05-27T10:18:34Z</updated>

		<summary type="html">&lt;p&gt;Grin: added DL and install page link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This entry point of OpenVZ wiki is created in order to arrange all the information on this site more logically. General idea of arrangement is the following. Here you can find something like table of contents. Each chapter contents collection of pages, that pass to the subject of the chapter. Of course there can be articles on the same subject in one chapter: one writes article in own way, another person does it in the other way. It is important, that pages in chapters go in the order of complexity of the material.&lt;br /&gt;
It allows the novices at OpenVZ to read only first pages of chapters to start some feature working. Advanced users can quickly go through this table of contents and find more specific information they actually need.&lt;br /&gt;
&lt;br /&gt;
It is greatly appreciated if you will create points in this table (even without writing the article), in order for the community to know what topics are popular and need to be described. Writing articles is also very useful in fact.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Introduction to Virtualization Technology&lt;br /&gt;
|}&lt;br /&gt;
* [[Introduction to virtualization]]&lt;br /&gt;
* [[Virtualization implementation comparison]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Basic concepts of OpenVZ&lt;br /&gt;
|}&lt;br /&gt;
* [[VE]] = [[Virtual Environment]]&lt;br /&gt;
* [[HN]] = [[HW]] = [[Hardware Node]] = [[Host system]]&lt;br /&gt;
* [[CT0]]&lt;br /&gt;
* [[OS template]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Choosing and Installing OpenVZ&lt;br /&gt;
|}&lt;br /&gt;
* [[Quick installation]] -- [[Downloading and installing]]&lt;br /&gt;
* [[OpenVZ components]]&lt;br /&gt;
* [[Kernel versioning]]&lt;br /&gt;
* [[Different kernel flavors (UP, SMP, ENTERPRISE, ENTNOSPLIT)]]&lt;br /&gt;
* [[Features]]&lt;br /&gt;
* [[Security]]&lt;br /&gt;
* [[HA cluster with DRBD and Heartbeat]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Templates&lt;br /&gt;
|}&lt;br /&gt;
* [[OS template]]&lt;br /&gt;
* [[OS template cache]]&lt;br /&gt;
* [[OS template metadata]]&lt;br /&gt;
* [[Adding OS template to the installation]]&lt;br /&gt;
* [[OS template cache preparation]]&lt;br /&gt;
* [[Debian template creation]]&lt;br /&gt;
* [[Gentoo template creation]]&lt;br /&gt;
* [[Slackware template creation]]&lt;br /&gt;
* [[Ubuntu template]]&lt;br /&gt;
* [[Creating your own template]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | First steps inside OpenVZ environment&lt;br /&gt;
|}&lt;br /&gt;
* [[VE creation]]&lt;br /&gt;
* [[Starting VE]]&lt;br /&gt;
* [[Entering VE]]&lt;br /&gt;
* [[Running a process in VE]]&lt;br /&gt;
* [[Stoping VE]]&lt;br /&gt;
* [[Destroying VE]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Resource accounting&lt;br /&gt;
|}&lt;br /&gt;
* [[User beancounters]]&lt;br /&gt;
* [[OpenVZ quota]]&lt;br /&gt;
* [[CPU Fairscheduler]]&lt;br /&gt;
* [[Resource shortage]] &lt;br /&gt;
|}&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | &amp;lt;!-- SECOND COLUMN --&amp;gt;&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Network &lt;br /&gt;
|}&lt;br /&gt;
* [[Setting up network in VE]]&lt;br /&gt;
* [[Virtual network device]]&lt;br /&gt;
* [[Virtual Ethernet device]]&lt;br /&gt;
* [[iptables in OpenVZ environment]]&lt;br /&gt;
* [[Differences between venet and veth]]&lt;br /&gt;
* [[Using NAT for VE with private IPs]]&lt;br /&gt;
* [[Source based routing]]&lt;br /&gt;
* [[VPN via the TUN/TAP device]]&lt;br /&gt;
* [[Traffic accounting with iptables]]&lt;br /&gt;
* [[Traffic shaping with tc]]&lt;br /&gt;
* [[Using bridges in OpenVZ]]&lt;br /&gt;
* [[NFS server inside VE]]&lt;br /&gt;
* [[X inside VE]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Checkpointing and Migration&lt;br /&gt;
|}&lt;br /&gt;
* [[What is checkpointing]]&lt;br /&gt;
* [[Live migration]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Working with OpenVZ code&lt;br /&gt;
|}&lt;br /&gt;
* [[Porting the kernel]]&lt;br /&gt;
* [[Kernel build]]&lt;br /&gt;
* [[Containers/Pidcache]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Troubleshooting&lt;br /&gt;
|}&lt;br /&gt;
* [[Magic SysRq Key]]&lt;br /&gt;
* [[Remote console setup]]&lt;br /&gt;
* [[SysRq debugger]]&lt;br /&gt;
* [[When you have an oops]]&lt;br /&gt;
* [[Modifying initrd image]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Using specific tools in VE&lt;br /&gt;
|}&lt;br /&gt;
* [[Asterisk in VE with debian stable]]&lt;br /&gt;
* [[Plesk in VE]]&lt;br /&gt;
* [[Yum]]&lt;br /&gt;
* [[Shared webhosting]]&lt;br /&gt;
* [[CPanel in VE]]&lt;br /&gt;
* [[Zimbra on OpenVZ on CentOS]]&lt;br /&gt;
|}&lt;br /&gt;
{| style=&amp;quot;border:1px solid #ccc;background-color:#f7fff7;margin-top:+.7em&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=100%&lt;br /&gt;
|&lt;br /&gt;
{| style=&amp;quot;background-color:#e5ffe5;border:1px solid #ccc;&amp;quot; width=100%&lt;br /&gt;
| align=center | Other&lt;br /&gt;
|}&lt;br /&gt;
* [[Processes scope and visibility]]&lt;br /&gt;
* [[Setting up a mirror]]&lt;br /&gt;
* [[MAX ULONG]]&lt;br /&gt;
* [[Memory page]]&lt;br /&gt;
* [[Artwork]]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
|}&lt;br /&gt;
|}&amp;lt;!--Two column layout table--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5965</id>
		<title>Downloading and installing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Downloading_and_installing&amp;diff=5965"/>
		<updated>2008-05-27T10:16:35Z</updated>

		<summary type="html">&lt;p&gt;Grin: another one categorising the mess&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page organises the pages related to downloading ''kernel'' and ''user-space components'', and pages about ''installation'' on different systems.&lt;br /&gt;
&lt;br /&gt;
== Downloading the kernel ==&lt;br /&gt;
* [[Kernel build#Rebuilding kernel from sources]] - generic instructions on getting and compiling the kernel&lt;br /&gt;
* [[Kernel configuration]] - instructions on configuring the kernel source&lt;br /&gt;
* [[Kernel download structure]] - description of the whole OpenVZ download directory structure and [[Kernel download structure|versioning system]]&lt;br /&gt;
&lt;br /&gt;
=== Debian specific ===&lt;br /&gt;
* [[Compiling the OpenVZ kernel (the Debian way)]] - using pre-packaged kernel source and openvz patch&lt;br /&gt;
&lt;br /&gt;
=== RPM specific ===&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Kernel build#Rebuilding kernel from SRPM]] - getting and compiling the kernel from SRPMs&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal ===&lt;br /&gt;
* [[Bare Metal Installer]] - installing OpenVZ on an &amp;quot;empty&amp;quot; system (with no operating system) booting a DVD&lt;br /&gt;
&lt;br /&gt;
== Installation and setup ==&lt;br /&gt;
* [[Installation on Debian]], [[Debian template creation]]&lt;br /&gt;
* [[Quick installation]] - getting kernel and userspace tools on RPM based systems&lt;br /&gt;
* [[Ubuntu template]]&lt;br /&gt;
* [[Known problems]] - with kernels and their solutions&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=5867</id>
		<title>User:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=5867"/>
		<updated>2008-05-06T13:12:04Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* Wiki structure planning */ better entry points already existing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About me ==&lt;br /&gt;
See me [http://hu.wikipedia.org/wiki/user:grin there] on Wikipedia (or in the [http://hu.wikipedia.org/wiki/user:grin english] one).&lt;br /&gt;
&lt;br /&gt;
== About my openvz ==&lt;br /&gt;
I use OpenVZ to completely separate @#$%^&amp;amp;*!ing ''PHP'' users from the rest of the sane uncracked world. I run ''Debian/GNU Linux'' and try to send my changes upstream. ;-)&lt;br /&gt;
&lt;br /&gt;
=== Why do I use OpenVZ ===&lt;br /&gt;
* I do not require full virtualisation&lt;br /&gt;
* I do not require different operating systems, kernels or actually environment for VEs&lt;br /&gt;
* I need a lightweight solution&lt;br /&gt;
* I need easy remote management&lt;br /&gt;
* I need open source, libre software&lt;br /&gt;
* I need statistics (''small lie, big lie, statistics'', but anyway :))&lt;br /&gt;
* I need an upstream who is arrogant enough that their changes ''can'' find their way into the mainline kernel ;-)&lt;br /&gt;
&lt;br /&gt;
=== My opinion about OpenVZ ===&lt;br /&gt;
So far I believe it delivers what it promises. Maybe the secret is not to promise much. ;=)&lt;br /&gt;
&lt;br /&gt;
== My opinion about this wiki ==&lt;br /&gt;
Extremely unstructured, extremely hard to use, badly needs some organisation, which I plan to try someday. Something along a FAQ what's thematically organised and linking everywhere from the questions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Wiki structure planning ==&lt;br /&gt;
=== Better entry points ===&lt;br /&gt;
* [[One more entry point]]&lt;br /&gt;
&lt;br /&gt;
=== resource management ===&lt;br /&gt;
==== quotas ====&lt;br /&gt;
* [[OpenVZ disk quota, df and stat weird behaviour]]&lt;br /&gt;
* [[Checking disk quota]]&lt;br /&gt;
* [[Resource shortage]]&lt;br /&gt;
* [[FAQ#What_filesystems_should_I_choose_for_saving_my_VEs.3F]] (no support for xfs, fsck it)&lt;br /&gt;
* [[Resource management]]&lt;br /&gt;
* [[Disk quota]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=5847</id>
		<title>User:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=5847"/>
		<updated>2008-04-29T07:57:34Z</updated>

		<summary type="html">&lt;p&gt;Grin: organise the bastard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About me ==&lt;br /&gt;
See me [http://hu.wikipedia.org/wiki/user:grin there] on Wikipedia (or in the [http://hu.wikipedia.org/wiki/user:grin english] one).&lt;br /&gt;
&lt;br /&gt;
== About my openvz ==&lt;br /&gt;
I use OpenVZ to completely separate @#$%^&amp;amp;*!ing ''PHP'' users from the rest of the sane uncracked world. I run ''Debian/GNU Linux'' and try to send my changes upstream. ;-)&lt;br /&gt;
&lt;br /&gt;
=== Why do I use OpenVZ ===&lt;br /&gt;
* I do not require full virtualisation&lt;br /&gt;
* I do not require different operating systems, kernels or actually environment for VEs&lt;br /&gt;
* I need a lightweight solution&lt;br /&gt;
* I need easy remote management&lt;br /&gt;
* I need open source, libre software&lt;br /&gt;
* I need statistics (''small lie, big lie, statistics'', but anyway :))&lt;br /&gt;
* I need an upstream who is arrogant enough that their changes ''can'' find their way into the mainline kernel ;-)&lt;br /&gt;
&lt;br /&gt;
=== My opinion about OpenVZ ===&lt;br /&gt;
So far I believe it delivers what it promises. Maybe the secret is not to promise much. ;=)&lt;br /&gt;
&lt;br /&gt;
== My opinion about this wiki ==&lt;br /&gt;
Extremely unstructured, extremely hard to use, badly needs some organisation, which I plan to try someday. Something along a FAQ what's thematically organised and linking everywhere from the questions.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Wiki structure planning ==&lt;br /&gt;
&lt;br /&gt;
=== resource management ===&lt;br /&gt;
==== quotas ====&lt;br /&gt;
* [[OpenVZ disk quota, df and stat weird behaviour]]&lt;br /&gt;
* [[Checking disk quota]]&lt;br /&gt;
* [[Resource shortage]]&lt;br /&gt;
* [[FAQ#What_filesystems_should_I_choose_for_saving_my_VEs.3F]] (no support for xfs, fsck it)&lt;br /&gt;
* [[Resource management]]&lt;br /&gt;
* [[Disk quota]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User_talk:Grin&amp;diff=5846</id>
		<title>User talk:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User_talk:Grin&amp;diff=5846"/>
		<updated>2008-04-29T07:48:24Z</updated>

		<summary type="html">&lt;p&gt;Grin: just to keep order&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Messages ==&lt;br /&gt;
Here you can leave a message for me, and since all feedback are welcome you're supported to do so.&lt;br /&gt;
&lt;br /&gt;
It is useful, however, that you use the ''&amp;quot;E-mail this user&amp;quot;'' feature in the left menu as well to notify me that a message is waiting, otherwise I'll reply only when I log in the next time.&lt;br /&gt;
&lt;br /&gt;
== Leave your message here ==&lt;br /&gt;
&amp;lt;!-- below this line, or better use the &amp;quot;+&amp;quot; sign in the top menu --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Shared_webhosting&amp;diff=5397</id>
		<title>Shared webhosting</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Shared_webhosting&amp;diff=5397"/>
		<updated>2008-03-31T20:03:18Z</updated>

		<summary type="html">&lt;p&gt;Grin: change infinite width pre into italics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:''This document describes creating a &amp;quot;secure shared web hosting service&amp;quot; on « HN (Host Node) »  It is « NOT » about per container shared web hosting.&lt;br /&gt;
&lt;br /&gt;
{{roughstub}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
One of the problems with shared web hosting (i.e. different people with each his/her own webpages) is that modern script languages such as PHP, Python, or Perl are too powerful. For example take the following PHP script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
function get_content($filename) {&lt;br /&gt;
  $handle = fopen($filename, 'r');&lt;br /&gt;
  echo fread($handle, filesize($filename));&lt;br /&gt;
  fclose($handle);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
get_content('/home/ppuk34/www/forum/config.inc.php');&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With PHP you could use open_basedir to prevent this, but there are more ways. For example [http://mgeisler.net/php-shell/ PHP Shell], a script that is [http://mgeisler.net/downloads/phpshell/SECURITY often mis-used] by people with not-so-good intentions. Or think about the [http://www.f-secure.com/v-descs/santy_a.shtml Santy-worm] which mis-used phpBB. Again there is a solution in the form of safe_mode, but lots of PHP scripts break if you enable this. For Python, Perl, or CGI-scripts there are no easy ways and you have to use wrappers or other tricks to chroot these.&lt;br /&gt;
&lt;br /&gt;
== The solution ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Shared hosting1.png|345px|right|The OpenVZ way of shared webhosting]]&lt;br /&gt;
&lt;br /&gt;
You can waste hours of time in securing all the possible things you don't want in your shared webhosting environment. And unless you are very familiar with all the things modern scripting languages can do, you probably miss dozens of alternative routes. In this process you frustrate your clients, because security always means that legitimate things break. As a side effect of your hard work, you can waste hours of extra time in educating your users. But in the end most users don't care about security, unless they are themselves victims of a compromised host. Learning the hard way is by far the most effective method. One possible solution is dedicated webhosting, but most users don't have the experience to maintain a server or it is way to expensive for them.&lt;br /&gt;
&lt;br /&gt;
The main problem with shared webhosting is that by its very nature all files which are served through the web are public. Apache for example uses only one account to read all files. As said, you can use tricks with CGI wrappers to execute the scripting languages under its own credentials. However this kind of security depends on the wrappers ability to securely separate the users. We all know that if this is broken &amp;amp;mdash; and most often it will be broken &amp;amp;mdash; the result is a higher clearance on the underlying filesystem. For most systems you need more than one wrapper, so the number of possible security problems grow. The ultimate user separation is in the kernel and you can view the modifications OpenVZ has done in this light. Instead of CGI wrappers we go one step higher and give every user its own minimal server. In the rest of this article we describe how shared webhosting with OpenVZ could be implemented.&lt;br /&gt;
&lt;br /&gt;
=== Minimal server ===&lt;br /&gt;
&lt;br /&gt;
Create an CTx with your favorite distro. Give it an internal IP-address in one of the ranges 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16. Then strip away all unnecessary init.d scripts so only the bare minimum is started. That means as a minimum syslogd and ssh so the account holder can upload his/her files through SCP/SFTP in his/her own minimal server. For this to work you need to set up [[Using NAT for container with private IPs|destination NAT on CT0]] from high numbered ports to port 22 on the given private IP address:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dnat=&amp;quot;-j DNAT --to-destination&amp;quot;&lt;br /&gt;
&lt;br /&gt;
iptables -t nat -P PREROUTING ACCEPT&lt;br /&gt;
iptables -t nat -A PREROUTING -p TCP --dport 10122 $dnat 192.168.13.101:22&lt;br /&gt;
iptables -t nat -A PREROUTING -p TCP --dport 10222 $dnat 192.168.13.102:22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The other thing you want for webhosting is of course a webserver as well. To minimize the amount of needed memory, we choose [http://www.lighttpd.net/ Lighttpd] instead of the common Apache. Then configure the scripting language of your choice to run under this webserver. It is possible to use different languages/setups for different accounts as well. Also problematic CGI-scripts are not problematic anymore...&lt;br /&gt;
&lt;br /&gt;
=== MySQL server ===&lt;br /&gt;
&lt;br /&gt;
Most webhosting accounts use MySQL, but if you prefer another database server, go ahead. Create a new CTx with a lot more resources and again an internal IP-address. Now configure the accounts. As an extra security measure you can use the internal IP-address as well.&lt;br /&gt;
&lt;br /&gt;
==== MySQL socket sharing ====&lt;br /&gt;
&lt;br /&gt;
You can also share the socket of an CTx running MySQL, which is alot faster than TCP/IP.&lt;br /&gt;
e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln /var/lib/vz/private/101/var/run/mysqld/mysqld.sock /var/lib/vz/private/102/var/run/mysqld/mysqld.sock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Inside of 102:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -u root -p -S /var/run/mysqld/mysqld.sock&lt;br /&gt;
Enter password:&lt;br /&gt;
Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;
Your MySQL connection id is 9 to server version: 5.0.32-Debian_7etch1-log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Refreshing links to MySQL socket ====&lt;br /&gt;
&lt;br /&gt;
Sharing the MySQL socket works really well until the MySQL database is restarted or the container running MySQL is restarted.  When this happens, the socket file is removed and recreated.  In most cases, a different inode will be used, causing existing hard links to the mysql.sock file to no longer work.  The solution is to relink these sockets. &lt;br /&gt;
&lt;br /&gt;
There are more elegant solutions to this problem, but the following script is a decent hack that can be run via a cron job every minute or two.  It will loop through all containers between START_CTID and STOP_CTID and make sure that the links point to the correct socket.  If they do not, the link will be recreated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Created by Tauren Mills (tauren at tauren dot com) 2007-11-15&lt;br /&gt;
&lt;br /&gt;
###################################&lt;br /&gt;
# Start of Configuration settings #&lt;br /&gt;
###################################&lt;br /&gt;
&lt;br /&gt;
# Location of private containers:&lt;br /&gt;
PRIVATE=/vz/private&lt;br /&gt;
&lt;br /&gt;
# Starting CT ID.  CTIDs with this ID or greater will have mysql.sock link created&lt;br /&gt;
START_CTID=1001&lt;br /&gt;
&lt;br /&gt;
# Stopping CT ID.  CTIDs with this ID or less will have mysql.sock link created&lt;br /&gt;
STOP_CTID=2000&lt;br /&gt;
&lt;br /&gt;
# Shared Mysql CT ID:&lt;br /&gt;
MYSQL_CTID=201&lt;br /&gt;
&lt;br /&gt;
# Location of mysql socket file&lt;br /&gt;
MYSQL_SOCK_DIR=/var/lib/mysql&lt;br /&gt;
&lt;br /&gt;
# Mysql socket file name&lt;br /&gt;
MYSQL_SOCK=mysql.sock&lt;br /&gt;
&lt;br /&gt;
#################################&lt;br /&gt;
# End of Configuration settings #&lt;br /&gt;
#################################&lt;br /&gt;
&lt;br /&gt;
# Display output if quiet is 0&lt;br /&gt;
QUIET=0&lt;br /&gt;
&lt;br /&gt;
if [ $# -eq 1 -a &amp;quot;$1&amp;quot; = &amp;quot;--quiet&amp;quot; ]; then&lt;br /&gt;
        QUIET=1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Full path to socket&lt;br /&gt;
MYSQL_SOCK_FILE=${PRIVATE}/${MYSQL_CTID}${MYSQL_SOCK_DIR}/${MYSQL_SOCK}&lt;br /&gt;
&lt;br /&gt;
[ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo&lt;br /&gt;
[ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;Relinking process starting...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get current location so we can set it back later&lt;br /&gt;
oldDirectory=`pwd`&lt;br /&gt;
&lt;br /&gt;
# Check to see if MySQL container socket exists&lt;br /&gt;
if [ -S &amp;quot;${MYSQL_SOCK_FILE}&amp;quot; ]; then&lt;br /&gt;
&lt;br /&gt;
        # Get inode of MySQL container socket&lt;br /&gt;
        mysql_inode=`ls -i ${MYSQL_SOCK_FILE} | awk '{ print $1;}'`&lt;br /&gt;
&lt;br /&gt;
        # Search through containers&lt;br /&gt;
        cd $PRIVATE&lt;br /&gt;
        for i in * ; do&lt;br /&gt;
                # The current container to process&lt;br /&gt;
                veid=$i&lt;br /&gt;
&lt;br /&gt;
                # Check if container should be processed&lt;br /&gt;
                if [ $veid -ne $MYSQL_CTID -a $veid -ge $START_CTID -a $veid -le $STOP_CTID ]; then&lt;br /&gt;
&lt;br /&gt;
                        # Get this container's socket&lt;br /&gt;
                        vesock=${PRIVATE}/${veid}${MYSQL_SOCK_DIR}/${MYSQL_SOCK}&lt;br /&gt;
&lt;br /&gt;
                        # Make sure folder exists&lt;br /&gt;
                        mkdir -p ${PRIVATE}/${veid}${MYSQL_SOCK_DIR}&lt;br /&gt;
&lt;br /&gt;
                        # Check to see if this container has a socket already&lt;br /&gt;
                        if [ -S &amp;quot;${vesock}&amp;quot; ]; then&lt;br /&gt;
                                # Get inode of this container socket&lt;br /&gt;
                                ve_inode=`ls -i ${vesock} | awk '{ print $1;}'`&lt;br /&gt;
&lt;br /&gt;
                                # Test if sockets are the same&lt;br /&gt;
                                if [ $mysql_inode -eq $ve_inode ]; then&lt;br /&gt;
                                        # No action required&lt;br /&gt;
                                        [ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;$veid VALID:  socket ${vesock}&amp;quot;&lt;br /&gt;
                                else&lt;br /&gt;
                                        # Remove existing file if any&lt;br /&gt;
                                        if [ -a &amp;quot;${vesock}&amp;quot; ]; then&lt;br /&gt;
                                                rm ${vesock}&lt;br /&gt;
                                        fi&lt;br /&gt;
&lt;br /&gt;
                                        # Create hardlink to mysql socket file&lt;br /&gt;
                                        ln ${MYSQL_SOCK_FILE} ${vesock}&lt;br /&gt;
&lt;br /&gt;
                                        [ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;$veid FIXED:  socket ${vesock}&amp;quot;&lt;br /&gt;
                                fi&lt;br /&gt;
                        else&lt;br /&gt;
                                # Socket didn't exist or file wasn't a socket&lt;br /&gt;
&lt;br /&gt;
                                # Remove existing file if any&lt;br /&gt;
                                if [ -a &amp;quot;${vesock}&amp;quot; ]; then&lt;br /&gt;
                                        rm ${vesock}&lt;br /&gt;
                                fi&lt;br /&gt;
&lt;br /&gt;
                                # Create hardlink to mysql socket file&lt;br /&gt;
                                ln ${MYSQL_SOCK_FILE} ${vesock}&lt;br /&gt;
&lt;br /&gt;
                                [ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;$veid FIXED:  socket ${vesock}&amp;quot;&lt;br /&gt;
                        fi&lt;br /&gt;
                else&lt;br /&gt;
                        [ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;$veid SKIPPED&amp;quot;&lt;br /&gt;
                fi&lt;br /&gt;
        done&lt;br /&gt;
else&lt;br /&gt;
        [ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;${MYSQL_SOCK_FILE} does not exist. Is MySQL running?&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
cd $oldDirectory&lt;br /&gt;
&lt;br /&gt;
[ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo &amp;quot;Relinking process complete.&amp;quot;&lt;br /&gt;
[ $QUIET -eq 0 ] &amp;amp;&amp;amp; echo&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following post on the OpenVZ forum has some other suggestions on how to deal with this issue:&lt;br /&gt;
[http://forum.openvz.org/index.php?t=rview&amp;amp;goto=23305#msg_23305 Shared webhosting - problem with mysql socket]&lt;br /&gt;
&lt;br /&gt;
=== Proxy webserver ===&lt;br /&gt;
&lt;br /&gt;
Because we have only one public IP-address, we need an trick to access every minimal server based on the hostname in the HTTP request. For SSH we used different ports, but that is not an option for websites. Again we create an CTx with an internal IP-address. On this server we install Lighttpd as well, because the proxying is very simple. First we must forward port 80 to this server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dnat=&amp;quot;-j DNAT --to-destination&amp;quot;&lt;br /&gt;
&lt;br /&gt;
iptables -t nat -P PREROUTING ACCEPT&lt;br /&gt;
iptables -t nat -A PREROUTING -p TCP -d &amp;amp;lt;external IP-address&amp;gt; --dport 80 $dnat 192.168.13.11:80&lt;br /&gt;
iptables -t nat -A PREROUTING -p TCP --dport 10122 $dnat 192.168.13.101:22&lt;br /&gt;
iptables -t nat -A PREROUTING -p TCP --dport 10222 $dnat 192.168.13.102:22&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we create for every website an section in /etc/lighttpd/lighttpd.conf as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$HTTP[&amp;quot;host&amp;quot;] == &amp;quot;ve101.armorica.tk&amp;quot; {&lt;br /&gt;
  proxy.server  = ( &amp;quot;&amp;quot; =&amp;gt; ( ( &amp;quot;host&amp;quot; =&amp;gt; &amp;quot;192.168.13.101&amp;quot; ) ) )&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can map more names to the same IP-address if needed. The last step is to add mod_proxy to the server.modules section.&lt;br /&gt;
&lt;br /&gt;
For apache add a VirtualHost directive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost external-IP-address:80&amp;gt;&lt;br /&gt;
        ServerName mydomainnameishere.com&lt;br /&gt;
        RewriteEngine     On&lt;br /&gt;
        RewriteRule       ^(.*)$        http://192.168.2.101$1  [P]&lt;br /&gt;
        RewriteRule       ^(.*)$        http://mydomainnameishere.com$1   [P]&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost external-IP-address:80&amp;gt;&lt;br /&gt;
        ServerName mydomainnameishere.com&lt;br /&gt;
        RewriteEngine     On&lt;br /&gt;
        RewriteRule       ^(.*)$        http://192.168.2.101$1  [P]&lt;br /&gt;
        RewriteRule       ^(.*)$        http://www.mydomainnameishere.com$1   [P]&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other applications ===&lt;br /&gt;
&lt;br /&gt;
Create for other applications as mail, make sure that the minimal servers use this one for sending mail from webpages, DNS etc. CTx as needed. The resulting server is shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=3980</id>
		<title>User:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=3980"/>
		<updated>2008-01-17T16:05:52Z</updated>

		<summary type="html">&lt;p&gt;Grin: adding links for myself&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;see me [http://hu.wikipedia.org/wiki/user:grin there].&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== resource management ==&lt;br /&gt;
=== quotas ===&lt;br /&gt;
* [[OpenVZ disk quota, df and stat weird behaviour]]&lt;br /&gt;
* [[Checking disk quota]]&lt;br /&gt;
* [[Resource shortage]]&lt;br /&gt;
* [[FAQ#What_filesystems_should_I_choose_for_saving_my_VEs.3F]] (no support for xfs, fsck it)&lt;br /&gt;
* [[Resource management]]&lt;br /&gt;
* [[OpenVZ disk quota system]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=3663</id>
		<title>User:Grin</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=User:Grin&amp;diff=3663"/>
		<updated>2007-11-27T00:10:02Z</updated>

		<summary type="html">&lt;p&gt;Grin: there i am&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;see me [http://hu.wikipedia.org/wiki/user:grin there].&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3662</id>
		<title>Installation on Debian/old</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Installation_on_Debian/old&amp;diff=3662"/>
		<updated>2007-11-27T00:06:13Z</updated>

		<summary type="html">&lt;p&gt;Grin: /* Install the toolset */ it needs the repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sarge-Dapper (OldStable) =&lt;br /&gt;
The OpenVZ packages at http://debian.systs.org/ aimed to install OpenVZ in a easy way, some tasks are even completed during the install process!&lt;br /&gt;
&lt;br /&gt;
== edit apt source settings ==&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/debian sarge openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== precompiled kernel images at debian.systs.org (dso) ==&lt;br /&gt;
The kernel-images on debian.systs.org (dso) use the same kernel-config taken from OpenVZ.&lt;br /&gt;
(most kernel-modules are built-in!)&lt;br /&gt;
&lt;br /&gt;
If there is more than one CPU available (or a CPU with hyperthreading), use the kernel-smp deb.&lt;br /&gt;
If there is more than 4 Gb of RAM available, use the kernel-enterprise deb.&lt;br /&gt;
Otherwise, use the plain kernel deb (kernel).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''Kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! -smp&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -entnosplit&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 VPSs&lt;br /&gt;
|-&lt;br /&gt;
! -enterprise&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 VPSs&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
kernel-image: i368 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9&lt;br /&gt;
 ovzkernel-2.6.9-smp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kernel-image: i386 only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.9-enterprise &lt;br /&gt;
 ovzkernel-2.6.9-entnosplit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVZ tool(s) for i386 and amd64&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl&lt;br /&gt;
 vzquota&lt;br /&gt;
 vzprocps&lt;br /&gt;
 vzdump&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template(s) for i368 and amd64 : Debian 3.1 Minimal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== installing the kernel-images, toolset and debian-os-template ==&lt;br /&gt;
Example: install the stable OpenVZ kernel, tools and Debian OS Template&lt;br /&gt;
&lt;br /&gt;
 # aptitude install ovzkernel-2.6.9 vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are using GRUB, maybe you need to update the /boot/grub/menu.lst file&lt;br /&gt;
(can be configured at /etc/kernel-img.conf):&lt;br /&gt;
&lt;br /&gt;
 # /sbin/grub-update &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot in your new Debian Sarge OpenVZ System&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all :-)&lt;br /&gt;
&lt;br /&gt;
Now it's time to setup your VEs with the minimal Debian-3.1 Template, create new one or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
= Etch (Stable) =&lt;br /&gt;
OpenVZ is now a part of Debian Etch repository. The packages are 'vzctl' and 'vzquota'.&lt;br /&gt;
&lt;br /&gt;
== install the kernel-image ==&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at download.openvz.org ===&lt;br /&gt;
&lt;br /&gt;
A Debian OpenVZ kernel repository is online, for direct access http://download.openvz.org/kernel/debian/etch/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://download.openvz.org/debian etch main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update package lists&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
List downloadable OpenVZ linux-images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-cache search linux-image-2.6.18-openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install a kernel&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== precompiled kernel images at debian.systs.org ===&lt;br /&gt;
&lt;br /&gt;
Add to your &amp;quot;/etc/apt/sources.list&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 deb http://debian.systs.org/ etch openvz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the signing key of debian.systs.org (dso) apt-keyring, (need root permissions)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # wget http://debian.systs.org/dso_archiv_signing_key.asc -q -O - | apt-key add -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get the new package lists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose a linux image (version 028stab048.1) :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 ovzkernel-2.6.18 (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-smp (i386 and amd64)&lt;br /&gt;
 ovzkernel-2.6.18-enterprise only (i386)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 # apt-get install &amp;lt;linux-image&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build your own kernel-image (debian way) ===&lt;br /&gt;
&lt;br /&gt;
==== Installing sources ====&lt;br /&gt;
&lt;br /&gt;
To install the kernel-source and the OpenVZ kernel patch, run:&lt;br /&gt;
 # apt-get install kernel-package linux-source-2.6.18 kernel-patch-openvz libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
==== Unpacking ====&lt;br /&gt;
&lt;br /&gt;
Unpack the kernel source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # tar xjf linux-source-2.6.18.tar.bz2&lt;br /&gt;
 # cd linux-source-2.6.18&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Kernel config ====&lt;br /&gt;
&lt;br /&gt;
You need a kernel config.&lt;br /&gt;
You can use the config of the debian-kernel:&lt;br /&gt;
 # cp /boot/config-2.6.18-5-686 .config&lt;br /&gt;
&lt;br /&gt;
'''Or''' get a 2.6.18 kernel configuration from  http://download.openvz.org/kernel/branches/2.6.18/current/configs/ (depending on your architecture; the below example is for i686):&lt;br /&gt;
 # wget http://download.openvz.org/kernel/branches/2.6.18/current/configs/kernel-2.6.18-i686.config.ovz -O .config&lt;br /&gt;
&lt;br /&gt;
==== Patching and configuring ====&lt;br /&gt;
&lt;br /&gt;
Now you can apply the openvz kernel patch and modify your kernel-config:&lt;br /&gt;
 # ../kernel-patches/all/apply/openvz&lt;br /&gt;
 # make menuconfig&lt;br /&gt;
&lt;br /&gt;
You need the following OpenVZ kernel config settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(taken from OpenVZ Kernel 2.6.18-028test010.1 on 686)&lt;br /&gt;
&lt;br /&gt;
Filesystem&lt;br /&gt;
\_ [*] Second extended fs support (CONFIG_EXT2_FS)&lt;br /&gt;
\_ [*] Ext3 journalling file system support (CONFIG_EXT3_FS)&lt;br /&gt;
\_ [M] Quota Support (CONFIG_QUOTA)&lt;br /&gt;
	\_ [*] Compatibility with older quotactl interface (CONFIG_QUOTA_COMPAT)&lt;br /&gt;
	\_ [*]Quota format v2 support (CONFIG_QFMT_V2)&lt;br /&gt;
\_ [*] VPS filesystem (CONFIG_SIM_FS)&lt;br /&gt;
\_ [M] Virtuozzo Disk Quota support	(CONFIG_VZ_QUOTA)&lt;br /&gt;
	\-&amp;gt; [*] Per-user and per-group quota in Virtuozzo quota partitions (VZ_QUOTA_UGID)&lt;br /&gt;
&lt;br /&gt;
Security&lt;br /&gt;
	\-&amp;gt;[ ] Enable different security models&lt;br /&gt;
&lt;br /&gt;
OpenVZ ... (what else :-)&lt;br /&gt;
\_[*] Virtual Environment support (CONFIG_VE)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE calls interface (CONFIG_VE_CALLS)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE networking (CONFIG_VE_NETDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Virtual ethernet device (CONFIG_VE_ETHDEV)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE device (CONFIG_VZ_DEV)&lt;br /&gt;
	\_ [*] VE netfiltering (CONFIG_VE_IPTABLES)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; VE watchdog module (CONFIG_VZ_WDOG)&lt;br /&gt;
	\_ &amp;lt;M&amp;gt; Checkpointing &amp;amp; restoring Virtual Environments (CONFIG_VZ_CHECKPOINT)&lt;br /&gt;
&lt;br /&gt;
User resources ... (User Beancounters)&lt;br /&gt;
\_ [*] Enable user resource accounting (CONFIG_USER_RESOURCE)&lt;br /&gt;
\_ [*] Account physical memory usage ( CONFIG_USER_RSS_ACCOUNTING)&lt;br /&gt;
\_ [*] Account disk IO (CONFIG_UBC_IO_ACCT)&lt;br /&gt;
\_ [*] Account swap usage (CONFIG_USER_SWAP_ACCOUNTING)&lt;br /&gt;
\_ [*] Report resource usage in /proc (CONFIG_USER_RESOURCE_PROC)&lt;br /&gt;
\_ [*] User resources debug features (CONFIG_UBC_DEBUG)&lt;br /&gt;
\_ [*] Debug kmemsize with cache counters (CONFIG_UBC_DEBUG_KMEM)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|better to build the kernel-headers as well, so afterward other kernel-modules can &lt;br /&gt;
be built without whole kernel tree (e.g.  drbd -&amp;gt; drbd0.7-module-source)}}&lt;br /&gt;
&lt;br /&gt;
See also : &amp;quot;make-kpkg --targets&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Compiling ====&lt;br /&gt;
&lt;br /&gt;
Compile your kernel (as user root, or you need the --rootcmd!)&lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd binary-arch&lt;br /&gt;
 or all above with one step &lt;br /&gt;
 # make-kpkg --append_to_version=-1-openvz --added_patches=openvz --revision=1 --initrd --config menuconfig binary-arch&lt;br /&gt;
&lt;br /&gt;
==== Installing ====&lt;br /&gt;
Install the kernel and update initramfs:&lt;br /&gt;
&lt;br /&gt;
 # dpkg -i ../linux-image-2.6.18-1-openvz_1_i386.deb&lt;br /&gt;
 # update-initramfs -c -k 2.6.18-1-openvz&lt;br /&gt;
&lt;br /&gt;
{{Note|update-initramfs is done, when make-kpkg is use with --initrd option}}&lt;br /&gt;
&lt;br /&gt;
{{Note|update-grub can be configured by /etc/kernel-img.conf}}&lt;br /&gt;
&lt;br /&gt;
==== Bootloader ====&lt;br /&gt;
&lt;br /&gt;
Update the bootloader (if not done before)&lt;br /&gt;
&lt;br /&gt;
GRUB :&lt;br /&gt;
&lt;br /&gt;
 # /usr/sbin/update-grub&lt;br /&gt;
&lt;br /&gt;
{{Note|since the Debian Etch release the location of update-grub is moved from /sbin/update-grub to /usr/sbin/update-grub}}&lt;br /&gt;
&lt;br /&gt;
== Install the toolset ==&lt;br /&gt;
&lt;br /&gt;
You need the toolset for managing OpenVZ Virtual Environments (VE) (You will need ''deb http://debian.systs.org/ etch openvz'' repository for that.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 # apt-get install vzctl vzquota vzdump vzctl-ostmpl-debian&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= modify needed settings =&lt;br /&gt;
&lt;br /&gt;
If you want network access for the virtual server then you need to enable IP forwarding.&lt;br /&gt;
&lt;br /&gt;
An old (before Etch) Debian Way: set &amp;quot;ip_forward&amp;quot; to yes in /etc/network/option.&lt;br /&gt;
&lt;br /&gt;
 # editor /etc/network/options&lt;br /&gt;
&lt;br /&gt;
The new (from Etch) standard way is to use sysctl for this (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some cases you may need to enable proxy_arp for the network devices that you want your virtual hosts to be accessible on.&lt;br /&gt;
You can add this to a specific interface in the network configuration (/etc/network/interfaces) by the following lines, replace %DEV% with your device name (ie. eth0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
# device: %DEV%&lt;br /&gt;
iface %DEV% inet static&lt;br /&gt;
        address 192.168.0.2&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        network 192.168.2.0&lt;br /&gt;
        broadcast 192.168.2.255&lt;br /&gt;
        gateway 192.168.2.1&lt;br /&gt;
&lt;br /&gt;
        up sysctl -w net.ipv4.conf.%DEV%.proxy_arp=100&lt;br /&gt;
        pre-down sysctl -w net.ipv4.conf.%DEV%.proxy_arp=0&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or use the /etc/network/if-up/ and /etc/network/if-down.d/ directories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: # man 5 interfaces (to read more about debian's network interface configuration for ifup and ifdown)&lt;br /&gt;
 INFO: It is recommanded to add the magic-sysrq key, to your /etc/sysctl.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a (plain) OpenVZ Linux Way:&lt;br /&gt;
&lt;br /&gt;
Add settings to &amp;quot;/etc/sysctl.conf&amp;quot;&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;
&lt;br /&gt;
 # Enables source route verification&lt;br /&gt;
 net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
&lt;br /&gt;
 # Enables the magic-sysrq key&lt;br /&gt;
 kernel.sysrq = 1&lt;br /&gt;
&lt;br /&gt;
 # TCP Explict Congestion Notification&lt;br /&gt;
 # net.ipv4.tcp_ecn = 0&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 INFO: Suggestion: Please make a symlink from /var/lib/vz to /vz as backward compability to Main OpenVZ&lt;br /&gt;
 (Debian vz root directory is installed FHS-like to /var/lib/vz)&lt;br /&gt;
&lt;br /&gt;
 # ln -s /var/lib/vz /vz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before you restart your Server, keep in mind, that your system has all needed modules enabled; booting from your harddisk (e.g. hardware modules, raid system(s), lvm2 etc). May you need a INITRD (initramdisk) or compile needed kernel modules statically in.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's all!&lt;br /&gt;
&lt;br /&gt;
Now it's time to create a OS Template or download another precreated OS-Template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 INFO: Suggestions: Setup your default OS Template in /etc/vz/vz.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Grin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=3660</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=3660"/>
		<updated>2007-11-26T23:31:41Z</updated>

		<summary type="html">&lt;p&gt;Grin: open our eyes... link to debian based system install ;-)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document briefly describes the steps needed to install OpenVZ on your (RPM based) machine. For '''Debian''' based systems see [[Installation on Debian]].&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;
[http://wiki.openvz.jp Japanese],&lt;br /&gt;
[[Quick_installation_(Spanish)|Spanish]].&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.swsoft.com/en/products/virtuozzo/hcl/ Virtuozzo HCL].&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for VEs private directories (by default /vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-VE disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-VE quota in this context includes not only pure per-VE quota, but also usual Linux disk quota used in VE, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using root partition for VEs, because the root user of VE will be able to overcome 5% disk space barrier in some situations. This way HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-VE disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-VE disk quota.&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;
# rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ&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 are 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>Grin</name></author>
		
	</entry>
</feed>