[haizea-commit] r442 - trunk/html

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Mon Jul 21 13:48:06 CDT 2008


Author: borja
Date: 2008-07-21 13:48:06 -0500 (Mon, 21 Jul 2008)
New Revision: 442

Added:
   trunk/html/doc_opennebula.html
Log:
Added OpenNebula+Haizea integration guide

Added: trunk/html/doc_opennebula.html
===================================================================
--- trunk/html/doc_opennebula.html	                        (rev 0)
+++ trunk/html/doc_opennebula.html	2008-07-21 18:48:06 UTC (rev 442)
@@ -0,0 +1,336 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+
+<title>Haizea - An Open Source VM-based Lease Manager</title>
+<link href="haizea.css" type="text/css" rel="stylesheet"/>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+</head>
+<body>
+
+<div id="content">
+<div id="logo">
+<a href="index.html"><img src="logo.png" width="450" height="86" border="0" alt="Haizea"/></a>
+</div>
+<div class="topbar">
+<a href="whatis.html">What is Haizea?</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="features.html">Features</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="download.html">Download</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="documentation.html" style="color:black">Documentation</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="support.html">Support</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="pubs.html">Publications</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+<a href="credits.html">Credits</a></div>
+<h1>Using OpenNebula and Haizea<br/>to manage VMs on a cluster</h1>
+
+<p><a href="http://www.opennebula.org/">OpenNebula</a> is a virtual infrastructure manager that enables the dynamic deployment and re-allocation of virtual machines on a pool of physical resources. Haizea can be used to extend OpenNebula's scheduling capabilities, allowing it to support advance reservation of resources and queueing of best effort requests (more generally, it allows you to <a href="features_leases.html">lease</a> your resources as VMs, with a variety of lease terms). OpenNebula and Haizea complement each other, since OpenNebula provides all the enactment muscle (OpenNebula can manage Xen and KVM VMs on a cluster, with VMWare support to follow shortly) and Haizea provides the scheduling brains. Using them together is very simple since Haizea can be installed as a drop-in replacement for OpenNebula's scheduling daemon (i.e., you can use the latest version of OpenNebula, without any modifications).</p>
+
+<p>This document explains how to use OpenNebula and Haizea together, and explains how to submit requests to OpenNebula to use Haizea's scheduling capabilities.</p>
+
+<p>NOTE: Although Haizea supports scheduling multiple VMs in parallel (e.g., 16 VMs which must run at the same time, or not at all), the current 1.0 version of OpenNebula only allows VMs to be managed one at a time (OpenNebula 1.2 will include support for "VM groups"). As such, this document only explains how to schedule individual VMs. There is a "dirty hack" way of scheduling groups of VMs with Haizea and OpenNebula 1.0, but we're not including it here since OpenNebula 1.2 will make this issue moot. However, if you really really really need to schedule VMs as groups and can't wait for OpenNebula 1.2, please don't hesitate to <a href="support.html">contact us</a>.</p>
+
+<h2>Installing OpenNebula and Haizea</h2>
+
+<p>If you have not already done so, you will need to install OpenNebula and Haizea. Start by <a href="http://www.opennebula.org/doku.php?id=documentation">installing OpenNebula</a>, and then <a href="doc_install.html">installing Haizea</a>.</p>
+
+<p>Before proceeding, you may want to follow the OpenNebula <a href="http://www.opennebula.org/doku.php?id=documentation">quickstart guide</a> to verify that your OpenNebula installation is working fine. The rest of this document assumes that OpenNebula is correctly installed, and that you know what a <em>virtual machine template</em> is ("VM templates" is how VMs are requested to OpenNebula, so we'll be working with them quite a bit). You may also want to follow the Haizea <a href="doc_quickstart">Quickstart Guide</a>, to verify that Haizea is correctly installed.</p>
+
+<h2>Configuring Haizea</h2>
+
+<p>Haizea must be configured to run in OpenNebula mode. Haizea includes a sample OpenNebula configuration file that you can use as a starting point. This file is installed, by default, in <tt>/usr/share/haizea/etc/sample_opennebula.conf</tt>.</p>
+
+<p>In OpenNebula mode, Haizea will process requests coming from OpenNebula, and will send all enactment commands to OpenNebula. To activate this mode, the <tt>mode</tt> option of the <tt>general</tt> section in the Haizea configuration file must be set to <tt>opennebula</tt>:</p>
+
+<pre class="shell">
+[general]
+...
+<strong>mode: opennebula</strong>
+...
+</pre>
+
+<p>Next, you need to tell Haizea where the OpenNebula database and <tt>onevm</tt> command are located. This is done in the <tt>opennebula</tt> section:</p>
+
+<pre class="shell">
+[opennebula]
+# The following assumes that $ONE_LOCATION is /opt/nebula/ONE
+# If you used a different $ONE_LOCATION, modify the paths 
+# accordingly
+db: /opt/nebula/ONE/var/one.db
+onevm: /opt/nebula/ONE/bin/onevm
+</pre>
+
+<p>There are some additional options described at the end of this document, but which you do not need to concern yourself with yet.</p>
+
+<h2>Running OpenNebula and Haizea together</h2>
+
+<p>Now that Haizea is configured to run alongside OpenNebula, running them is as simple as starting the OpenNebula daemon:</p>
+
+<pre class="shell">
+oned
+</pre>
+
+<p>Followed by Haizea:</p>
+
+<pre class="shell">
+haizea -c /usr/share/haizea/etc/sample_opennebula.conf
+</pre>
+
+<p>Haizea currently always runs in the foreground (a daemon mode will be added in future versions). If you want Haizea to run in the background, you can run it like this:</p>
+
+<pre class="shell">
+nohup haizea -c /usr/share/haizea/etc/sample_opennebula.conf 2> /var/tmp/haizea.log &amp;
+</pre>
+
+<p>
+When Haizea starts up, it will print out something like this:
+</p>
+
+<pre class="shell">
+[2008-07-21 11:49:00.63] ONE     Fetched <em>N</em> nodes from ONE db
+[2008-07-21 11:49:00.63] RM      Starting resource manager
+[2008-07-21 11:49:00.63] CLOCK   Starting clock
+</pre>
+
+<p>This means that Haizea has correctly started up, accessed OpenNebula's database and detected that there are <em>N</em> physical nodes (the value of N will depend, of course, on how many nodes you have in your system).</p>
+
+<p><strong>NOTE</strong>: Haizea is a drop-in replacement for OpenNebula's default scheduler (<tt>mm_sched</tt>). Do not run Haizea and <tt>mm_sched</tt> at the same time, or funny things will happen.</p>
+
+<h2>A quick test</h2>
+
+<p>At this point, OpenNebula and Haizea are both running together, and waiting for you to submit a VM request. From the user's perspective, you will still be submitting your requests to OpenNebula, and Haizea will do all the scheduling work backstage. However, you will be able to add an <tt>HAIZEA</tt> parameter to your OpenNebula request to access Haizea's features.</p>
+
+<p>So, to test that OpenNebula and Haizea are working correctly, start by taking a known-good OpenNebula template. Just to be on the safe side, you may want to try it with the default scheduler first, to make sure that the VM itself works correctly, etc. Then, just add the following parameter to the template:</p>
+
+<pre class="shell">
+HAIZEA = [
+  start        = "+00:00:30",
+  duration     = "00:01:00",
+  preemptible  = "no"
+]
+</pre>
+
+<p>The exact meaning of these parameters is explained later on in this document. In a nutshell, the values specified above tell Haizea to schedule the VM to start exactly 30 seconds in the future, to run for one minute, and to not allow the allocated resources to be preempted by other requests. As we will see later on, this is called an "advance reservation" (or AR) request.</p>
+
+<p>Before you submit your request to OpenNebula, take a look at the Haizea log. You should see something like this repeating every minute:</p>
+
+
+<pre class="shell">
+[2008-07-21 11:49:00.63] CLOCK   Waking up to manage resources
+[2008-07-21 11:49:00.63] CLOCK   Wake-up time recorded as 2008-07-21 11:49:01.00
+[2008-07-21 11:49:00.63] CLOCK   Going back to sleep. 
+                                 Waking up at 2008-07-21 11:50:01.00 
+                                 to see if something interesting has happened by then.
+</pre>
+
+<p>Haizea is configured, by default, to ask OpenNebula if there are any pending requests every minute. Since you haven't submitted anything, Haizea just wakes up every minute and goes right back to sleep. So, go ahead and submit your request (the one where you added the HAIZEA parameter). Assuming you named the template <tt>ar.one</tt>, run the following:</p>
+
+<pre class="shell">
+onevm submit ar.one
+</pre>
+
+<p>If you run <tt>onevm list</tt> to see the VMs managed by OpenNebula, you'll see that the request is in a <tt>pending</tt> state:</p>
+
+<pre class="shell">
+  ID     NAME STAT CPU     MEM        HOSTNAME        TIME
+----------------------------------------------------------
+  42     test pend   0       0                 00 00:00:04
+</pre>
+
+<p>Next time Haizea wakes up, you should see something like this:</p>
+
+<pre class="shell">
+[2008-07-21 11:50:00.99] CLOCK   Waking up to manage resources
+[2008-07-21 11:50:00.99] CLOCK   Wake-up time recorded as 2008-07-21 11:50:01.00
+[2008-07-21 11:50:01.03] SCHED   Received AR lease request #1, 1 nodes 
+                                   from 2008-07-21 11:50:31.00 
+                                     to 2008-07-21 11:51:31.00.
+[2008-07-21 11:50:01.03] SCHED   AR lease request #1 has been accepted.
+[2008-07-21 11:50:01.03] CLOCK   Going back to sleep. 
+                                 Waking up at 2008-07-21 11:50:31.00 
+                                 to handle slot table event.
+</pre>
+
+<p>Notice how Haizea detected that OpenNebula had an AR request, and then scheduled it to start 30 seconds in the future. In fact, Haizea takes care to wake up at that time so the VM can start at exactly that time.</p>
+
+<p>NOTE: If you run <tt>onevm list</tt>, the request will still be shown as <tt>pending</tt>. OpenNebula doesn't track Haizea's internal states, so it will consider the request "pending" until Haizea starts up the VM. Future versions will provide more information on a VMs state.</p>
+
+<p>NOTE (2): Currently, Haizea has to poll OpenNebula every minute to ask if there are any new requests. An upcoming version of Haizea will support an event-based model where OpenNebula can send Haizea a notification as soon as a new request is received (so the user doesn't have to wait until the next time Haizea wakes up to process the request).</p>
+
+<p>When the VM is scheduled to start, you will see the following in the Haizea logs:</p>
+
+<pre class="shell">
+[2008-07-21 11:50:30.99] CLOCK   Waking up to manage resources
+[2008-07-21 11:50:30.99] CLOCK   Wake-up time recorded as 2008-07-21 11:50:31.00
+[2008-07-21 11:50:31.32] SCHED   Started VMs for lease 1 on nodes [1]
+[2008-07-21 11:50:31.32] CLOCK   Going back to sleep. 
+                                 Waking up at 2008-07-21 11:51:31.00 
+                                 to handle slot table event.
+</pre>
+
+<p>Haizea has instructed OpenNebula to start the VM for the advance reservation. If you run <tt>onevm list</tt>, the VM will now show up as running:</p>
+
+<pre class="shell">
+  ID     NAME STAT CPU     MEM        HOSTNAME        TIME
+----------------------------------------------------------
+  42     test runn   2  262144          ursa03 00 00:01:04
+</pre>
+
+<p>You should be able to access the VM (if you configured it with networking and SSH). However, since we requested the VM to run for just a minute, you will soon see the following in the Haizea logs:</p>
+
+<pre class="shell">
+[2008-07-21 11:51:31.00] CLOCK   Waking up to manage resources
+[2008-07-21 11:51:31.00] CLOCK   Wake-up time recorded as 2008-07-21 11:51:31.00
+[2008-07-21 11:51:31.17] SCHED   Stopped VMs for lease 1 on nodes [1]
+[2008-07-21 11:51:31.17] CLOCK   Going back to sleep. 
+                                 Waking up at 2008-07-21 11:52:31.00 
+                                 to see if something interesting has happened by then.
+</pre>
+
+<h2>The HAIZEA parameter in OpenNebula</h2>
+
+<p>The previous section showed how you can add an <tt>HAIZEA</tt> parameter to your OpenNebula VM template to request a simple advance reservation. The three Haizea options (<tt>start</tt>, <tt>duration</tt>, and <tt>preemptible</tt>) can take other values:</p>
+
+<ul>
+<li><tt>start:</tt> This option specifies when the VM will start. Valid values are:
+    <ul>
+<li><tt>best_effort</tt>: The VM will be scheduled as soon as resources are available. If resources are not available right now, the request is put on a queue and it remains there until there are sufficient resources (requests are scheduled on a first-come-first-serve basis).</li>
+<li><tt>now</tt>: The VM will be scheduled right now. If resources are not available right now, the request is rejected.</li>
+    <li>Exact ISO timestamp: i.e., <tt>YYYY-MM-DD HH:MM:SS</tt>. The VM must start at exactly that time. If enought resources are not available at that time, the resource is not requested.</li>
+<li>Relative ISO timestamp: For convenience's sake (and also for testing) this provides an easy way of specifying that a VM must start "at T time after the VM is submitted". The format would be +HH:MM:SS (the "+" is not ISO, but is used by Haizea to determine that it is a relative timestamp)</li>
+    </ul>
+</li>
+<li><tt>duration:</tt> The duration of the lease. Possible values are:
+<ul><li><tt>unlimited</tt>: The lease will run forever, until explicitly stopped </li>
+<li><tt>ISO-formatted time</tt>: i.e., <tt>HH:MM:SS</tt></li></ul>
+</li>
+<li><tt>preemptible</tt>: This option can be either <tt>yes</tt> or <tt>no</tt>. Haizea currently uses a very simple priority scheme where VMs are either preemptible or non-preemptible (furthermore, a non-preemptible VM can preempt preemptible VMs, while preemptible VMs can't preempt anything). If a VM is preemptible, and a preempting VM needs its resources, then the preemptible VM will be suspended while the preempting VM is running. Future versions of Haizea will include better priority schemes.</li>
+</ul>
+
+<p>Usually, you will want to use these options to create one of Haizea's <a href="features_leases">supported lease types</a>:</p>
+
+<h3>Advance reservations</h3>
+<p>When you need your VM available at a specific time, this is called an <em>advance reservation</em>, or AR. The VM we used above is an example of an AR:</p>
+
+<pre class="shell">
+HAIZEA = [
+  start        = "+00:00:30",
+  duration     = "00:01:00",
+  preemptible  = "no"
+]
+</pre>
+
+<p>Of course, instead of specifying that you want your VM to start after a certain amount of time has passed (30 seconds, in this case), you can also specify an exact start time:</p>
+
+<pre class="shell">
+HAIZEA = [
+  start        = "2008-11-04 11:00:00",
+  duration     = "03:00:00",
+  preemptible  = "no"
+]
+</pre>
+
+<p>NOTE: Haizea currently only supports non-preemptible ARs.</p>
+
+<h3>Best-effort provisioning</h3>
+
+<p>When you instruct Haizea to determine the start time on a best-effort basis, your request will be allocated resources as soon as they become available. Take into account that your request may be placed on a queue, and you'll have to wait until your turn is up (there is currently no way to query the state of the queue, although this functionality will be added soon).</p>
+
+<pre class="shell">
+HAIZEA = [
+  start        = "best_effort",
+  duration     = "01:00:00",
+  preemptible  = "yes"
+]
+</pre>
+
+<p>A best-effort VM can be preemptible or non-preemptible. If you request a non-preemptible VM, you may still have to wait in the queue until you get your resources but, once you do, no one can take them from you.</p>
+
+
+<h3>Immediate provisioning</h3>
+
+<p>Sometimes, you need a VM right now or not at all. In that case, you can set the starting time to <tt>now</tt>. </p>
+
+<pre class="shell">
+HAIZEA = [
+  start        = "now",
+  duration     = "unlimited",
+  preemptible  = "no"
+]
+</pre>
+
+
+<h2>Additional OpenNebula configuration options</h2>
+
+<p>When running Haizea with OpenNebula, you must specify at least the <tt>db</tt> and <tt>onevm</tt> options in the <tt>[opennebula]</tt> section of the configuration file. However, there are additional options you can tweak:</p>
+
+<h3>Wakeup interval</h3>
+
+<p>This is the interval, in seconds, at which Haizea will wake up to process pending requests in OpenNebula. The default is 60 seconds.</p>
+
+<pre class="shell">
+[opennebula]
+...
+<strong>wakeup-interval: 60</strong>
+...
+</pre>
+
+<h3>Suspend/resume rate interval</h3>
+
+<p>This option provides Haizea with an estimate of how long it takes for OpenNebula to suspend or resume a virtual machine. This is estimated in MB per second, and is largely dependent on the disk read/write transfer speeds on your system (so, if a VM has 1024 MB of memory, and the suspend rate is estimated to be 64MB/s, Haizea will estimate that suspension will take 16 seconds). If you do not specify a value, Haizea will conservatively assume a rate of 32MB/s. A good estimate will allow Haizea to more correctly schedule resources, but an incorrect estimation will <em>not</em> result in an error (although a warning will be noted in the logs).</p>
+
+<pre class="shell">
+[opennebula]
+...
+<strong>suspendresume-rate-estimate: 32</strong>
+...
+</pre>
+
+<h3>Non-schedulable interval</h3>
+
+<p>The minimum amount of time that must pass between when a request is scheduled to when it can actually start (i.e., this makes sure that the scheduling function doesn't make reservations with starting times that will be in the past by the time the scheduling function ends). The default (10 seconds) should be good for most configurations, but may need to be increased if you're dealing with exceptionally high loads.</p>
+
+<pre class="shell">
+[opennebula]
+...
+<strong>non-schedulable-interval: 10</strong>
+...
+</pre>
+
+
+
+
+<table border="0" align="center">
+<tr>
+<td>
+<div class="back">
+<a href="documentation.html">
+<img src="logo_small.png" width="32" height="35" border="0" alt="haizea"/><br/>
+BACK TO<br/>DOCUMENTATION
+</a>
+</div>
+</td>
+<td>&nbsp;&nbsp;</td>
+<td>
+<div class="back">
+<a href="index.html">
+<img src="logo_small.png" width="32" height="35" border="0" alt="haizea"/><br/>
+BACK TO<br/>HOME PAGE
+</a>
+</div>
+</td>
+</tr>
+</table>
+
+</div>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("UA-4920033-1");
+pageTracker._initData();
+pageTracker._trackPageview();
+</script>
+</body>
+</html>


Property changes on: trunk/html/doc_opennebula.html
___________________________________________________________________
Name: svn:executable
   + *



More information about the Haizea-commit mailing list