Previous page

Next page

Locate page in Contents

Print this page

set

Summary:

Sets the server configuration parameters.

Request specification (uses explicit config):

Name

Min/Max

Type

Description

set

 

 

 

{

 

 

 

eid

1..1

eid_type

Server ID.

config

1..1

env_configType

Server configuration. When modifying Virtuozzo Container configuration, use venv_configType.

force

0..1

none

Ignore possible pool problems and forcibly assign the IP address.

default

0..1

 

Use this element to specify a list of configuration parameters for which you want to use the default values.

{

 

 

 

parameter

1..[]

string

Parameter name.

}

 

 

 

set_mode

0..1

string

Specifies the operation mode:

restart -- restart the server if it is required to do so for a new parameter value to take effect.

ignore -- ignore possible errors while applying the new values to the running server.

Request specification (uses sample config):

Name

Min/Max

Type

Description

set

 

 

 

{

 

 

 

eid

1..1

eid_type

Server ID.

apply_config

0..1

 

 

{

 

 

 

sample_conf

1..1

guid_type

Sample configuration ID.

parameter

0..[]

string

A list of the parameters to set. See env_configType for the parameter names. When modifying Virtuozzo Container configuration, see venv_configType.

The template and network specific parameters cannot be changed (template, os_template, ve_root, ve_private, hostname, ip_address).

category

0..[]

string

A list of parameter categories. If you would like to set an entire category (or multiple categories) of the parameters, specify it here. The list of applicable categories can be retrieved from the Agent vocabulary (see Example 2 below).

config_customized

0..1

boolean

A flag indicating that the server configuration has been customized after the server was created. Set this element to true to save the flag in the configuration file for future reference.

}

 

 

 

set_mode

0..1

string

Specifies the operation mode:

restart -- restart the server if it is required to do so for the new value to take effect.

ignore -- ignore possible errors while applying the new values to the running server.

}

 

 

 

Returns:

Name

Min/Max

Type

Description

env_config

0..1

env_configType

The updated configuration information.

Description:

The call modifies the server configuration parameters. The configuration parameters can be passed explicitly by specifying the parameters and values in the request (syntax #1 above) or they can be passed by specifying the ID of the sample configuration (syntax #2). In the second case, the values will be read from the sample configuration file. You can apply the entire sample configuration to the server or you can modify the values of individual parameters by specifying their names in the request.

The new values are applied to the server immediately and are saved in the configuration file, making the configuration changes permanent.

To modify the configuration parameters for a Virtuozzo Container, use the vzanevm interface.

Example 1:

Assigning a new hostname and adding a search domain to a Virtuozzo Container. Also adding two DNS servers to the default venet0 virtual network adapter.

Input

<packet version="4.0.0">

<target>vzaenvm</target>

<data>

<vzaenvm>

<set>

<eid>3288bb6b-8a49-4230-b565-6ad5521182aa</eid>

<config>

<hostname>myhost</hostname>

<search_domain>ts6.com</search_domain>

<net_device>

<id>venet0</id>

<nameserver>192.168.1.51</nameserver>

<nameserver>192.168.1.52</nameserver>

</net_device>

</config>

</set>

</vzaenvm>

</data>

</packet>

Example 2:

Setting QoS parameters using the values from a sample configuration file. The QoS parameters belong to the "qos" category in the file, therefore if we specify the category name, the values of all QoS parameters will be set using the values from the specified sample configuration.

Input

<packet version="4.0.0" id="654">

<target>vzaenvm</target>

<data>

<vzaenvm>

<set>

<eid>6dbd99dc-f212-45de-a5f4-ddb78a2b5280</eid>

<apply_config>

<sample_conf>f8e96630-7fd8-4eee-93b2-3ad7b6b53916</sample_conf>

<category>qos</category>

</apply_config>

</set>

</vzaenvm>

</data>

</packet>

To retrieve the list of the applicable categories from the vocabulary, use the following request:

<packet version="4.0.0">

<data>

<system>

<get_vocabulary>

<name>generic</name>

<category>applicable_conf</category>

</get_vocabulary>

</system>

</data>

</packet>

Linux Example 3:

Modifying the IP address for venet0 network adapter, which is the default virtual adapter inside a Virtuozzo Container. This modification works in such a way that the existing IP addresses are first removed from the adapter's configuration and then the passed addresses are added. To add an IP address, first retrieve the existing addresses, then add the new address (or addresses) to the list, and then include the entire list in the request. On Linux, when modifying the default venet0 adapter, the host_routed element must be present in the request. Configuring a non-default virtual network adapter is similar with one exception: you cannot use the host_routed mode, so you have to attach the adapter to an existing Virtuozzo virtual network by including the network_id element containing the ID of the virtual network.

Input

<packet version="4.0.0">
<target>vzaenvm</target>
<data>
<vzaenvm>
<set>
<eid>72145bf0-7562-43d4-b707-cc33d37e3f10</eid>
<config>
<net_device>
<id>venet0</id>
<ip_address>
<ip>10.130.1.1</ip>

</ip_address>

<ip_address>
<ip>10.130.1.2</ip>

</ip_address>

<ip_address>
<ip>10.130.1.3</ip>

</ip_address>
<host_routed/>
</net_device>
</config>
</set>
</vzaenvm>
</data>
</packet>

WindowsExample 4:

This example is a Windows version of the previous example (modifying the IP address configuration for the default venet0 network adapter). The difference here is that you may or may not have to include the host_routed element depending on the following conditions:

In our example, we are switching the adapter to the bridged mode and attaching it to the specified Virtuozzo virtual network. For more information on Virtuozzo virtual networks, see the vzanetworkm interface.

Input

<packet version="4.0.0">
<target>vzaenvm</target>
<data>
<vzaenvm>
<set>
<eid>72145bf0-7562-43d4-b707-cc33d37e3f10</eid>
<config>
<net_device>
<id>venet0</id>
<ip_address>
<ip>10.130.1.1</ip>

</ip_address>

<ip_address>
<ip>10.130.1.2</ip>

</ip_address>

<ip_address>
<ip>10.130.1.3</ip>

</ip_address>

<network_id>dnpuZXQx</network_id>
</net_device>
</config>
</set>
</vzaenvm>
</data>
</packet>

Please send us your feedback on this help page