6,534
edits
Changes
→Setting Name for Container: filled in
FIXME
== Setting Name for Container ==
You can assign an arbitrary name to your Container and use it, along with the Container ID, to refer to the Container while performing this or that Container-related operation on the Hardware Node. For example, you can start or stop a Container by specifying the Container name instead of its ID.
You can assign names to your Containers using the <code>--name</code> option of the <code>vzctl set</code> command. For example, to set the <code>computer1</code> name for Container 101, you should execute the following command:
# '''vzctl set 101 --name computer1 --save'''
Name computer1 assigned
Saved parameters for Container 101
You can also set a name for Container 101 by editing its configuration file. In this case you should proceed as follows:
<ol>
<li> Open the configuration file of Container 101 (<code>/etc/vz/conf/101.conf</code>) for editing and add the following string to the file:
NAME="computer1"
</li>
<li>In the <code>/etc/vz/names</code> directory on the Hardware Node, create a symbolic link with the name of <code>computer1</code> pointing to the Container configuration file. For example:
# ln --symbolic /etc/vz/conf/101.conf /etc/vz/names/computer1
</li>
</ol>
When specifying names for Containers, please keep in mind the following:
* Names may contain the following symbols: <code>a</code>-<code>z</code>, <code>A</code>-<code>Z</code>, <code>0</code>-<code>9</code>, underscores (<code>_</code>), dashes (<code>-</code>), spaces, the symbols from the ASCII character table with their code in the 128–255 range, and all the national alphabets included in the Unicode code space.
* Container names cannot consist of digits only; otherwise, there would be no way to distinguish them from Container IDs.
* If it contains one or more spaces, the Container name should be put in single or double quotes, or the spaces have to be escaped by preceding them with a backslashes (<code>\</code>).
After the name has been successfully assigned to Container 101, you can start using it instead of ID 101 to perform Container-related operations on the Node. For example:
<ul>
<li>You can stop Container 101 with the following command:
# '''vzctl stop computer1'''
Stopping container ...
Container was stopped
Container is unmounted
</li>
<li>You can start Container 101 anew by issuing the following command:
# '''vzctl start computer1'''
Starting container ...
...
</li></ul>
You can find out what name is assigned to Container 101 in one of the following ways:
<ul>
<li>Using the <code>vzlist</code> utility:
# '''vzlist -o name 101'''
NAME
computer1
</li>
<li>Checking the <code>NAME</code> parameter in the Container configuration file (<code>/etc/vz/conf/101.conf</code>). For example:
# '''grep NAME= /etc/vz/conf/101.conf'''
NAME="computer1"
</li>
<li>Checking which symlink in the <code>/etc/vz/names/</code> directory links to Container configuration file. The file name of the symlink is the name for Container. For example:
# '''ls -l /etc/vz/names/ | grep /101.conf'''
lrwxrwxrwx 1 root root 21 Jan 16 20:18 computer1 -> /etc/vz/conf/101.conf
</li></ul>
== Storing Extended Information on Container ==
== Expand Migrating Container ==