Editing Demo scripts
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 1: | Line 1: | ||
The following demo scripts (scenarios) can be used to show advantages of OpenVZ. | The following demo scripts (scenarios) can be used to show advantages of OpenVZ. | ||
− | == Full | + | == Full VE lifecycle == |
− | Create a | + | Create a VE, set an IP, start, add a user, enter, exec, show <code>ps -axf</code> output inside the VE, stop, and destroy. It should take two minutes ("compare that to a time you need to deploy a new (non-virtual) server!"). During the demonstration, describe what's happening and why. |
− | <code>ps -axf</code> output inside the | ||
− | It should take | ||
− | to deploy a new (non-virtual) server!" | ||
− | describe what's happening and why. | ||
Here are the example commands needed: | Here are the example commands needed: | ||
− | # | + | # VE=123 |
# IP=10.1.1.123 | # IP=10.1.1.123 | ||
# sed -i "/$IP /d" ~/.ssh/ | # sed -i "/$IP /d" ~/.ssh/ | ||
− | # time vzctl create $ | + | # time vzctl create $VE --ostemplate fedora-core-5-i386-default |
− | # vzctl set $ | + | # vzctl set $VE --ipadd $IP --hostname newVE --save |
− | # vzctl start $ | + | # vzctl start $VE |
− | # vzctl exec $ | + | # vzctl exec $VE ps axf |
− | # vzctl set $ | + | # vzctl set $VE --userpasswd guest:secret --save |
# ssh guest@$IP | # ssh guest@$IP | ||
− | [ | + | [newVE]# ps axf |
− | [ | + | [newVE]# logout |
− | # vzctl stop $ | + | # vzctl stop $VE |
− | # vzctl destroy $ | + | # vzctl destroy $VE |
− | == Massive | + | == Massive VE creation == |
− | Create/start 50 or 100 | + | Create/start 50 or 100 VEs in a shell loop. Shows fast deployment and high density. |
− | and high density. | ||
Here are the example commands needed: | Here are the example commands needed: | ||
<pre> | <pre> | ||
− | # time for (( | + | # time for ((VE=200; VE<250; VE++)); do \ |
− | > time vzctl create $ | + | > time vzctl create $VE --ostemplate fedora-core-5-i386-default; \ |
− | > vzctl start $ | + | > vzctl start $VE; \ |
> done | > done | ||
</pre> | </pre> | ||
− | == Massive | + | == Massive VE load == |
− | Use | + | Use VEs from previous item — load those by <code>ab</code> or <code>http_load</code>. This demo shows that multiple VEs are working just fine, with low response time etc. |
− | <code>http_load</code>. This demo shows that multiple | ||
− | just fine, with low response time etc. | ||
<pre> | <pre> | ||
− | # for (( | + | # for ((VE=200; VE<250; VE++)); do \ |
− | > vzctl set $ | + | > vzctl set $VE --ipadd 10.1.1.$VE --save; \ |
> done | > done | ||
</pre> | </pre> | ||
− | |||
On another machine: | On another machine: | ||
− | |||
<pre> | <pre> | ||
# rpm -ihv http_load | # rpm -ihv http_load | ||
Line 61: | Line 52: | ||
== Live migration == | == Live migration == | ||
− | If you have two boxes, do <code>vzmigrate --online</code> from one box | + | If you have two boxes, do "<code>vzmigrate --online</code>" from one box to another. You can use, say, <code>xvnc</code> in a VE and <code>vncclient</code> to connect to it, then run <code>xscreensaver-demo</code> and while the picture is moving do a live migration. You'll show <code>xscreensaver</code> stalls for a few seconds but then keeps running — on another machine! That looks amazing, to say at least. |
− | to another. You can use, say, <code>xvnc</code> in a | ||
− | <code>vncclient</code> to connect to it, then run | ||
− | <code>xscreensaver-demo</code> | ||
− | |||
− | migration. You'll | ||
− | seconds but then | ||
− | to say at least. | ||
− | FIXME: commands, setup, | + | FIXME: commands, setup, vnc template. |
== Resource management == | == Resource management == | ||
Line 85: | Line 69: | ||
> done | > done | ||
</pre> | </pre> | ||
− | + | We can see that number of processes inside VE will not be grow up. We will see only increase of <code>numproc</code> or <code>kmemsize</code> fail counters in <code>/proc/user_beancounters</code>. | |
− | We can see that | ||
− | We will see only | ||
− | <code>kmemsize</code> fail counters in <code>/proc/user_beancounters</code>. | ||
==== dentry cache eat up ==== | ==== dentry cache eat up ==== | ||
Line 94: | Line 75: | ||
=== CPU scheduler === | === CPU scheduler === | ||
− | + | Create 3 VEs: | |
− | |||
− | |||
− | Create 3 | ||
<pre> | <pre> | ||
# vzctl create 101 | # vzctl create 101 | ||
Line 104: | Line 82: | ||
</pre> | </pre> | ||
− | Set | + | Set VEs weights: |
<pre> | <pre> | ||
# vzctl set 101 --cpuunits 1000 --save | # vzctl set 101 --cpuunits 1000 --save | ||
Line 111: | Line 89: | ||
</pre> | </pre> | ||
− | We set next | + | We set next cpu sharing <code>VE101 : VE102 : VE103 = 1 : 2 : 3</code> |
− | + | Run VEs: | |
<pre> | <pre> | ||
# vzctl start 101 | # vzctl start 101 | ||
Line 120: | Line 98: | ||
</pre> | </pre> | ||
− | Run busy loops in | + | Run busy loops in VEs: |
<pre> | <pre> | ||
# vzctl enter 101 | # vzctl enter 101 | ||
Line 139: | Line 117: | ||
</pre> | </pre> | ||
− | So, we see that CPU time is given to | + | So, we see that CPU time is given to VEs in proportion ~ 1 : 2 : 3. |
− | |||
− | |||
=== Disk quota === | === Disk quota === | ||
<pre> | <pre> | ||
− | # vzctl set | + | # vzctl set VEID --diskspace 1048576:1153434 --save |
− | # vzctl start | + | # vzctl start VEID |
− | # vzctl enter | + | # vzctl enter VEID |
[ve]# dd if=/dev/zero of=/tmp/tmp.file bs=1048576 count=1000 | [ve]# dd if=/dev/zero of=/tmp/tmp.file bs=1048576 count=1000 | ||
dd: writing `/tmp/tmp.file': Disk quota exceeded | dd: writing `/tmp/tmp.file': Disk quota exceeded |