172
edits
Changes
remove knoppix mentioning: we have now one more LiveCD based on Centos 4.4
terminal (you must be root):
<pre>
Creating VE private area (debian-3.1-i386-minimal)
Performing postcreate actions
'''vzctl''' is the tool that manages VEs. Look in <tt>/var/lib/vz/template/cache/</tt> directory for other OS templates available on LiveCD:
<pre>
centos-4-i386-minimal.tar.gz
debian-3.1-i386-minimal.tar.gz
You can get the list of all created VEs on '''HN''' (Hardware Node) using '''vzlist''' command:
<pre>
VEID NPROC STATUS IP_ADDR HOSTNAME
101 - stopped - -
Let's start it:
<pre>
Starting VE ...
VE is mounted
Setting CPU units: 1000
VE start in progress...
VEID NPROC STATUS IP_ADDR HOSTNAME
101 5 running -
In order to perform any command inside VE `vzctl exec` is used:
<pre>
PID TTY TIME CMD
1 ? 00:00:00 init
Any self-respected OS provides a shell for the user. This is how you can get the VE's shell:
<pre>
entered into VE 101
</pre>
In this shell you can do almost all you can do on the real HN. For example create a new user:
<pre>
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
/home/new-user
exit
</pre>
In order to exit from VEs shell, just type exit:
<pre>
logout
exited from VE 101
</pre>
<pre>
Adding IP address(es): 10.1.1.1
Saved parameters for VE 1
VEID NPROC STATUS IP_ADDR HOSTNAME
101 4 running 10.1.1.1 -
Now your [[Hardware Node]] can ping VE and VE can ping HN:
<pre>
PING 10.1.1.1 (10.1.1.1) 56(84) bytes of data.
64 bytes from 10.1.1.1: icmp_seq=1 ttl=64 time=3.80 ms
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 3.804/3.804/3.804/0.000 ms
PING 192.168.0.244 (192.168.0.244) 56(84) bytes of data.
64 bytes from 192.168.0.244: icmp_seq=1 ttl=64 time=0.508 ms
</pre>
of your node is 192.168.0.244 and nameserver IP address is 192.168.1.1.
<pre>
File resolv.conf was modified
Saved parameters for VE 101
PING google.com (64.233.167.99) 56(84) bytes of data.
64 bytes from py-in-f99.google.com (64.233.167.99): icmp_seq=1 ttl=241 time=23.0 ms
== Installing software inside VE ==
I guess you've noted that there is not so many packages in VE. It is because minimal template was used.
But of course, you can install any software in VE by yourself. For example, in Debian usual <tt>apt-get </tt> tool can be used.
Now, for example, we can install gcc inside VE 101 for developing purposes:
<pre>
entered into VE 101
Reading Package Lists... Done
Building Dependency Tree... Done
Setting up gcc (3.3.5-3) ...
logout
exited from VE 101
</pre>
<code>/proc/bc/VEID/resources</code> file:
<pre>
kmemsize 628209 976969 2752512 2936012 0
lockedpages 0 0 32 32 0
numfile 106 339 2048 2048 0
numiptent 10 10 128 128 0
</pre>
First column is resource name, second is current usage, third is peak usage, forth and fifth are barrier and limit, and last column is fail counter.
Well, let's stop VE and destroy it:
<pre>
Stopping VE ...
VE was stopped
VE is unmounted
Destroying VE private area: /var/lib/vz/private/101
VE private area was destroyed
</pre>