Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Basic operations in OpenVZ environment

643 bytes added, 01:29, 30 December 2015
Add languages selection
<languages /><translate><!--T:1-->This article assumes you have already [[Quick installation|installed OpenVZ]] and prepared the OS template cache(s). If not, follow the links link to perform the steps needed.
== Create and start a container == <!--T:2--> <!--T:3-->To create and start a [[VEcontainer]], run the following commands:
<pre>
[host-node]# vzctl create VEID CTID --ostemplate osname[host-node]# vzctl set VEID CTID --ipadd a.b.c.d --save[host-node]# vzctl set CTID --nameserver a.b.c.d --save[host-node]# vzctl start VEIDCTID
</pre>
<!--T:4-->Here <tt>VEIDCTID</tt> is the numeric ID for the VE[[container]]; <tt>osname</tt> is the name of the OS template for the VE[[container]], and <tt>a.b.c.d</tt> is the IP address to be assigned to the VE[[container]].
<!--T:5-->
Example:
<pre>
[host-node]# vzctl create 101 --ostemplate fedora-core-5-minimal
[host-node]# vzctl set 101 --ipadd 10.1.2.3 --save
[host-node]# vzctl set 101 --nameserver 10.0.2.1 --save
[host-node]# vzctl start 101
</pre>
<!--T:6-->Your freshly-created VE [[container]] should be up and running now; you can see its processes:
<!--T:7-->
<pre>
[host-node]# vzctl exec VEID CTID ps ax
</pre>
== Enter to and exit from the container == <!--T:8--> <!--T:9-->To enter VE [[container]] give the following command:
<pre>
[host-node]# vzctl enter VEIDCTIDentered into VPS VEIDcontainer CTID[vecontainer]#
</pre>
<!--T:10-->To exit from VE[[container]], just type <code>exit</code> and press enterEnter:
<pre>
[vecontainer]# exitexited from VPS 886container VEID
[host-node]#
</pre>
To stop VE== Stop and destroy the container == <!--T:11-->
<!--T:12-->
To stop [[container]]:
 
<!--T:13-->
<pre>
[host-node]# vzctl stop VEIDCTIDStopping VPS container ...VPS Container was stoppedVPS Container is unmounted
</pre>
<!--T:14-->And to destroy VE[[container]]:
<pre>
[host-node]# vzctl destroy VEIDCTIDDestroying VPS container private area: /vz/private/VEIDCTIDVPS Container private area was destroyed
</pre>
 
<!--T:15-->
Now, when you know how to manage your [[container]], learn about [[Resource management]].
</translate>
[[Category: Installation]]
[[Category: HOWTO]]
698
edits