Editing User Guide/Managing Resources

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 572: Line 572:
 
=== Validating Container Configuration ===
 
=== Validating Container Configuration ===
 
The system resource control parameters have complex interdependencies. Violation of these interdependencies can be catastrophic for the Container. In order to ensure that a Container does not break them, it is important to validate the CT configuration file before creating CTs on its basis.
 
The system resource control parameters have complex interdependencies. Violation of these interdependencies can be catastrophic for the Container. In order to ensure that a Container does not break them, it is important to validate the CT configuration file before creating CTs on its basis.
 
+
The typical validation scenario is shown below:
Here is how to validate a CT configuration:
 
  
 
  # '''vzcfgvalidate /etc/vz/conf/101.conf'''
 
  # '''vzcfgvalidate /etc/vz/conf/101.conf'''
Line 579: Line 578:
 
  Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
 
  Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
 
  Recommendation: othersockbuf.bar should be > 132096 (currently, 122880)
 
  Recommendation: othersockbuf.bar should be > 132096 (currently, 122880)
 +
# '''vzctl set 101 --kmemsize 2211840:2359296 --save'''
 +
Saved parameters for CT 101
 +
# '''vzcfgvalidate  /etc/vz/conf/101.conf'''
 +
Recommendation: kmemsize.lim-kmemsize.bar should be > 163840 (currently, 147456)
 +
Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
 +
Recommendation: othersockbuf.bar should ba > 132096 (currently, 122880)
 +
Validation completed: success
  
 
The utility checks constraints on the resource management parameters and displays all the constraint violations found. There can be three levels of violation severity:
 
The utility checks constraints on the resource management parameters and displays all the constraint violations found. There can be three levels of violation severity:
Line 592: Line 598:
 
|}
 
|}
  
==== Manual adjustment ====
+
In the scenario above, the first run of the vzcfgvalidate utility found a critical error for the kmemsize parameter value. After setting reasonable values for kmemsize, the resulting configuration produced only recommendations, and the Container can be safely run with this configuration.
 
 
To fix errors or warnings reported by <code>vzcfgvalidate</code>, adjust the parameters accordingly and re-run the <code>vzcfgvalidate</code>.
 
 
 
# '''vzctl set 101 --kmemsize 2211840:2359296 --save'''
 
Saved parameters for CT 101
 
# '''vzcfgvalidate  /etc/vz/conf/101.conf'''
 
Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
 
Recommendation: othersockbuf.bar should ba > 132096 (currently, 122880)t
 
Validation completed: success
 
 
 
In the scenario above, the first run of the <code>vzcfgvalidate</code> utility found a critical error for the <code>kmemsize</code> parameter value. After setting reasonable values for <code>kmemsize</code>, the resulting configuration produced only recommendations, and the Container can be safely run with this configuration.
 
 
 
==== Automatic adjustment ====
 
 
 
FIXME: vzcfgvalidate -r|-i
 
 
 
=== Applying New Configuration Sample to Container ===
 
 
 
The OpenVZ software enables you to change the configuration sample file a Container is based on and, thus, to modify all the resources the Container may consume and/or allocate at once. For example, if Container 101 is currently based on the <code>light</code> configuration sample and you are planning to run some more heavy-weight application inside the Container, you may wish to apply the <code>basic</code> sample to it instead of <code>light</code>, which will automatically adjust the necessary Container resource parameters. To this effect, you can execute the following command on the Node:
 
 
 
# '''vzctl set 101 --applyconfig basic --save'''
 
Saved parameters for CT 101
 
 
 
This command reads the resource parameters from the <code>ve-basic.conf-sample</code> file located in the <code>/etc/vz/conf</code> directory and applies them one by one to Container 101.
 
 
 
When applying new configuration samples to Containers, please keep in mind the following:
 
 
 
* All Container sample files are located in the /etc/vz/conf directory on the Hardware Node and are named according to the following pattern: <code>ve-''name''.conf-sample</code>. You should specify only the <code>''name''</code> part of the corresponding sample name after the <code>--applyconfig</code> option (<code>basic</code> in the example above).
 
* The <code>--applyconfig</code> option applies all the parameters from the specified sample file to the given Container, except for the <code>OSTEMPLATE</code>, <code>VE_ROOT</code>, <code>VE_PRIVATE</code>, <code>HOSTNAME</code>, <code>IP_ADDRESS</code>, <code>TEMPLATE</code>, <code>NETIF</code> parameters (if they exist in the sample file).
 
* You may need to restart your Container depending on the fact whether the changes for the selected parameters can be set on the fly or not. If some parameters could not be configured on the fly, you will be presented with the corresponding message informing you of this fact.
 
 
 
 
<noinclude>{{UG/Footer}}</noinclude>
 
<noinclude>{{UG/Footer}}</noinclude>

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)