Editing Demo scripts Virtuozzo
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 13: | Line 13: | ||
Here are the example commands needed: | Here are the example commands needed: | ||
− | # | + | # CT=123 |
− | # IP=10.1.1.123 | + | # IP=10.1.1.123 |
# sed -i "/$IP /d" ~/.ssh/ | # sed -i "/$IP /d" ~/.ssh/ | ||
− | # time | + | # time vzctl create $CT --ostemplate fedora-core-5-i386-default |
− | # | + | # vzctl set $CT --ipadd $IP --hostname newCT --save |
− | # | + | # vzctl start $CT |
− | # | + | # vzctl exec $CT ps axf |
− | # | + | # vzctl set $CT --userpasswd guest:secret --save |
# ssh guest@$IP | # ssh guest@$IP | ||
− | [ | + | [newCT]# ps axf |
− | [ | + | [newCT]# logout |
− | # | + | # vzctl stop $CT |
− | # | + | # vzctl destroy $CT |
− | == | + | == Massive container creation == |
− | Create/start | + | Create/start 50 or 100 containers in a shell loop. Shows fast deployment |
+ | and high density. | ||
Here are the example commands needed: | Here are the example commands needed: | ||
<pre> | <pre> | ||
− | # time for ((CT= | + | # time for ((CT=200; CT<250; CT++)); do \ |
− | + | > time vzctl create $CT --ostemplate fedora-core-9-i386; \ | |
− | + | > vzctl start $CT; \ | |
− | + | > done | |
</pre> | </pre> | ||
Line 48: | Line 49: | ||
<pre> | <pre> | ||
# for ((CT=200; CT<250; CT++)); do \ | # for ((CT=200; CT<250; CT++)); do \ | ||
− | + | > vzctl set $CT --ipadd 10.1.1.$CT --save; \ | |
− | + | > done | |
</pre> | </pre> | ||
Line 61: | Line 62: | ||
== 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 | ||
Line 75: | Line 74: | ||
FIXME: commands, setup, VNC template. | FIXME: commands, setup, VNC template. | ||
− | === CRIU (Checkpoint and Restore In Userspace | + | === CRIU (Checkpoint and Restore In Userspace === |
− | |||
* [https://github.com/tych0/presentations/blob/master/ods2014.md Migration of Doom inside container inside LXC container] | * [https://github.com/tych0/presentations/blob/master/ods2014.md Migration of Doom inside container inside LXC container] | ||
* [http://criu.org/Docker Checkpoint and Restore of Docker container] | * [http://criu.org/Docker Checkpoint and Restore of Docker container] | ||
* [https://github.com/jpetazzo/critmux CRIU + tmux] | * [https://github.com/jpetazzo/critmux CRIU + tmux] | ||
− | + | * [http://criu.org/Simple_loop Simple loop] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* [http://criu.org/Asciinema CRIU screencasts] | * [http://criu.org/Asciinema CRIU screencasts] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Docker inside CT == | == Docker inside CT == | ||
− | |||
− | |||
== Resource management == | == Resource management == | ||
Line 115: | Line 92: | ||
<pre> | <pre> | ||
# while [ true ]; do \ | # while [ true ]; do \ | ||
− | + | > while [ true ]; do \ | |
− | + | > echo " " > /dev/null; | |
− | + | > done & | |
− | + | > done | |
</pre> | </pre> | ||
Line 129: | Line 106: | ||
=== CPU scheduler === | === CPU scheduler === | ||
+ | |||
+ | {{Warning|CPU weights only works in stable kernels.}} | ||
Create 3 containers: | Create 3 containers: | ||
<pre> | <pre> | ||
− | # | + | # vzctl create 101 |
− | # | + | # vzctl create 102 |
− | # | + | # vzctl create 103 |
</pre> | </pre> | ||
Set container weights: | Set container weights: | ||
<pre> | <pre> | ||
− | # | + | # vzctl set 101 --cpuunits 1000 --save |
− | # | + | # vzctl set 102 --cpuunits 2000 --save |
− | # | + | # vzctl set 103 --cpuunits 3000 --save |
</pre> | </pre> | ||
Line 148: | Line 127: | ||
Start containers: | Start containers: | ||
<pre> | <pre> | ||
− | # | + | # vzctl start 101 |
− | # | + | # vzctl start 102 |
− | # | + | # vzctl start 103 |
</pre> | </pre> | ||
Run busy loops in all containers: | Run busy loops in all containers: | ||
<pre> | <pre> | ||
− | # | + | # vzctl enter 101 |
[ve101]# while [ true ]; do true; done | [ve101]# while [ true ]; do true; done | ||
− | # | + | # vzctl enter 102 |
[ve102]# while [ true ]; do true; done | [ve102]# while [ true ]; do true; done | ||
− | # | + | # vzctl enter 103 |
[ve103]# while [ true ]; do true; done | [ve103]# while [ true ]; do true; done | ||
</pre> | </pre> | ||
Line 178: | Line 157: | ||
=== Disk quota === | === Disk quota === | ||
<pre> | <pre> | ||
− | # | + | # vzctl set CTID --diskspace 1048576:1153434 --save |
− | # | + | # vzctl start CTID |
− | # | + | # vzctl enter CTID |
[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 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Events]] | [[Category:Events]] |