Editing Demo scripts Virtuozzo

Jump to: navigation, search

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:
  
  # NAME=vz
+
  # CT=123
  # IP=10.1.1.123/24
+
  # IP=10.1.1.123
 
  # sed -i "/$IP /d" ~/.ssh/
 
  # sed -i "/$IP /d" ~/.ssh/
  # time prlctl create $NAME --ostemplate centos-6-x86_64 --vmtype=ct
+
  # time vzctl create $CT --ostemplate fedora-core-5-i386-default
  # prlctl set $NAME --ipadd $IP --hostname $NAME
+
  # vzctl set $CT --ipadd $IP --hostname newCT --save
  # prlctl start $NAME
+
  # vzctl start $CT
  # prlctl exec $NAME ps axf
+
  # vzctl exec $CT ps axf
  # prlctl set $NAME --userpasswd guest:secret
+
  # vzctl set $CT --userpasswd guest:secret --save
 
  # ssh guest@$IP
 
  # ssh guest@$IP
  [vz]# ps axf
+
  [newCT]# ps axf
  [vz]# logout
+
  [newCT]# logout
  # prlctl stop $NAME
+
  # vzctl stop $CT
  # prlctl destroy $NAME
+
  # vzctl destroy $CT
  
== Multiple containers creation ==
+
== Massive container creation ==
  
Create/start 10 containers in a shell loop.
+
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=100; CT<110; CT++)); do \
+
# time for ((CT=200; CT<250; CT++)); do \
  time prlctl create $CT --ostemplate centos-6-x86_64 --vmtype=ct; \
+
time vzctl create $CT --ostemplate fedora-core-9-i386; \
  prlctl start $CT; \
+
>  vzctl start $CT; \
  done
+
> done
 
</pre>
 
</pre>
  
Line 48: Line 49:
 
<pre>
 
<pre>
 
# for ((CT=200; CT<250; CT++)); do \
 
# for ((CT=200; CT<250; CT++)); do \
  prlctl set $CT --ipadd 10.1.1.$CT/24; \
+
>  vzctl set $CT --ipadd 10.1.1.$CT --save; \
  done
+
> done
 
</pre>
 
</pre>
  
Line 61: Line 62:
  
 
== Live migration ==
 
== Live migration ==
 
=== xscreensaver inside container ===
 
  
 
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 ===
  
* [http://criu.org/Simple_loop Simple loop]
 
 
* [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]
This is a tech demo of [http://criu.org/ CRIU] and Docker integration, featuring [https://tmux.github.io/ tmux].
 
 
 
<pre>
 
docker run -t -i --privileged --name critmux jpetazzo/critmux
 
Do stuff in tmux. Don't know what to do? Just type a few characters.
 
From another terminal, docker stop critmux. Container stops.
 
docker start critmux ; docker attach critmux. MIND. BLOWN.
 
Note: docker start -a doesn't quite work.
 
</pre>
 
 
 
See [https://asciinema.org/a/9889 screencast] recorded with Asciinema.
 
 
 
 
* [http://criu.org/Asciinema CRIU screencasts]
 
* [http://criu.org/Asciinema CRIU screencasts]
* [http://blog.kubernetes.io/2015/07/how-did-quake-demo-from-dockercon-work.html How did the Quake demo from DockerCon Work?]
 
* [https://github.com/ianmiell/shutit-criu Live migration of Docker container inside Vagrant box]
 
 
=== P.Haul ===
 
 
* [https://github.com/xemul/p.haul/blob/master/test/mtouch/HOWTO P.Haul HOWTO]
 
* [https://github.com/xemul/p.haul/wiki/Live-migrating-OVZ-mainstream-container Live migrating OVZ mainstream container]
 
 
== Docker inside CT ==
 
 
[[Docker_inside_CT]]
 
  
 
== Resource management ==
 
== Resource management ==
Line 115: Line 90:
 
<pre>
 
<pre>
 
# while [ true ]; do \
 
# while [ true ]; do \
    while [ true ]; do \
+
>    while [ true ]; do \
        echo " " > /dev/null;
+
>        echo " " > /dev/null;
    done &
+
>    done &
done
+
> done
 
</pre>
 
</pre>
  
Line 129: Line 104:
  
 
=== CPU scheduler ===
 
=== CPU scheduler ===
 +
 +
{{Warning|CPU weights only works in stable kernels.}}
  
 
Create 3 containers:
 
Create 3 containers:
 
<pre>
 
<pre>
# prlctl create 101
+
# vzctl create 101
# prlctl create 102
+
# vzctl create 102
# prlctl create 103
+
# vzctl create 103
 
</pre>
 
</pre>
  
 
Set container weights:
 
Set container weights:
 
<pre>
 
<pre>
# prlctl set 101 --cpuunits 1000
+
# vzctl set 101 --cpuunits 1000 --save
# prlctl set 102 --cpuunits 2000
+
# vzctl set 102 --cpuunits 2000 --save
# prlctl set 103 --cpuunits 3000
+
# vzctl set 103 --cpuunits 3000 --save
 
</pre>
 
</pre>
  
Line 148: Line 125:
 
Start containers:
 
Start containers:
 
<pre>
 
<pre>
# prlctl start 101
+
# vzctl start 101
# prlctl start 102
+
# vzctl start 102
# prlctl start 103
+
# vzctl start 103
 
</pre>
 
</pre>
  
 
Run busy loops in all containers:
 
Run busy loops in all containers:
 
<pre>
 
<pre>
# prlctl enter 101
+
# vzctl enter 101
 
[ve101]# while [ true ]; do true; done
 
[ve101]# while [ true ]; do true; done
# prlctl enter 102
+
# vzctl enter 102
 
[ve102]# while [ true ]; do true; done
 
[ve102]# while [ true ]; do true; done
# prlctl enter 103
+
# vzctl enter 103
 
[ve103]# while [ true ]; do true; done
 
[ve103]# while [ true ]; do true; done
 
</pre>
 
</pre>
Line 178: Line 155:
 
=== Disk quota ===
 
=== Disk quota ===
 
<pre>
 
<pre>
# prlctl set CTID --diskspace 1048576:1153434 --save
+
# vzctl set CTID --diskspace 1048576:1153434 --save
# prlctl start CTID
+
# vzctl start CTID
# prlctl enter 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>
  
 
== See also ==
 
 
* [http://criu.org/Asciinema CRIU screencasts]
 
* [https://www.youtube.com/c/OpenVZorg OpenVZ demo on Youtube]
 
* [[Screencasts|Virtuozzo screencasts]]
 
* [https://github.com/ligurio/jslinux-criu CRIU inside jslinux]
 
  
 
[[Category:Events‏‎]]
 
[[Category:Events‏‎]]

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: