Editing User Guide/Operations on Containers

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 254: Line 254:
 
You can also set a name for Container 101 by editing its configuration file. In this case you should proceed as follows:
 
You can also set a name for Container 101 by editing its configuration file. In this case you should proceed as follows:
  
1. Open the configuration file of Container 101 (<code>/etc/vz/conf/101.conf</code>) for editing and add the following string to the file:
+
<ol>
  '''NAME="computer1"'''
+
<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:
2. 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:
+
  NAME="computer1"
  # '''ln --symbolic /etc/vz/conf/101.conf /etc/vz/names/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:
 
When specifying names for Containers, please keep in mind the following:
Line 266: Line 270:
  
 
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:
 
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>
* You can stop Container 101 with the following command:
+
<li>You can stop Container 101 with the following command:
 
  # '''vzctl stop computer1'''
 
  # '''vzctl stop computer1'''
 
  Stopping container ...
 
  Stopping container ...
 
  Container was stopped
 
  Container was stopped
 
  Container is unmounted
 
  Container is unmounted
 
+
</li>
* You can start Container 101 anew by issuing the following command:
+
<li>You can start Container 101 anew by issuing the following command:
 
  # '''vzctl start computer1'''
 
  # '''vzctl start computer1'''
 
  Starting container ...
 
  Starting container ...
 
  ...
 
  ...
 +
</li></ul>
  
 
You can find out what name is assigned to Container 101 in one of the following ways:
 
You can find out what name is assigned to Container 101 in one of the following ways:
 
+
<ul>
* Using the <code>vzlist</code> utility:
+
<li>Using the <code>vzlist</code> utility:
 
  # '''vzlist -o name 101'''
 
  # '''vzlist -o name 101'''
 
  NAME
 
  NAME
 
  computer1
 
  computer1
 
+
</li>
* Checking the <code>NAME</code> parameter in the Container configuration file (<code>/etc/vz/conf/101.conf</code>). For example:
+
<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'''
 
  # '''grep NAME= /etc/vz/conf/101.conf'''
 
  NAME="computer1"
 
  NAME="computer1"
 
+
</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:
+
<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'''
 
  # '''ls -l /etc/vz/names/ | grep /101.conf'''
 
  lrwxrwxrwx 1 root root 21 Jan 16 20:18 computer1 -> /etc/vz/conf/101.conf
 
  lrwxrwxrwx 1 root root 21 Jan 16 20:18 computer1 -> /etc/vz/conf/101.conf
 +
</li></ul>
  
 
== Storing Extended Information on Container ==
 
== Storing Extended Information on Container ==

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)