]> xenbits.xensource.com Git - libvirt.git/commitdiff
* drvlxc.html.in drvlxc.html: some examples from Serge Hallyn
authorDaniel Veillard <veillard@redhat.com>
Wed, 15 Apr 2009 20:00:29 +0000 (20:00 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 15 Apr 2009 20:00:29 +0000 (20:00 +0000)
daniel

ChangeLog
docs/drvlxc.html
docs/drvlxc.html.in

index f715d50a882fbab09acded3f9e1a7020c8c17962..579f109bfb301d356c693da16d85c2111fd10f8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Apr 15 21:59:09 CEST 2009 Daniel Veillard <veillard@redhat.com>
+
+       * drvlxc.html.in drvlxc.html: some examples from Serge Hallyn
+
 Wed Apr 15 11:52:15 CEST 2009 Daniel Veillard <veillard@redhat.com>
 
        * src/xm_internal.c: fix a crash on vcpupin to inactive Xen domains,
index c804b35fbfbbbed72ace0d404a134e88a1f59fbd..e76a1e727402bd86205bda84a012911b9594d3ba 100644 (file)
       </div>
       <div id="content">
         <h1>LXC container driver</h1>
+        <p>
+The libvirt LXC driver manages "Linux Containers".  Containers are sets of processes
+with private namespaces which can (but don't always) look like separate machines, but
+do not have their own OS.  Here are two example configurations.  The first is a very
+light-weight "application container" which does not have it's own root image.  You would
+start it using
+</p>
+        <h3>Example config version 1</h3>
+        <p></p>
+        <pre>
+&lt;domain type='lxc'&gt;
+       &lt;name&gt;vm1&lt;/name&gt;
+       &lt;memory&gt;500000&lt;/memory&gt;
+       &lt;os&gt;
+               &lt;type&gt;exe&lt;/type&gt;
+               &lt;init&gt;/bin/sh&lt;/init&gt;
+       &lt;/os&gt;
+       &lt;vcpu&gt;1&lt;/vcpu&gt;
+       &lt;clock offset='utc'/&gt;
+       &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
+       &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
+       &lt;on_crash&gt;destroy&lt;/on_crash&gt;
+       &lt;devices&gt;
+               &lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
+               &lt;interface type='network'&gt;
+                       &lt;source network='default'/&gt;
+               &lt;/interface&gt;
+               &lt;console type='pty' /&gt;
+       &lt;/devices&gt;
+&lt;/domain&gt;
+</pre>
+        <p>
+The next example assumes there is a private root filesystem
+(perhaps hand-crafted using busybox, or installed from media,
+debootstrap, whatever) under /opt/vm-1-root:
+</p>
+        <p></p>
+        <pre>
+&lt;domain type='lxc'&gt;
+       &lt;name&gt;vm1&lt;/name&gt;
+       &lt;memory&gt;32768&lt;/memory&gt;
+       &lt;os&gt;
+               &lt;type&gt;exe&lt;/type&gt;
+               &lt;init&gt;/init&lt;/init&gt;
+       &lt;/os&gt;
+       &lt;vcpu&gt;1&lt;/vcpu&gt;
+       &lt;clock offset='utc'/&gt;
+       &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
+       &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
+       &lt;on_crash&gt;destroy&lt;/on_crash&gt;
+       &lt;devices&gt;
+               &lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
+               &lt;filesystem type='mount'&gt;
+                       &lt;source dir='/opt/vm-1-root'/&gt;
+                       &lt;target dir='/'/&gt;
+               &lt;/filesystem&gt;
+               &lt;interface type='network'&gt;
+                       &lt;source network='default'/&gt;
+               &lt;/interface&gt;
+               &lt;console type='pty' /&gt;
+       &lt;/devices&gt;
+&lt;/domain&gt;
+</pre>
+        <p>
+In both cases, you can define and start a container using:</p>
+        <pre>
+lxc --connect lxc:/// define v1.xml
+lxc --connect lxc:/// start v1.xml
+</pre>
+        <pre>
+lxc --connect lxc:/// console v1
+</pre>
+        <p>Now doing 'ps -ef' will only show processes in the container, for
+instance.
+</p>
       </div>
     </div>
     <div id="footer">
index d658f1930ff154a1d1384ad995d1731d5417d0ef..a930f2281a1b31e90c2d998dac98c417dfefe52c 100644 (file)
@@ -1,5 +1,84 @@
 <html>
   <body>
     <h1>LXC container driver</h1>
+<p>
+The libvirt LXC driver manages "Linux Containers".  Containers are sets of processes
+with private namespaces which can (but don't always) look like separate machines, but
+do not have their own OS.  Here are two example configurations.  The first is a very
+light-weight "application container" which does not have it's own root image.  You would
+start it using
+</p>
+
+<h3>Example config version 1</h3>
+<p></p>
+<pre>
+&lt;domain type='lxc'&gt;
+       &lt;name&gt;vm1&lt;/name&gt;
+       &lt;memory&gt;500000&lt;/memory&gt;
+       &lt;os&gt;
+               &lt;type&gt;exe&lt;/type&gt;
+               &lt;init&gt;/bin/sh&lt;/init&gt;
+       &lt;/os&gt;
+       &lt;vcpu&gt;1&lt;/vcpu&gt;
+       &lt;clock offset='utc'/&gt;
+       &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
+       &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
+       &lt;on_crash&gt;destroy&lt;/on_crash&gt;
+       &lt;devices&gt;
+               &lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
+               &lt;interface type='network'&gt;
+                       &lt;source network='default'/&gt;
+               &lt;/interface&gt;
+               &lt;console type='pty' /&gt;
+       &lt;/devices&gt;
+&lt;/domain&gt;
+</pre>
+
+<p>
+The next example assumes there is a private root filesystem
+(perhaps hand-crafted using busybox, or installed from media,
+debootstrap, whatever) under /opt/vm-1-root:
+</p>
+<p></p>
+<pre>
+&lt;domain type='lxc'&gt;
+       &lt;name&gt;vm1&lt;/name&gt;
+       &lt;memory&gt;32768&lt;/memory&gt;
+       &lt;os&gt;
+               &lt;type&gt;exe&lt;/type&gt;
+               &lt;init&gt;/init&lt;/init&gt;
+       &lt;/os&gt;
+       &lt;vcpu&gt;1&lt;/vcpu&gt;
+       &lt;clock offset='utc'/&gt;
+       &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
+       &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
+       &lt;on_crash&gt;destroy&lt;/on_crash&gt;
+       &lt;devices&gt;
+               &lt;emulator&gt;/usr/libexec/libvirt_lxc&lt;/emulator&gt;
+               &lt;filesystem type='mount'&gt;
+                       &lt;source dir='/opt/vm-1-root'/&gt;
+                       &lt;target dir='/'/&gt;
+               &lt;/filesystem&gt;
+               &lt;interface type='network'&gt;
+                       &lt;source network='default'/&gt;
+               &lt;/interface&gt;
+               &lt;console type='pty' /&gt;
+       &lt;/devices&gt;
+&lt;/domain&gt;
+</pre>
+
+<p>
+In both cases, you can define and start a container using:</p>
+<pre>
+lxc --connect lxc:/// define v1.xml
+lxc --connect lxc:/// start v1.xml
+</pre>
+and then get a console  using:
+<pre>
+lxc --connect lxc:/// console v1
+</pre>
+<p>Now doing 'ps -ef' will only show processes in the container, for
+instance.
+</p>
   </body>
 </html>