Difference between revisions of "Basic operations in OpenVZ environment"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
m (Reverted edits by 189.228.219.116 (Talk) to last revision by Kir)
Line 1: Line 1:
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">This article assumes you have already [[Quick installation|installed OpenVZ]].</span> En este artículo se supone que ya ha [[Instalación rápida | instalar OpenVZ.]]</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">If not, follow the link to perform the steps needed.</span> Si no es así, siga el enlace para llevar a cabo los pasos necesarios.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">== Create and start a container == To create and start a [[container]], run the following commands: <pre> [host-node]# vzctl create CTID --ostemplate osname [host-node]# vzctl set CTID --ipadd abcd --save [host-node]# vzctl set CTID --nameserver abcd --save [host-node]# vzctl start CTID </pre> Here <tt>CTID</tt> is the numeric ID for the [[container]]; <tt>osname</tt> is the name of the OS template for the [[container]], and <tt>abcd</tt> is the IP address to be assigned to the [[container]].</span> == Crear y activar un contenedor == Para crear e iniciar un [[contenedor]], ejecute los siguientes comandos: Si su canción [host-nodo] # vzctl crear CTID - ostemplate osname [host-nodo] # vzctl set CTID - ipadd abcd - guardar [host-nodo] # vzctl Chw to do this wow it is amaizing jaja lol duhhh jejeje
+
This article assumes you have already [[Quick installation|installed OpenVZ]]. If not, follow the link to perform the steps needed.
kdkdolkfkkdkdkdkjfjfkjfjjfyou guys dont knoe whta the fuck i want uuuhgghgh idiots}
+
 
TID conjunto - abcd servidor de nombres - guardar [host-nodo] # vzctl start CTID </ pre> Aquí <tt> CTID </ tt> es el identificador numérico para el [[contenedor]]; <tt> osname </ tt> es el nombre de la plantilla de SO de la [[contenedor]], y <tt> abcd </ tt> es la dirección IP que se asignará a la [[ contenedor.]]</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">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> Your freshly-created [[container]] should be up and running now; you can see its processes: <pre> [host-node]# vzctl exec CTID ps ax </pre> == Enter to and exit from the container == To enter [[container]] give the following command: <pre> [host-node]# vzctl enter CTID entered into container CTID [container]# </pre> To exit from [[container]], just type <code>exit</code> and press Enter: <pre> [container]# exit exited from container VEID [host-node]# </pre> == Stop and destroy the container == To stop [[container]]: <pre> [host-node]# vzctl stop CTID Stopping container ...</span> Ejemplo: Si su canción [host-nodo] # vzctl crear 101 - ostemplate fedora-core-5-mínima [host-nodo] # vzctl set 101 - ipadd 10.1.2.3 - guardar [host-nodo] # vzctl set 101 - nameserver 10.0.2.1 - guardar [host-nodo] # vzctl start 101 </ pre> El recién creado [[contenedor]] debe estar en funcionamiento ahora, usted puede ver sus procesos: Si su canción [host -node] # vzctl ejecutivo CTID ps ax </ pre> == Ingrese y salida de los contenedores == Para entrar en [[contenedor]] dar el siguiente comando: <pre> [host-nodo] # vzctl entrar CTID entró en contenedor CTID [contenedor] # </ pre> Para salir de la [[contenedor]], escribe <code> salida </ code> y pulse Intro: Si su canción [contenedor] # exit sale del recipiente VEID [host-nodo] # </ pre> == Detener y destruir el contenedor == Para detener la [[contenedor]]: Si su canción [host-nodo] # vzctl detener CTID contenedor detener ...</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Container was stopped Container is unmounted </pre> And to destroy [[container]]: <pre> [host-node]# vzctl destroy CTID Destroying container private area: /vz/private/CTID Container private area was destroyed </pre> Now, when you know how to manage your [[container]], learn about [[Resource management]].</span> Contenedor fue detenido contenedores se desmonta </ ​​pre> y destruir [[contenedor]]: Si su canción [host-nodo] # vzctl destruir CTID destrucción de la zona de contenedores privados: / vz / private / CTID área privada de contenedores fue destruido </ pre > Ahora, cuando usted sabe cómo manejar su [[contenedor]], aprender acerca de [[Gestión de recursos]].</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">[[Category: Installation]] [[Category: HOWTO]]</span> [[Categoría: Instalación]] [[Categoría: HOWTO]]</span>
+
== Create and start a container ==
 +
 
 +
To create and start a [[container]], run the following commands:
 +
<pre>
 +
[host-node]# vzctl create CTID --ostemplate osname
 +
[host-node]# vzctl set CTID --ipadd a.b.c.d --save
 +
[host-node]# vzctl set CTID --nameserver a.b.c.d --save
 +
[host-node]# vzctl start CTID
 +
</pre>
 +
 
 +
Here <tt>CTID</tt> is the numeric ID for the [[container]]; <tt>osname</tt> is the name of the OS template for the [[container]], and <tt>a.b.c.d</tt> is the IP address to be assigned to the [[container]].
 +
 
 +
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>
 +
 
 +
Your freshly-created [[container]] should be up and running now; you can see its processes:
 +
 
 +
<pre>
 +
[host-node]# vzctl exec CTID ps ax
 +
</pre>
 +
 
 +
== Enter to and exit from the container ==
 +
 
 +
To enter [[container]] give the following command:
 +
<pre>
 +
[host-node]# vzctl enter CTID
 +
entered into container CTID
 +
[container]#
 +
</pre>
 +
 
 +
To exit from [[container]], just type <code>exit</code> and press Enter:
 +
<pre>
 +
[container]# exit
 +
exited from container VEID
 +
[host-node]#
 +
</pre>
 +
 
 +
== Stop and destroy the container ==
 +
 
 +
To stop [[container]]:
 +
 
 +
<pre>
 +
[host-node]# vzctl stop CTID
 +
Stopping container ...
 +
Container was stopped
 +
Container is unmounted
 +
</pre>
 +
 
 +
And to destroy [[container]]:
 +
<pre>
 +
[host-node]# vzctl destroy CTID
 +
Destroying container private area: /vz/private/CTID
 +
Container private area was destroyed
 +
</pre>
 +
 
 +
Now, when you know how to manage your [[container]], learn about [[Resource management]].
 +
 
 +
[[Category: Installation]]
 +
[[Category: HOWTO]]

Revision as of 16:48, 5 July 2011

This article assumes you have already installed OpenVZ. If not, follow the link to perform the steps needed.

Create and start a container

To create and start a container, run the following commands:

[host-node]# vzctl create CTID --ostemplate osname
[host-node]# vzctl set CTID --ipadd a.b.c.d --save
[host-node]# vzctl set CTID --nameserver a.b.c.d --save
[host-node]# vzctl start CTID

Here CTID is the numeric ID for the container; osname is the name of the OS template for the container, and a.b.c.d is the IP address to be assigned to the container.

Example:

[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

Your freshly-created container should be up and running now; you can see its processes:

[host-node]# vzctl exec CTID ps ax

Enter to and exit from the container

To enter container give the following command:

[host-node]# vzctl enter CTID
entered into container CTID
[container]#

To exit from container, just type exit and press Enter:

[container]# exit
exited from container VEID
[host-node]#

Stop and destroy the container

To stop container:

[host-node]# vzctl stop CTID
Stopping container ...
Container was stopped
Container is unmounted

And to destroy container:

[host-node]# vzctl destroy CTID
Destroying container private area: /vz/private/CTID
Container private area was destroyed

Now, when you know how to manage your container, learn about Resource management.