Difference between revisions of "Basic operations in OpenVZ environment"
m (VE creation moved to Basic operations in OpenVZ environment: create/start/stop/enter/destroy actions in one article) |
(Added basic operations) |
||
Line 23: | Line 23: | ||
</pre> | </pre> | ||
− | + | To enter VE give the following command: | |
+ | <pre> | ||
+ | [host-node]# vzctl enter VEID | ||
+ | entered into VPS VEID | ||
+ | [ve]# | ||
+ | </pre> | ||
+ | |||
+ | To exit from VE, just type <code>exit</code> and press enter: | ||
+ | <pre> | ||
+ | [ve]# exit | ||
+ | exited from VPS 886 | ||
+ | |||
+ | [host-node]# | ||
+ | </pre> | ||
+ | |||
+ | To stop VE: | ||
+ | |||
+ | <pre> | ||
+ | [host-node]# vzctl stop VEID | ||
+ | Stopping VPS ... | ||
+ | VPS was stopped | ||
+ | VPS is unmounted | ||
+ | </pre> | ||
+ | |||
+ | And to destroy VE: | ||
+ | <pre> | ||
+ | [host-node]# vzctl destroy VEID | ||
+ | Destroying VPS private area: /vz/private/VEID | ||
+ | VPS private area was destroyed | ||
+ | </pre> | ||
[[Category: Installation]] | [[Category: Installation]] | ||
[[Category: HOWTO]] | [[Category: HOWTO]] |
Revision as of 10:05, 7 September 2006
This article assumes you have already installed OpenVZ and prepared the OS template cache(s). If not, follow the links to perform the steps needed.
To create and start a VE, run the following commands:
[host-node]# vzctl create VEID --ostemplate osname [host-node]# vzctl set VEID --ipadd a.b.c.d --save [host-node]# vzctl start VEID
Here VEID is the numeric ID for the VE; osname is the name of the OS template for the VE, and a.b.c.d is the IP address to be assigned to the VE.
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 start 101
Your freshly-created VE should be up and running now; you can see its processes:
[host-node]# vzctl exec VEID ps ax
To enter VE give the following command:
[host-node]# vzctl enter VEID entered into VPS VEID [ve]#
To exit from VE, just type exit
and press enter:
[ve]# exit exited from VPS 886 [host-node]#
To stop VE:
[host-node]# vzctl stop VEID Stopping VPS ... VPS was stopped VPS is unmounted
And to destroy VE:
[host-node]# vzctl destroy VEID Destroying VPS private area: /vz/private/VEID VPS private area was destroyed