User`s guide
Managing Resources 119
Splitting server Into Equal Pieces
It is possible to create a Container configuration roughly representing a given fraction of the
server. If you want to create such a configuration that up to 20 fully loaded Containers would be
able to be simultaneously running on the given server, you can do it as follows:
# cd /etc/vz/conf
# vzsplit -n 20 -f mytest
Config /etc/vz/conf/ve-mytest.conf-sample was created
Notice that the configuration produced depends on the given server resources. Therefore, it is
important to validate the resulted configuration file before trying to use it, which is done with
the help of the vzcfgvalidate utility. For example:
# vzcfgvalidate ve-mytest.conf-sample
Recommendation: kmemsize.lim-kmemsize.bar should be > 253952 \
(currently, 126391)
Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 93622)
The number of Containers you can run on the server is actually several times greater than the
value specified in the command line because Containers normally do not consume all the
resources that are guaranteed to them. To illustrate this idea, let us look at the Container created
from the configuration produced above:
# pctl create 101 --ostemplate redhat-el5-x86 --config mytest
Creating Container private area (redhat-el5-x86)
Container is mounted
Postcreate action done
Container is unmounted
Container private area created
Container registered successfully
# pctl set 101 --ipadd 192.168.1.101 --save
Saved parameters for Container 101
# pctl start 101
Starting Container ...
Container is mounted
...
# vzcalc 101
Resource Current(%) Promised(%) Max(%)
Memory 0.53 1.90 6.44
As is seen, if Containers use all the resources guaranteed to them, then around 20 Containers can
be simultaneously running. However, taking into account the Promised column output, it is safe
to run 40-50 such Containers on this server.
Note: If you generate a Container configuration sample using the vzsplit command line
utility, the resulting Container sample is put to the /etc/vz/conf directory. This sample can
then be used by pctl create when creating a new Container on its basis.










