Previous page

Next page

Locate page in Contents

Print this page

validate

Summary:

Validates a sample configuration.

Request specification:

Name

Min/Max

Type

Description

validate

1..1

 

 

{

 

 

 

config

1..1

env_configType

Sample configuration. Only the qos portion of the derived type venv_configType is actually used here.

}

 

 

 

Returns:

Name

Min/Max

Type

Description

validation

1..1

validationType

Validation results. If the configuration is valid, the returned packet will be empty.

Description:

Sample configurations are used to create Virtuozzo Containers. A sample configuration contains QoS parameters that define how the system resources will be used. The values of the QoS parameters must satisfy the predefined formulae in order for the Container to function properly (you can find the formulae in the Agent dictionary). An individual formula usually has more than one QoS parameter, and an individual QoS parameter is usually referenced in more than one formula. So it is very important that the values of all the QoS parameters are set up correctly. The validate call will evaluate the current QoS parameter values using the existing formulae. If any of the formulae is violated, the return will contain the formula and the names of the invalid QoS parameters. You should always use this call to validate a new sample configuration before using it to create Virtuozzo Containers.

Example:

Submitting a Virtuozzo Container configuration for validation. Note the dcachesize QoS parameter. It contains a random value that we put there intentionally for the purpose of getting a negative validation result as a demonstration.

Input

<packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0.0">

<target>vzaenvm</target>

<data>

<vzaenvm>

<validate>

<config xsi:type="ns2:venv_configType">

<qos>

<id>avnumproc</id>

<hard>96</hard>

</qos>

<qos>

<id>cpuunits</id>

<hard>6677</hard>

</qos>

<qos>

<id>dcachesize</id>

<hard>222222222222</hard>

<soft>1717933</soft>

</qos>

<qos>

<id>dgramrcvbuf</id>

<hard>497780</hard>

<soft>497780</soft>

</qos>

<qos>

<id>diskinodes</id>

<hard>88000</hard>

<soft>80000</soft>

</qos>

<qos>

<id>diskspace</id>

<hard>225280</hard>

<soft>204799</soft>

</qos>

<qos>

<id>kmemsize</id>

<hard>8692068</hard>

<soft>7901880</soft>

</qos>

<qos>

<id>lockedpages</id>

<hard>385</hard>

<soft>385</soft>

</qos>

<qos>

<id>numfile</id>

<hard>3072</hard>

</qos>

<qos>

<id>numflock</id>

<hard>337</hard>

<soft>307</soft>

</qos>

<qos>

<id>numiptent</id>

<hard>100</hard>

</qos>

<qos>

<id>numothersock</id>

<hard>400</hard>

</qos>

<qos>

<id>numproc</id>

<hard>400</hard>

</qos>

<qos>

<id>numpty</id>

<hard>40</hard>

</qos>

<qos>

<id>numsiginfo</id>

<hard>1024</hard>

</qos>

<qos>

<id>numtcpsock</id>

<hard>400</hard>

</qos>

<qos>

<id>oomguarpages</id>

<hard>2147483647</hard>

<soft>11701</soft>

</qos>

<qos>

<id>othersockbuf</id>

<hard>2136180</hard>

<soft>497780</soft>

</qos>

<qos>

<id>physpages</id>

<hard>2147483647</hard>

<soft>0</soft>

</qos>

<qos>

<id>privvmpages</id>

<hard>12871</hard>

<soft>11701</soft>

</qos>

<qos>

<id>shmpages</id>

<hard>1170</hard>

</qos>

<qos>

<id>tcprcvbuf</id>

<hard>2633960</hard>

<soft>995560</soft>

</qos>

<qos>

<id>tcpsndbuf</id>

<hard>2633960</hard>

<soft>995560</soft>

</qos>

<qos>

<id>vmguarpages</id>

<hard>2147483647</hard>

<soft>11701</soft>

</qos>

</config>

</validate>

</vzaenvm>

</data>

</packet>

Output

The configuration that we submitted did not pass validation because the dcachesize parameter contained an incorrect value. The result set contains all of the affected parameters, the description of the problem, and the validation formula that was used.

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:ns2="http://www.swsoft.com/webservices/vza/4.0.0/vzaenvm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="24c462f8c2bt99re14" time="2007-04-25T19:51:05+0000" priority="0" version="4.0.0">

<ns1:origin>vzaenvm</ns1:origin>

<ns1:target>vzclient3</ns1:target>

<ns1:dst>

<ns1:director>gend</ns1:director>

</ns1:dst>

<ns1:data>

<ns2:vzaenvm>

<ns2:validation>

<ns2:type>0</ns2:type>

<ns2:qos_id>avnumproc</ns2:qos_id>

<ns2:qos_id>kmemsize</ns2:qos_id>

<ns2:qos_id>dcachesize</ns2:qos_id>

<ns2:warning>This constraint is important for reliable work of applications in the Virtual Private Server. If it is not satisfied , applications will start to fail at the middle of operations instead of failing at the moment of spawning more processes, and the application abilities to handle resource shortage will be very limited.</ns2:warning>

<ns2:formula>kmemsize.soft &amp;gt;= 40kb * avnumproc + dcachesize.hard</ns2:formula>

</ns2:validation>

</ns2:vzaenvm>

</ns1:data>

<ns1:src>

<ns1:director>gend</ns1:director>

</ns1:src>

</ns1:packet>

If a configuration is valid, you should receive a packet similar to the following example.

Output

<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:ns2="http://www.swsoft.com/webservices/vza/4.0.0/vzaenvm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="23c462f8c22tf3ere14" time="2007-04-25T19:50:58+0000" priority="0" version="4.0.0">

<ns1:origin>vzaenvm</ns1:origin>

<ns1:target>vzclient3</ns1:target>

<ns1:dst>

<ns1:director>gend</ns1:director>

</ns1:dst>

<ns1:data>

<ns2:vzaenvm/>

</ns1:data>

<ns1:src>

<ns1:director>gend</ns1:director>

</ns1:src>

</ns1:packet>

Please send us your feedback on this help page