Source

kschiess.bitbucket.org / qemu-toolkit / README.1.html

Full commit
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv='content-type' value='text/html;charset=utf8'>
  <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
  <title>qemu-toolkit(1) - A toolkit for running qemu on Illumos / OmniOS</title>
  <style type='text/css' media='all'>
  /* style: man */
  body#manpage {margin:0}
  .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
  .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
  .mp h2 {margin:10px 0 0 0}
  .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
  .mp h3 {margin:0 0 0 4ex}
  .mp dt {margin:0;clear:left}
  .mp dt.flush {float:left;width:8ex}
  .mp dd {margin:0 0 0 9ex}
  .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
  .mp pre {margin-bottom:20px}
  .mp pre+h2,.mp pre+h3 {margin-top:22px}
  .mp h2+pre,.mp h3+pre {margin-top:5px}
  .mp img {display:block;margin:auto}
  .mp h1.man-title {display:none}
  .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
  .mp h2 {font-size:16px;line-height:1.25}
  .mp h1 {font-size:20px;line-height:2}
  .mp {text-align:justify;background:#fff}
  .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
  .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
  .mp u {text-decoration:underline}
  .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
  .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
  .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
  .mp b.man-ref {font-weight:normal;color:#434241}
  .mp pre {padding:0 4ex}
  .mp pre code {font-weight:normal;color:#434241}
  .mp h2+pre,h3+pre {padding-left:0}
  ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
  ol.man-decor {width:100%}
  ol.man-decor li.tl {text-align:left}
  ol.man-decor li.tc {text-align:center;letter-spacing:4px}
  ol.man-decor li.tr {text-align:right;float:right}
  </style>
  <style type='text/css' media='all'>
  /* style: toc */
  .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
  .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
  .man-navigation a:hover {color:#111;text-decoration:underline}
  </style>
</head>
<!--
  The following styles are deprecated and will be removed at some point:
  div#man, div#man ol.man, div#man ol.head, div#man ol.man.

  The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
  .man-navigation should be used instead.
-->
<body id='manpage'>
  <div class='mp' id='man'>

  <div class='man-navigation' style='display:none'>
    <a href="#NAME">NAME</a>
    <a href="#SYNOPSIS">SYNOPSIS</a>
    <a href="#OVERVIEW">OVERVIEW</a>
    <a href="#DEPLOYMENT-OPTIONS">DEPLOYMENT OPTIONS</a>
    <a href="#PREREQUISITES">PREREQUISITES</a>
    <a href="#SEE-ALSO">SEE ALSO</a>
    <a href="#AUTHORS">AUTHORS</a>
  </div>

  <ol class='man-decor man-head man head'>
    <li class='tl'>qemu-toolkit(1)</li>
    <li class='tc'>qemu-toolkit</li>
    <li class='tr'>qemu-toolkit(1)</li>
  </ol>

  <h2 id="NAME">NAME</h2>
<p class="man-name">
  <code>qemu-toolkit</code> - <span class="man-whatis">A toolkit for running qemu on Illumos / OmniOS</span>
</p>

<h2 id="SYNOPSIS">SYNOPSIS</h2>

<p>qemu-toolkit is a small set of scripts to control QEMU kvm virtualised
machines on a set of illumos hosts. Have a look at 'storadm' and
'vmadm' - inline help will show you the possibilities.</p>

<h2 id="OVERVIEW">OVERVIEW</h2>

<p>This is the toolkit for running qemu on OmniOS/Illumos. Features:</p>

<ul>
<li>Run VMs based on local zvols</li>
<li>Run VMs based on iSCSI targets</li>
<li>Fully use QEMUs options (through a nifty Ruby DSL)</li>
<li>Automatic network configuration based on vnics</li>
<li>Using vnics confined to VLANs</li>
<li>Secure VNC channel through unix socket</li>
<li>Access to VM monitor and serial console</li>
</ul>


<p>Here's a sample configuration file:</p>

<pre><code>virtual_machine "vm_name" do
  # Network configuration: vnic via igb1
  nic 'eth0', macaddr: '2:8:20:52:a6:7e', via: 'igb1'

  # Disks: via iSCSI iqn
  iscsi_target 'iqn.2010-01.com.qemu-toolkit:vm_name', "10.0.30.1"

  # 4 SMP CPUs.
  cpus 4
end
</code></pre>

<p>On-disk layout is as follows:</p>

<pre><code>foo                 base zfs dataset
foo/disk1           first disk, zvol block device
foo/disk2           second disk, zvol block device
</code></pre>

<h2 id="DEPLOYMENT-OPTIONS">DEPLOYMENT OPTIONS</h2>

<p>Using this toolkit, you can deploy your virtual machines in one of two ways:</p>

<ul>
<li>All-local, using zvols</li>
<li>SAN-style, using iSCSI based block devices mapping to zvols</li>
</ul>


<h3 id="Local-ZVOLs">Local ZVOLs</h3>

<p>In this architectural style, you use both tools (<a class="man-ref" href="storadm.1.html">storadm<span class="s">(1)</span></a> and <a class="man-ref" href="vmadm.1.html">vmadm<span class="s">(1)</span></a>) on
the same machine. To create a virtual machine from scratch, you would use the
following sequence of commands:</p>

<pre><code>$ storadm create pool1/foo 10G
$ vmadm create foo
$ vmadm start foo --bootiso=installation-disk.iso
</code></pre>

<p>This would create a base dataset pool1/foo with one 10G block device as root
disk. It then creates a file <code>foo.rb</code> below <code>/etc/qemu-toolkit/</code> that defines
base attributes for the virtual machine. Finally, starting the machine using
the <code>--bootiso</code> parameter would allow you to install a base system to the virtual
machine.</p>

<h3 id="SAN-style">SAN-style</h3>

<p>Here you use two machines, one as storage host and one as VM host. The virtual
machines run on host A, but all storage is provided for by host B. Here's a
typical sequence of commands to create a virtual machine from scratch in this
scenario:</p>

<pre><code>B $ storadm create pool1/foo 10G
B $ storadm export pool1/foo

A $ vmadm create foo
# Edit foo.rb at this point to include a valid iqn + IP pair for host B
A $ vmadm start foo --bootiso=installation-disk.iso
</code></pre>

<p>This assumes that you've got iSCSI set up on both machines. (initiator on A,
target on B) While this configuration is certainly more complex than the
all-local one above, it is also more flexible to administer.</p>

<h2 id="PREREQUISITES">PREREQUISITES</h2>

<p>For this to run, you need at least one physical host running
<a href="http://omnios.omniti.com/">OmniOS</a> or another
<a href="https://en.wikipedia.org/wiki/Illumos">Illumos</a>-based distro. The host needs
to support VT/x extensions to be able to run KVM-based virtualisation. Also,
some basic working knowledge of Illumos is of help.</p>

<h2 id="SEE-ALSO">SEE ALSO</h2>

<p><a class="man-ref" href="qemu-toolkit-overview.7.html">qemu-toolkit-overview<span class="s">(7)</span></a>, <a class="man-ref" href="storadm.1.html">storadm<span class="s">(1)</span></a>, <a class="man-ref" href="vmadm.1.html">vmadm<span class="s">(1)</span></a></p>

<h2 id="AUTHORS">AUTHORS</h2>

<p>Copyright (c) 2012 Kaspar Schiess. Distribution under a MIT license:</p>

<p>Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:</p>

<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>

<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.</p>


  <ol class='man-decor man-foot man foot'>
    <li class='tl'>Kaspar Schiess, Technology Astronauts GmbH</li>
    <li class='tc'>November 2012</li>
    <li class='tr'>qemu-toolkit(1)</li>
  </ol>

  </div>
</body>
</html>