<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Russell Bryant</title>
	<atom:link href="http://russellbryantnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://russellbryantnet.wordpress.com</link>
	<description>Open Source Software Engineering</description>
	<lastBuildDate>Thu, 23 May 2013 14:19:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='russellbryantnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Russell Bryant</title>
		<link>http://russellbryantnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://russellbryantnet.wordpress.com/osd.xml" title="Russell Bryant" />
	<atom:link rel='hub' href='http://russellbryantnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Availability Zones and Host Aggregates in OpenStack Compute (Nova)</title>
		<link>http://russellbryantnet.wordpress.com/2013/05/21/availability-zones-and-host-aggregates-in-openstack-compute-nova/</link>
		<comments>http://russellbryantnet.wordpress.com/2013/05/21/availability-zones-and-host-aggregates-in-openstack-compute-nova/#comments</comments>
		<pubDate>Tue, 21 May 2013 20:43:10 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">http://russellbryantnet.wordpress.com/?p=350</guid>
		<description><![CDATA[Confusion around Host Aggregates and Availabaility Zones in Nova seems to be very common. In this post I&#8217;ll attempt to show how each are used. All information in this post is based on the way things work in the Grizzly version of Nova. First, go ahead and forget everything you know about things called Availability [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=350&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Confusion around Host Aggregates and Availabaility Zones in Nova seems to be very common. In this post I&#8217;ll attempt to show how each are used. All information in this post is based on the way things work in the Grizzly version of Nova.</p>
<p>First, go ahead and forget everything you know about things called Availability Zones in other systems.  They are not the same thing and trying to map Nova&#8217;s concept of Availability Zones to what something else calls Availability Zones will only cause confusion.</p>
<p>The high level view is this: A host aggregate is a grouping of hosts with associated metadata.  A host can be in more than one host aggregate.  The concept of host aggregates is only exposed to cloud administrators.</p>
<p>A host aggregate may be exposed to users in the form of an availability zone. When you create a host aggregate, you have the option of providing an availability zone name. If specified, the host aggregate you have created is now available as an availability zone that can be requested.</p>
<p>Here is a tour of some commands.</p>
<p>Create a host aggregate:</p>
<pre>$ nova aggregate-create test-aggregate1
+----+-----------------+-------------------+-------+----------+
| Id | Name            | Availability Zone | Hosts | Metadata |
+----+-----------------+-------------------+-------+----------+
| 1  | test-aggregate1 | None              |       |          |
+----+-----------------+-------------------+-------+----------+
</pre>
<p>Create a host aggregate that is exposed to users as an availability zone. (<strong>This is not creating a host aggregate within an availability zone! It is creating a host aggregate that <em>is</em> the availability zone!</strong>)</p>
<pre>$ nova aggregate-create test-aggregate2 test-az
+----+-----------------+-------------------+-------+----------+
| Id | Name            | Availability Zone | Hosts | Metadata |
+----+-----------------+-------------------+-------+----------+
| 2  | test-aggregate2 | test-az           |       |          |
+----+-----------------+-------------------+-------+----------+
</pre>
<p>Add a host to a host aggregate, <code>test-aggregate2</code>. Since this host aggregate defines the availability zone <code>test-az</code>, adding a host to this aggregate makes it a part of the <code>test-az</code> availability zone.</p>
<pre>nova aggregate-add-host 2 devstack
Aggregate 2 has been successfully updated.
+----+-----------------+-------------------+---------------+------------------------------------+
| Id | Name            | Availability Zone | Hosts         | Metadata                           |
+----+-----------------+-------------------+---------------+------------------------------------+
| 2  | test-aggregate2 | test-az           | [u'devstack'] | {u'availability_zone': u'test-az'} |
+----+-----------------+-------------------+---------------+------------------------------------+
</pre>
<p>Note that the novaclient output shows the availability zone twice.  The data model on the backend only stores the availability zone in the metadata.  There is not a separate column for it.  The API returns the availability zone separately from the general list of metadata, though, since it&#8217;s a special piece of metadata.</p>
<p>Now that the <code>test-az</code> availability zone has been defined and contains one host, a user can boot an instance and request this availability zone.</p>
<pre>$ nova boot --flavor 84 --image 64d985ba-2cfa-434d-b789-06eac141c260 \
&gt; --availability-zone test-az testinstance
$ nova show testinstance
+-------------------------------------+----------------------------------------------------------------+
| Property                            | Value                                                          |
+-------------------------------------+----------------------------------------------------------------+
| status                              | BUILD                                                          |
| updated                             | 2013-05-21T19:46:06Z                                           |
| OS-EXT-STS:task_state               | spawning                                                       |
| OS-EXT-SRV-ATTR:host                | devstack                                                       |
| key_name                            | None                                                           |
| image                               | cirros-0.3.1-x86_64-uec (64d985ba-2cfa-434d-b789-06eac141c260) |
| private network                     | 10.0.0.2                                                       |
| hostId                              | f038bdf5ff35e90f0a47e08954938b16f731261da344e87ca7172d3b       |
| OS-EXT-STS:vm_state                 | building                                                       |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000002                                              |
| OS-EXT-SRV-ATTR:hypervisor_hostname | devstack                                                       |
| flavor                              | m1.micro (84)                                                  |
| id                                  | 107d332a-a351-451e-9cd8-aa251ce56006                           |
| security_groups                     | [{u'name': u'default'}]                                        |
| user_id                             | d0089a5a8f5440b587606bc9c5b2448d                               |
| name                                | testinstance                                                   |
| created                             | 2013-05-21T19:45:48Z                                           |
| tenant_id                           | 6c9cfd6c838d4c29b58049625efad798                               |
| OS-DCF:diskConfig                   | MANUAL                                                         |
| metadata                            | {}                                                             |
| accessIPv4                          |                                                                |
| accessIPv6                          |                                                                |
| progress                            | 0                                                              |
| OS-EXT-STS:power_state              | 0                                                              |
| OS-EXT-AZ:availability_zone         | test-az                                                        |
| config_drive                        |                                                                |
+-------------------------------------+----------------------------------------------------------------+
</pre>
<p>All of the examples so far show how host-aggregates provide an API driven mechanism for cloud administrators to define availability zones.  The other use case host aggregates serves is a way to tag a group of hosts with a type of capability.  When creating custom flavors, you can set a requirement for a capability.  When a request is made to boot an instance of that type, it will only consider hosts in host aggregates tagged with this capability in its metadata.</p>
<p>We can add some metadata to the original host aggregate we created that was *not* also an availability zone, <code>test-aggregate1</code>.</p>
<pre>$ nova aggregate-set-metadata 1 coolhardware=true
Aggregate 1 has been successfully updated.
+----+-----------------+-------------------+-------+----------------------------+
| Id | Name            | Availability Zone | Hosts | Metadata                   |
+----+-----------------+-------------------+-------+----------------------------+
| 1  | test-aggregate1 | None              | []    | {u'coolhardware': u'true'} |
+----+-----------------+-------------------+-------+----------------------------+
</pre>
<p>A flavor can include a set of key/value pairs called <code>extra_specs</code>.  Here&#8217;s an example of creating a flavor that will only run on hosts in an aggregate with the <code>coolhardware=true</code> metadata.</p>
<pre>$ nova flavor-create --is-public true m1.coolhardware 100 2048 20 2
+-----+-----------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID  | Name            | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+-----+-----------------+-----------+------+-----------+------+-------+-------------+-----------+
| 100 | m1.coolhardware | 2048      | 20   | 0         |      | 2     | 1.0         | True      |
+-----+-----------------+-----------+------+-----------+------+-------+-------------+-----------+
$ nova flavor-key 100 set coolhardware=true
$ nova flavor-show 100
+----------------------------+----------------------------+
| Property                   | Value                      |
+----------------------------+----------------------------+
| name                       | m1.coolhardware            |
| ram                        | 2048                       |
| OS-FLV-DISABLED:disabled   | False                      |
| vcpus                      | 2                          |
| extra_specs                | {u'coolhardware': u'true'} |
| swap                       |                            |
| os-flavor-access:is_public | True                       |
| rxtx_factor                | 1.0                        |
| OS-FLV-EXT-DATA:ephemeral  | 0                          |
| disk                       | 20                         |
| id                         | 100                        |
+----------------------------+----------------------------+
</pre>
<p>Hopefully this provides some useful information on what host aggregates and availability zones are, and how they are used.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=350&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2013/05/21/availability-zones-and-host-aggregates-in-openstack-compute-nova/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenStack Compute (Nova) Roadmap for Havana</title>
		<link>http://russellbryantnet.wordpress.com/2013/05/13/openstack-compute-nova-roadmap-for-havana/</link>
		<comments>http://russellbryantnet.wordpress.com/2013/05/13/openstack-compute-nova-roadmap-for-havana/#comments</comments>
		<pubDate>Mon, 13 May 2013 19:02:41 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">http://russellbryantnet.wordpress.com/?p=345</guid>
		<description><![CDATA[The Havana design summit was held mid-April.  Since then we have been documenting the Havana roadmap and going full speed ahead on development of these features.  The list of features that developers have committed to completing for the Havana release is tracked using blueprints on Launchpad. At the time of writing, we have 74 blueprints [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=345&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The Havana design summit was held mid-April.  Since then we have been documenting the Havana roadmap and going full speed ahead on development of these features.  The list of features that developers have committed to completing for the Havana release is tracked using <a href="https://blueprints.launchpad.net/nova/havana">blueprints on Launchpad</a>. At the time of writing, we have 74 blueprints listed that cover a wide range of development efforts.  Here are some highlights in no particular order:</p>
<h2>Database Handling</h2>
<p>Vish Ishaya made a change at the very beginning of the development cycle that will allow us to <a href="https://blueprints.launchpad.net/nova/+spec/backportable-db-migrations">backport database migrations</a> to the Grizzly release if needed. This is needed in case we need to backport a bug fix that requires a migration.</p>
<p>Dan Smith and Chris Behrens are working on a <a href="https://blueprints.launchpad.net/nova/+spec/unified-object-model">unified object model</a>. One of the things that has been in the way of rolling upgrades of a Nova deployment is that the code and the database schema are very tightly coupled. The primary goal of this effort is to decouple these things. This effort is bringing in some other improvements, as well, including better object serialization handling for rpc, as well as object versioning.</p>
<p>Boris Pavlovic continues to do a lot of cleanup of database support in Nova.  He&#8217;s <a href="https://blueprints.launchpad.net/nova/+spec/db-api-tests">adding tests</a> (and <a href="https://blueprints.launchpad.net/nova/+spec/db-api-tests-on-all-backends">more tests</a>), adding <a href="https://blueprints.launchpad.net/nova/+spec/db-enforce-unique-keys">unique constraints</a>, <a href="https://blueprints.launchpad.net/nova/+spec/db-session-cleanup">improving session handling</a>, and <a href="https://blueprints.launchpad.net/nova/+spec/db-improve-archiving">improving archiving</a>.</p>
<p>Chris Behrens has been working on a <a href="https://blueprints.launchpad.net/nova/+spec/db-mysqldb-impl">native MySQL database driver</a> that performs much better than the SQLAlchemy driver for use in large scale deployments.</p>
<p>Mike Wilson is working on supporting <a href="https://blueprints.launchpad.net/nova/+spec/db-slave-handle">read-only database slaves</a>. This will allow distributing some queries to other database servers to help scaling in large scale deployments.</p>
<h2>Bare Metal</h2>
<p>The Grizzly release of Nova included the bare metal provisioning driver. Interest in this functionality has been rapidly increasing. Devananda van der Veen proposed that the bare metal provisioning code be <a href="http://https://blueprints.launchpad.net/nova/+spec/deprecate-baremetal-driver">split out into a new project</a> called Ironic. The new project was <a href="http://http://eavesdrop.openstack.org/meetings/tc/2013/tc.2013-05-07-20.01.html">approved for incubation</a> by the OpenStack Technical Committee last week. Once this has been completed, there will be a driver in Nova that talks to the Ironic API. The Ironic API will present some additional functionality that doesn&#8217;t make sense to use to present in the Compute API in Nova.</p>
<p>Prior to the focus shift to Ironic, some new features were added to the bare metal driver. USC-ISI <a href="https://blueprints.launchpad.net/nova/+spec/add-tilera-to-baremetal">added support for Tilera</a> and Devananda added a feature that allows you to <a href="https://blueprints.launchpad.net/nova/+spec/baremetal-force-node">request a specific bare metal node</a> when provisioning a server.</p>
<h2>Version 3 (v3) of the Compute API</h2>
<p>The Havana release will include <a href="https://blueprints.launchpad.net/nova/+spec/nova-v3-api">a new revision of the compute REST API</a> in Nova. This effort is being led by Christopher Yeoh, with help from others. The v3 API will include <a href="https://blueprints.launchpad.net/nova/+spec/v3-api-extension-framework">a new framework for implementing extensions</a>, <a href="https://blueprints.launchpad.net/nova/+spec/v3-api-extension-versioning">extension versioning</a>, and a whole bunch of cleanup: (<a href="https://blueprints.launchpad.net/nova/+spec/v3-api-remove-project-id">1</a>) (<a href="https://blueprints.launchpad.net/nova/+spec/v3-api-expected-errors">2</a>) (<a href="https://blueprints.launchpad.net/nova/+spec/v3-api-inconsistencies">3</a>) (<a href="https://blueprints.launchpad.net/nova/+spec/v3-api-return-codes">4</a>).</p>
<h2>Networking</h2>
<p>The OpenStack community has been maintaining two network stacks for some time. Nova includes the nova-network service. Meanwhile, the OpenStack Networking project has been developed from scratch to support much more than nova-network does. Nova currently supports both. OpenStack Networking is expected to reach and surpass feature parity with nova-network in the Havana cycle. As a result, it&#8217;s time to deprecate <a href="https://blueprints.launchpad.net/nova/+spec/deprecate-nova-network">nova-network</a>. Vish Ishaya (from the Nova side) and Gary Kotton (from the OpenStack Networking side) have agreed to take on the challenging task of figuring out how to migrate existing deployments using nova-network to an updated environment that includes OpenStack Networking.</p>
<h2>Scheduling</h2>
<p>The Havana roadmap includes a mixed bag of scheduler features.</p>
<p>Andrew Laski is going to make the changes required so that the scheduler becomes exclusively a <a href="https://blueprints.launchpad.net/nova/+spec/query-scheduler">resource that gets queried</a>. Currently, when starting an instance, the request is handed off to the scheduler, which then hands it off to the compute node that is selected. This change will make it so proxying through nova-scheduler is no longer done. This will mean that <em>every</em> operation that uses the scheduler will interact with it the same way, as opposed to some operations querying and others proxying.</p>
<p>Phil Day will be adding an API extension that allows you to <a href="https://blueprints.launchpad.net/nova/+spec/scheduler-hints-api">discover which scheduler hints are supported</a>.  Phil is also looking at adding a way to <a href="https://blueprints.launchpad.net/nova/+spec/whole-host-allocation">allocate an entire host</a> to a single tenant.</p>
<p>Inbar Shapira is looking at allowing <a href="https://blueprints.launchpad.net/nova/+spec/multiple-scheduler-drivers">multiple scheduling policies</a> to be in effect at the same time.  This will allow you to have different sets of scheduler filters activated depending on some type of criteria (perhaps the requested availability zone).</p>
<p>Rerngvit Yanggratoke is implementing support for <a href="https://blueprints.launchpad.net/nova/+spec/utilization-based-scheduling">weighting scheduling decisions based on the CPU utilization</a> of existing instances on a host.</p>
<h2>Migrations</h2>
<p>Nova includes support for different types of migrations. We have cold migrations (migrate) and live migrations (live-migrate). We also have resize and evactuate, which are very related functions. The code paths for all of these features have evolved separately. It turns out that we can rework all of these things to share a lot of code. While we&#8217;re at it, we are restructuring the way these operations work to be primarily driven by the nova-conductor service.  This will allow the tasks to be tracked in a single place, as opposed to the flow of control being passed around between compute nodes. Having compute nodes tell each other what to do is also a very bad thing from a security perspective. These efforts are well underway. Tiago Rodrigues de Mello is working on <a href="https://blueprints.launchpad.net/nova/+spec/cold-migrations-to-conductor">moving cold migrations to nova-conductor</a> and John Garbutt is working on <a href="https://blueprints.launchpad.net/nova/+spec/live-migration-to-conductor">moving live migrations</a>. All of this is tracked under the <a href="https://blueprints.launchpad.net/nova/+spec/unified-migrations">parent blueprint for unified migrations</a>.</p>
<h2>And More!</h2>
<p>This post doesn&#8217;t include every feature on the roadmap. You can find that <a href="https://blueprints.launchpad.net/nova/havana">here</a>. I fully expect that more will be added to this list as Havana progresses. We don&#8217;t always know what features are being worked on in advance. If you have another feature you would like to propose, let&#8217;s talk about it on <a href="http://lists.openstack.org/pipermail/openstack-dev/">the openstack-dev list</a>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=345&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2013/05/13/openstack-compute-nova-roadmap-for-havana/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>Deployment Considerations for nova-conductor Service in OpenStack Grizzly</title>
		<link>http://russellbryantnet.wordpress.com/2013/02/19/deployment-considerations-for-nova-conductor-service-in-openstack-grizzly/</link>
		<comments>http://russellbryantnet.wordpress.com/2013/02/19/deployment-considerations-for-nova-conductor-service-in-openstack-grizzly/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 14:00:10 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">https://russellbryantnet.wordpress.com/?p=333</guid>
		<description><![CDATA[The Grizzly release of OpenStack Nova includes a new service, nova-conductor. Some previous posts about this service can be found here and here. This post is intended to provide some additional insight into how this service should be deployed and how the service should be scaled as load increases. Smaller OpenStack Compute deployments typically consist [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=333&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The Grizzly release of OpenStack Nova includes a new service, nova-conductor. Some previous posts about this service can be found <a href="http://russellbryantnet.wordpress.com/2012/11/19/a-new-nova-service-nova-conductor/">here</a> and <a href="http://www.danplanet.com/blog/2013/02/07/all-your-db-are-belong-to-conductor/">here</a>. This post is intended to provide some additional insight into how this service should be deployed and how the service should be scaled as load increases.</p>
<p>Smaller OpenStack Compute deployments typically consist of a single controller node and one or more compute (hypervisor) nodes. The nova-conductor service fits in the category of controller services. In this style of deployment you would run nova-conductor on the controller node and not on the compute nodes. Note that most of what nova-conductor does in the Grizzly release is doing database operations on behalf of compute nodes. This means that the controller node will have more work to do than in previous releases. Load should be monitored and the controller services should be scaled out if necessary.</p>
<p>Here is a model of what this size of deployment might look like:</p>
<p><a href="http://russellbryantnet.files.wordpress.com/2013/02/nova-simple.png"><img class="alignnone size-medium wp-image-338" alt="nova-simple" src="http://russellbryantnet.files.wordpress.com/2013/02/nova-simple.png?w=300&#038;h=226" width="300" height="226" /></a></p>
<p>As Compute deployments get larger, the controller services are scaled horizontally. For example, there would be multiple instances of the nova-api service on multiple nodes sitting behind a load balancer. You may also be running multiple instances of the nova-scheduler service across multiple nodes. Load balancing is done automatically for the scheduler by the AMQP message broker, RabbitMQ or Qpid. The nova-conductor service should be scaled out in this same way. It can be run multiple times across multiple nodes and the load will be balanced automatically by the message broker.</p>
<p>Here is a second deployment model. This gives an idea of how a deployment grows beyond a single controller node.</p>
<p><a href="http://russellbryantnet.files.wordpress.com/2013/02/nova-complex.png"><img class="alignnone size-medium wp-image-339" alt="nova-complex" src="http://russellbryantnet.files.wordpress.com/2013/02/nova-complex.png?w=258&#038;h=300" width="258" height="300" /></a></p>
<p>There are a couple of ways to monitor the performance of nova-conductor to see if it needs to be scaled out. The first is by monitoring CPU load. The second is by monitoring message queue size. If the queues are getting backed up, it is likely time to scale out services.  Both messaging systems provide at least one way to look at the state of message queues. For Qpid, try the <code>qpid-stat</code> command. For RabbitMQ, see the <code><a href="http://www.rabbitmq.com/man/rabbitmqctl.1.man.html">rabbitmqctl list_queues</a></code> command.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/333/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=333&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2013/02/19/deployment-considerations-for-nova-conductor-service-in-openstack-grizzly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>

		<media:content url="http://russellbryantnet.files.wordpress.com/2013/02/nova-simple.png?w=300" medium="image">
			<media:title type="html">nova-simple</media:title>
		</media:content>

		<media:content url="http://russellbryantnet.files.wordpress.com/2013/02/nova-complex.png?w=258" medium="image">
			<media:title type="html">nova-complex</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Steam for Linux Beta on Fedora 17</title>
		<link>http://russellbryantnet.wordpress.com/2012/12/07/installing-steam-for-linux-beta-on-fedora-17/</link>
		<comments>http://russellbryantnet.wordpress.com/2012/12/07/installing-steam-for-linux-beta-on-fedora-17/#comments</comments>
		<pubDate>Fri, 07 Dec 2012 15:57:06 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[Fedora]]></category>

		<guid isPermaLink="false">http://russellbryantnet.wordpress.com/?p=322</guid>
		<description><![CDATA[UPDATE: Since the original post, the download of Team Fortress 2 completed and I hit a problem. The post has been amended with the solution. It sounds like a lot more people got access to the Steam for Linux beta yesterday, including me. An announcement on steamcommunity.com says: We&#8217;ve just expanded the limited public beta [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=322&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><strong>UPDATE:</strong> <em>Since the original post, the download of Team Fortress 2 completed and I hit a problem.  The post has been amended with the solution.</em></p>
<p>It sounds like a lot more people got access to the Steam for Linux beta yesterday, including me.  An announcement on <a href="http://steamcommunity.com/games/221410/announcements/detail/1749910796493493022">steamcommunity.com</a> says:</p>
<blockquote><p>We&#8217;ve just expanded the limited public beta by a large amount &#8211; which means another round of email notifications &#8211; so check your inbox! </p></blockquote>
<p>The official download is a deb package for Ubuntu.  My laptop runs Fedora 17.  I was pleasantly surprised to see that there was an unofficial Fedora repository already ready to use.  Here is how I installed the beta on my laptop running Fedora 17:</p>
<p><code>$ wget <a href="http://spot.fedorapeople.org/steam/steam.repo" rel="nofollow">http://spot.fedorapeople.org/steam/steam.repo</a><br />
...<br />
$ sudo mv steam.repo /etc/yum.repos.d/<br />
$ sudo yum install steam<br />
...<br />
$ rpm -q steam<br />
steam-1.0.0.14-3.fc17.i686<br />
</code></p>
<p>Once installation was completed, I ran the steam client from the same terminal:</p>
<p><code>$ steam</code></p>
<p>The first time I ran the steam client it automatically created <code>/home/rbryant/Steam</code> and downloaded about 100 kB of updates.  Once the updates completed, the login screen came up.  I closed the steam client and ran it again.  I got a warning dialog that said:</p>
<blockquote><p>Unable to copy /home/rbryant/Steam/bin_steam.sh to /usr/bin/steam, please contact your system administrator.</p></blockquote>
<p>This was a bit odd since the app that I had been running was already <code>/usr/bin/steam</code>.  I suspect this is just automatically installing a new version based on what was downloaded with the updates.  Based on the output in my terminal, I can see that before this warning came up, steam tried to find <code>gksudo</code>, <code>kdesudo</code>, or <code>xterm</code> and then gave up.  I went ahead and installed xterm.</p>
<p><code>$ sudo yum install xterm</code></p>
<p>When running steam yet again, it popped up an xterm window to ask me to type in my password.  This only happened once.  Subsequent runs of the steam client in my terminal went straight to the login window.</p>
<p>From there I finally decided to log in using my existing steam account.  I confirmed access to my account on a new computer and was in.  I kicked off a download of Team Fortress 2 Beta for Linux.</p>
<p>Once the game download was complete, I clicked Play.  The first time I tried, it failed with the following error:</p>
<blockquote><p>Required OpenGL extension &#8220;GL_EXT_texture_compression_s3tc&#8221; is not supported. Please install S3TC texture support.</p></blockquote>
<p>To fix this, I had to add the rpmfusion repositories to my machine and install the <code>libtxc_dxtn</code> package.</p>
<p><code><br />
$ sudo yum localinstall --nogpgcheck <a href="http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm" rel="nofollow">http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm</a> <a href="http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm" rel="nofollow">http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm</a></p>
<p>$ sudo yum install libtxc_dxtn</code></p>
<p>If you&#8217;re running 64-bit Linux, you will actually need the 32-bit version of this library to fix the game.  Install it by running:</p>
<p><code>$ sudo yum install libtxc_dxtn.i686</code></p>
<p>Once all of that was done, the game launched successfully and I was able to start a training session.</p>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/322/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=322&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2012/12/07/installing-steam-for-linux-beta-on-fedora-17/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>A new Nova service: nova-conductor</title>
		<link>http://russellbryantnet.wordpress.com/2012/11/19/a-new-nova-service-nova-conductor/</link>
		<comments>http://russellbryantnet.wordpress.com/2012/11/19/a-new-nova-service-nova-conductor/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 23:57:24 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">http://russellbryantnet.wordpress.com/?p=317</guid>
		<description><![CDATA[The Grizzly release of OpenStack Nova will have a new service, nova-conductor. The service was discussed on the openstack-dev list and it was merged today. There is currently a configuration option that can be turned on to make it optional, but it is possible that by the time Grizzly is released, this service will be [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=317&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The Grizzly release of OpenStack Nova will have a new service, nova-conductor.  The service was discussed on the <a href="http://lists.openstack.org/pipermail/openstack-dev/2012-November/002573.html">openstack-dev list</a> and it was <a href="https://review.openstack.org/#/c/16135/11">merged today</a>.  There is currently a configuration option that can be turned on to make it optional, but it is possible that by the time Grizzly is released, this service will be required.</p>
<p>One of the efforts that started during Folsom development and is scheduled to be completed in Grizzly is <a href="https://blueprints.launchpad.net/nova/+spec/no-db-compute">no-db-compute</a>.  In short, this effort is to remove direct database access from the nova-compute service.  There are two main reasons we are doing this.  Compute nodes are the least trusted part of a nova deployment, so removing direct database access is a step toward reducing the potential impact of a compromised compute node.  The other benefit of no-db-compute is for upgrades.  Direct database access complicates the ability to do live rolling upgrades.  We&#8217;re working toward eventually making that possible, and this is a part of that.</p>
<p>All of the nova services use a messaging system (usually AMQP based) to communicate with each other.  Many of the database accesses in nova-compute can be (and have been) removed by just sending more data in the initial message sent to nova-compute.  However, that doesn&#8217;t apply to everything.  That&#8217;s where the new service, nova-conductor, comes in.</p>
<p>The nova-conductor service is key to completing no-db-compute.  Conceptually, it implements a new layer on top of nova-compute.  It should *not* be deployed on compute nodes, or else the security benefits of removing database access from nova-compute will be negated.  Just like other nova services such as nova-api or nova-scheduler, it can be scaled horizontally.  You can run multiple instances of nova-conductor on different machines as needed for scaling purposes.</p>
<p>The methods exposed by nova-conductor will initially be relatively simple methods used by nova-compute to offload its database operations.  Places where nova-compute previously did database access will now be talking to nova-conductor.  However, we have plans in the medium to long term to move more and more of what is currently in nova-compute up to the nova-conductor layer.  The compute service will start to look like a less intelligent slave service to nova-conductor.  The conductor service will implement long running complex operations, ensuring forward progress and graceful error handling.  This will be especially beneficial for operations that cross multiple compute nodes, such as migrations or resizes.</p>
<p>If you have any comments, questions, or suggestions for nova-conductor or the no-db-compute effort in general, please feel free to bring it up on the <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">openstack-dev list</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=317&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2012/11/19/a-new-nova-service-nova-conductor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenStack Design Summit and an Eye on Folsom</title>
		<link>http://russellbryantnet.wordpress.com/2012/04/24/openstack-design-summit-and-an-eye-on-folsom/</link>
		<comments>http://russellbryantnet.wordpress.com/2012/04/24/openstack-design-summit-and-an-eye-on-folsom/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 20:33:03 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[OpenStack]]></category>

		<guid isPermaLink="false">http://russellbryantnet.wordpress.com/?p=298</guid>
		<description><![CDATA[I just spent a week in San Francisco at the OpenStack design summit and conference. It was quite an amazing week and I&#8217;m really looking forward to the Folsom development cycle.  You can find a notes from various sessions held at the design summit on the OpenStack wiki. Essex was the first release that I [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=298&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I just spent a week in San Francisco at the OpenStack design summit and conference. It was quite an amazing week and I&#8217;m really looking forward to the Folsom development cycle.  You can find a notes from various sessions held at the design summit <a href="http://wiki.openstack.org/FolsomSummitEtherpads">on the OpenStack wiki</a>.</p>
<p>Essex was the first release that I contributed to.  One thing I did was add <a href="http://qpid.apache.org">Qpid</a> support to both <a href="https://github.com/openstack/nova/blob/master/nova/rpc/impl_qpid.py">Nova</a> and <a href="https://github.com/openstack/glance/blob/master/glance/notifier/notify_qpid.py">Glance</a> as an alternative to using RabbitMQ.  Beyond that, I primarily worked on <a href="http://openstack.org/projects/openstack-security/">vulnerability management</a> and <a href="https://launchpad.net/nova/essex/2012.1">other bug fixing</a>.  For Folsom, I&#8217;m planning on working on some more improvements involving the inter-service messaging layer, also referred to as the rpc API, in Nova.</p>
<h2>1) Moving the rpc API to openstack-common</h2>
<p>The rpc API in Nova is used for private communication between nova services. As an example, when a tenant requests that a new virtual machine instance be created (either via the EC2 API or the OpenStack compute REST API), the nova-api service sends a message to the nova-scheduler service via the rpc API.  The nova-scheduler service decides where the instance is going to live and then sends a message to that compute node&#8217;s nova-compute service via the rpc API.</p>
<p>The other usage of the rpc API in Nova has been for notifications.  Notifications are asynchronous messages about events that happen within the system.  They can be used for monitoring and billing, among other things.  Strictly speaking, notifications aren&#8217;t directly tied to rpc.  A Notifier is an abstraction, of which using rpc is one of the implementations.  Glance also has notifications, including a set of Notifier implementations.  The code was the same at one point but has diverged quite a bit since.</p>
<p>We would like to move the notifiers into openstack-common.  Moving rpc into openstack-common is a prerequisite for that, so I&#8217;m going to knock that part out.  I&#8217;ve already written a few patches in that direction.  Once the rpc API is in openstack-common, other projects will be able to make use of it.  There was discussion of Quantum using rpc at the design summit, so this will be needed for that, too.  Another benefit is that the <a href="http://heat-api.org">Heat</a> project is using a copy of Nova&#8217;s rpc API right now, but will be able to migrate over to using the version from openstack-common.</p>
<h2>2) Versioning the rpc API interfaces</h2>
<p>The<a href="https://github.com/openstack/nova/blob/master/nova/rpc/__init__.py"> existing rpc API</a> is pretty lightweight and seems to work quite well.  One limitation is that there is nothing provided to help with different versions of services talking to each other.  It may work &#8230; or it may not.  If it doesn&#8217;t, the failure you get could be something obvious, or it could be something really bad and bizarre where an operation fails half-way through, leaving things in a bad state.  I&#8217;d like to clean this up.</p>
<p>The end goal with this effort will be to make sure that as you upgrade from Essex to Folsom, any messages originating from an Essex service can and will be correctly processed by a Folsom service.  If that fails, then the failure should be immediate and obvious that a message was rejected due to a version issue.</p>
<h2>3) Removing database access from nova-compute</h2>
<p>This is by far the biggest effort of the 3 described here, and I won&#8217;t be tackling this one alone.  I want to help drive it, though.  This discussion came up in the design summit session about enhancements to Nova security.  By removing direct database access from the nova-compute service, we can help reduce the potential impact if a compute node were to be compromised.  There are two main parts to this effort.</p>
<p>The first part is to make more efficient use of messaging by sending full objects through the rpc API instead of IDs. For example, there are many cases where the nova-api service gets an instance object from the database, does its thing, and then just sends the instance ID in rpc message.  On the other side it has to go pull that same object out of the database.  We have to go through and change all cases like this to include the full object in the message.  In addition to the security benefit, it should be more efficient, as well. This doesn&#8217;t sound too complicated, and it isn&#8217;t really, but it&#8217;s quite a bit of work as there is a lot of code that needs to be changed. There will be some snags to deal with along the way, such as dealing with making sure all of the objects can be serialized properly.</p>
<p>Including full objects in messages is only part of the battle here.  The nova-compute service also does database updates.  We will have to come up with a new approach for this.  It will most likely end up being a new service of some sort, that handles state changes coming from compute nodes and makes the necessary database updates according to those state changes. I haven&#8217;t fully thought through the solution to this part yet. For example, ensuring that this service maintains proper order of messages without turning into a bottleneck in the overall system will be important.</p>
<h2>Onward!</h2>
<p>I&#8217;m sure I&#8217;ll work on other things in Folsom, as well, but those are three that I have on my mind right now.  OpenStack is a great project and I&#8217;m excited to be a part of it!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=298&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2012/04/24/openstack-design-summit-and-an-eye-on-folsom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>Automated Testing of Matahari in a chroot Using Mock</title>
		<link>http://russellbryantnet.wordpress.com/2011/10/06/automated-testing-of-matahari-in-a-chroot-using-mock/</link>
		<comments>http://russellbryantnet.wordpress.com/2011/10/06/automated-testing-of-matahari-in-a-chroot-using-mock/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 20:26:37 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[Matahari]]></category>

		<guid isPermaLink="false">http://www.russellbryant.net/blog/?p=283</guid>
		<description><![CDATA[While I was at Digium, I helped build out some automated testing for Asterisk (posts on that here and here). We had a continuous integration server that did builds, ran C API unit tests, and ran some functional tests written in Python. One of the things that we wanted to do with the Asterisk tests [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=283&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>While I was at Digium, I helped build out some automated testing for Asterisk (posts on that <a href="http://www.russellbryant.net/blog/2010/02/16/asterisk-testing/">here</a> and <a href="http://www.russellbryant.net/blog/2010/07/29/automated-testing-update/">here</a>).  We had a continuous integration <a href="http://bamboo.asterisk.org">server</a> that did builds, ran C API unit tests, and ran some functional tests written in Python.</p>
<p>One of the things that we wanted to do with the Asterisk tests is to sandbox each instance of Asterisk.  All of this is handled by an <a href="http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=markup">Asterisk Python class</a> which creates a new set of directories for each Asterisk instance to store its files.  This seems to have worked pretty well.  One down side is that there is still the potential for Asterisk instances to step on each others files.  All instances of Asterisk for all runs of the tests run within the same OS installation.  One way to improve that that is a bit less heavy handed than starting up a bunch of new VMs all the time is to use a chroot.</p>
<p>Over the last week or so, I have been working on a similar setup for <a href="http://www.matahariproject.org">Matahari</a> and wanted to share some information on how it works and in particular, some aspects that are different from what I&#8217;ve done before, including running all of the tests in a chroot.</p>
<p><strong>What was already in place</strong></p>
<p>Matahari uses <a href="http://autobuild.org/">Test-AutoBuild</a> as its continuous integration server.  The results of the latest build for Fedora can be found <a href="http://et3.redhat.com/hosted/matahari/">here</a>.</p>
<p>When autobuild runs each hour, it clones the Matahari git repo and runs the <a href="https://github.com/matahari/matahari/blob/master/autobuild.sh">autobuild.sh</a> script in the top level directory.  This script uses <a href="http://fedoraproject.org/wiki/Projects/Mock">mock</a> to build both matahari and mingw32-matahari packages.  Mock handles setting up a chroot for the distribution and version you want to build a package for so you can easily do a lot of different builds on one machine.  It also does a lot of caching to make this process much faster if you run it multiple times.</p>
<p>To install mock on Fedora, install the <code>mock</code> package.  You will also need to add the user that will be running mock to the mock group.</p>
<p>To do a build in mock, you first need an srpm.  The autobuild.sh script in Matahari has a make_srpm function that does this.  Once you have an srpm, you can do a build with a single call to mock.  The &#8211;root option specifies the type of chroot you want mock to use.</p>
<p><code> $ mock --root=fedora-16-x86_64 --rebuild *.src.rpm </code></p>
<p>The root, fedora-16-x86_64, is defined by a mock profile.  When mock gets installed, a set of profiles gets installed, which can be found in /etc/mock/.</p>
<p><strong>What&#8217;s new</strong></p>
<p>While doing continuous builds is useful (for example, breaking the Windows build is not terribly uncommon), doing tests against these builds adds an enormous amount of additional value to the setup.  Similar to what we have for Asterisk, we have two sets of tests for Matahari.  We have a suite of C API unit tests, and we have a suite of functional tests written in Python.&lt;/P.</p>
<p>The first thing I did was update the setup to run the unit tests.  I decided to modify the RPM spec file to optionally run the unit tests as a part of the build process.  That patch is <a href="https://github.com/matahari/matahari/commit/c9024b70c4af25730c330fa5c16a1349c14a14e9">here</a>.  If the <code>run_unit_tests</code> variable is set, the spec file runs <code>ctest</code> after compilation is complete.  The other aspect of this is getting this variable defined, which is pretty easy to do with mock.</p>
<p><code> $ mock --root=fedora-16-x86_64 <i>--define "run_unit_tests 1"</i> --rebuild *.src.rpm </code></p>
<p>Getting the Python-based functional tests running within mock is a bit more tricky, but not too bad.  With the mock commands presented so far, a number of things are happening automatically, including setting up the chroot and cleaning up the chroot.  To get these other tests running, we have to break up the processes into smaller steps.  The first step is to initialize a chroot.  We will also be using another option for all of the mock commands, &#8211;resultdir, which lets you specify where logs and the resulting RPMs from &#8211;rebuild are stored.</p>
<p><code> $ mock --root=fedora-16-x86_64 --resultdir=mockresults --init </code></p>
<p>The next step is to build the RPMs like before.  In this case, we already have an initialized chroot, so we need to tell mock not to create a new one.  We also need to tell mock not to clean up the chroot after the RPM builds are complete, because we want to perform more operations in there.</p>
<p><code> $ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
       --define="run_unit_tests 1" --no-clean --no-cleanup-after<br />
       --rebuild *.src.rpm </code></p>
<p>At this point, we have compiled the source, run the unit tests, and built RPMs.  The chroot used to do all of this is still there.  We can take the RPMs we just built and install them into the chroot.</p>
<p><code> $ mock --root=fedora-16-x86_64 --resultdir=mockresults --install mockresults/*.rpm </code></p>
<p>Now it&#8217;s time to set up the functional tests.  We need to install some dependencies for the tests and then copy the tests themselves into the chroot.</p>
<p><code> $ . src/tests/deps.sh<br />
$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
     --install ${MH_TESTS_DEPS}</p>
<p>$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
     --copyin src/tests /matahari-tests </code></p>
<p>The dependencies of the tests are installed in the chroot and the tests themselves have been copied in.  Now mock can be used to execute each set of tests.</p>
<p><code> $ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
    --shell "nosetests -v /matahari-tests/test_host_api.py"</p>
<p>$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
    --shell "nosetests -v /matahari-tests/test_sysconfig_api.py"</p>
<p>$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
    --shell "nosetests -v /matahari-tests/test_resource_api.py"</p>
<p>$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
    --shell "nosetests -v /matahari-tests/test_service_api_minimal.py"</p>
<p>$ mock --root=fedora-16-x86_64 --resultdir=mockresults<br />
    --shell "nosetests -v /matahari-tests/test_network_api_minimal.py" </code></p>
<p>That&#8217;s it!  The autobuild setup now tests compilation, unit tests, building RPMs, installing RPMs, and running and exercising all of the installed applications.  It&#8217;s fast, too.</p>
<p><strong>Final Thoughts</strong></p>
<p>As with most things, there are some areas for improvement.  For example, one glaring issue is that the entire setup is Fedora specific, or at least specific to a distribution that can use mock.  However, I have at least heard of a similar tool to mock called <a href="https://wiki.ubuntu.com/PbuilderHowto">pbuilder</a> for dpkg based distributions, which could potentially be used in a similar way.  I&#8217;m not sure.</p>
<p>There are also some issues with this approach specific to the Matahari project.  Matahari includes a set of agents that provide systems management APIs.  Testing of some of these APIs isn&#8217;t necessarily something you want to do on the same machine running the actual tests.  To expand to much more complete coverage of these APIs, we&#8217;re going to have to break down and adopt an approach of spinning up VMs to run the Matahari agents.  At that point, we may not run any of the functional tests from within mock anymore.</p>
<p>Mock is a very handy tool and it helped me to expand the automated build and test setup to get a lot more coverage in a shorter amount of time in a way that I was happy with.  I hope this writeup helps you think about some other things that you could do with it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=283&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2011/10/06/automated-testing-of-matahari-in-a-chroot-using-mock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>Matahari: Systems Management and Monitoring APIs</title>
		<link>http://russellbryantnet.wordpress.com/2011/08/27/matahari-systems-management-and-monitoring-apis/</link>
		<comments>http://russellbryantnet.wordpress.com/2011/08/27/matahari-systems-management-and-monitoring-apis/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 20:54:27 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[Matahari]]></category>

		<guid isPermaLink="false">http://www.russellbryant.net/blog/?p=279</guid>
		<description><![CDATA[I have been working at Red Hat for a few weeks now and have started getting some real work done. I wanted to share what I&#8217;m currently working on, and that is Matahari. Matahari is a cross-platform (Linux and Windows so far) collection of APIs accessible over local and remote interfaces for systems management and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=279&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have been working at Red Hat for a few weeks now and have started getting some real work done. I wanted to share what I&#8217;m currently working on, and that is <a href="http://www.matahariproject.org/">Matahari</a>. Matahari is a cross-platform (Linux and Windows so far) collection of APIs accessible over local and remote interfaces for systems management and monitoring. What the heck does that mean? Read on, dear friends.</p>
<p><strong>Architecture</strong></p>
<p>I mentioned that Matahari is a collection of APIs. These APIs are accessible via a few different methods. The core of the functionality that we are implementing is done as C libraries. These can be used directly. However, we expect and intend for most users to access the functionality via one of the agents we provide. A Matahari Agent is an application that provides access to the features implemented in a Matahari Library via some transport. We are currently providing agents for <a href="http://www.freedesktop.org/wiki/Software/dbus">D-Bus</a> and <a href="http://qpid.apache.org/">QMF</a>.</p>
<p>D-Bus is used quite heavily as a communications mechanism between applications on a single system. QMF, or the Qpid Management Framework, is used as a remote interface. QMF is a framework for building remote APIs on top of <a href="http://www.amqp.org/">AMQP</a>, an open protocol for messaging.</p>
<p>The agents are generally thin wrappers around a core library, so other transports could be added in the future if the need presents itself.</p>
<p><strong>Current Features</strong></p>
<p>So, what can you do with Matahari?</p>
<p>Matahari is still under heavy development, but there is already a decent amount of usable functionality.</p>
<ul>
<li><em>Host</em> &#8211; An agent for viewing and controlling hosts</li>
<ul>
<li>View basic host information such as OS, hostname, CPU, RAM, load average, and more.</li>
<li>Host control (shutdown, reboot)</li>
</ul>
<li><em>Networking</em> &#8211; An agent for viewing and controlling network devices</li>
<ul>
<li>Get a list of available network interfaces and information about them, such as IP and MAC addresses</li>
<li>Start and stop network interfaces</li>
</ul>
<li><em>Services</em> &#8211; An agent for viewing and controlling system services</li>
<ul>
<li>List configured services</li>
<li>Start and stop services</li>
<li>Monitor the status of services</li>
</ul>
<li><em>Sysconfig</em> &#8211; Modify system configuration</li>
<ul>
<li>Modify system configuration files (Linux)</li>
<li>Modify system registry (Windows)</li>
</ul>
</ul>
<p>More things that are in the works can be found on the project <a href="https://github.com/matahari/matahari/wiki/Backlog">backlog</a>.</p>
<p><strong>Use Cases</strong></p>
<p>An example of a project that already utilizes Matahari is <a href="http://pacemaker-cloud.org/">Pacemaker-cloud</a>, which is also under heavy development. Pacemaker-cloud utilizes both the Host and Services agents of Matahari. Being able to actively monitor and control services on remote hosts is a key element of being able to provide HA in a cloud deployment.</p>
<p>In addition to providing ready-to-use agents, we also provide some code that makes it easier to write a QMF agent so that third-parties can write their own Matahari agents. One example of this that already exists is <a href="http://libvirt.org/">libvirt-qmf</a>, which is a Matahari agent that exposes libvirt functionality over QMF.</p>
<p><strong>Join Us</strong></p>
<p>If Matahari interests you, follow us on <a href="https://github.com/matahari/matahari">github</a> and join our <a href="https://fedorahosted.org/mailman/listinfo/matahari">mailing list</a>.  Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=279&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2011/08/27/matahari-systems-management-and-monitoring-apis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>Taking On New Challenges</title>
		<link>http://russellbryantnet.wordpress.com/2011/07/18/taking-on-new-challenges/</link>
		<comments>http://russellbryantnet.wordpress.com/2011/07/18/taking-on-new-challenges/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 22:48:38 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://www.russellbryant.net/blog/?p=272</guid>
		<description><![CDATA[I began working on the Asterisk project in 2004.  My work on Asterisk has led to an exciting career in open source software engineering.  At the end of July 2011, I will be leaving Digium to take on some new challenges.  Specifically, I will be joining the Cloud Infrastructure team at Red Hat as a Principal Software Engineer where I [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=272&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I began working on the Asterisk project in 2004.  My work on Asterisk has led to an exciting career in open source software engineering.  At the end of July 2011, I will be leaving Digium to take on some new challenges.  Specifically, I will be joining the Cloud Infrastructure team at Red Hat as a Principal Software Engineer where I will be working on projects related to clustering, high availability, and systems management.  Additionally, I will be moving back to Charleston, SC to be closer to my family.</p>
<p>While I will no longer be working with Asterisk full time, I still plan to participate in the open source community.  I am excited to watch both Asterisk and Asterisk SCF continue to evolve and grow.  The engineering team at Digium, as well as the global Asterisk development community are as strong as they have ever been and will continue to accomplish big things.</p>
<p>I have met many great people from all over the world in my time with Asterisk.  Thank you all for making the past seven years so memorable.</p>
<p>Best Regards,</p>
<p>&#8211;<br />
Russell Bryant</p>
<p>&nbsp;</p>
<p>Related Posts:</p>
<ul>
<li><a href="http://blogs.digium.com/2011/07/18/russell-bryant-thank-you-for-seven-years-of-excellence/">blogs.digium.com</a></li>
<li><a href="http://www.venturevoip.com/news.php?rssid=2586">Asterisk Daily News</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=272&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2011/07/18/taking-on-new-challenges/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging the Asterisk Dialplan with Verbose()</title>
		<link>http://russellbryantnet.wordpress.com/2011/03/04/debugging-the-asterisk-dialplan-with-verbose/</link>
		<comments>http://russellbryantnet.wordpress.com/2011/03/04/debugging-the-asterisk-dialplan-with-verbose/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 14:02:53 +0000</pubDate>
		<dc:creator>russellbryant</dc:creator>
				<category><![CDATA[Asterisk]]></category>

		<guid isPermaLink="false">http://www.russellbryant.net/blog/?p=257</guid>
		<description><![CDATA[Leif Madsen and I are working on a new book, the Asterisk Cookbook. One of the recipes that I am working on this morning is a method of adding debug statements into the Asterisk dialplan. I came up with a GoSub() routine that can log messages based on log level settings that are global, per-device, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=257&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://leifmadsen.wordpress.com/">Leif Madsen</a> and I are working on a new book, the <a href="http://oreilly.com/catalog/0636920018551/">Asterisk Cookbook</a>. One of the recipes that I am working on this morning is a method of adding debug statements into the Asterisk dialplan.  I came up with a GoSub() routine that can log messages based on log level settings that are global, per-device, or per-channel.  Here&#8217;s a preview.  I hope you find it useful!</p>
<h3>Channel logging GoSub() routine.</h3>
<ul>
<li><strong>ARG1</strong> &#8211; Log level.</li>
<li><strong>ARG2</strong> &#8211; The log message.</li>
</ul>
<p>Channel logging using this routine will be sent to the Asterisk console at verbose level 0, meaning that they will show up when you want them to regardless of the current &#8220;core set verbose&#8221; setting.  This routine uses a different method, values in AstDB, to control what messages show up.</p>
<p><strong>AstDB entries:</strong></p>
<ul>
<li>Family: ChanLog/    Key: all</li>
<ul>
<li>If the log level is less than or equal to this value the message will be printed.</li>
</ul>
<li>Family: ChanLog/     Key: channels/</li>
<ul>
<li>This routine will also check for a channel specific debug setting.  It will actually check for both the full channel name as well as just the part of the channel name before &#8216;-&#8217;.  This allows setting a debug level for all calls from a particular device.  For example, a SIP channel may be &#8220;SIP/myphone-0011223344&#8243;.  This routine will check:</li>
<ul>
<li>Family: ChanLog/    Key: channels/SIP/myphone</li>
<li>Family: ChanLog/    Key: channels/SIP/myphone-0011223344</li>
</ul>
</ul>
</ul>
<p><strong>Example Dialplan Usage:</strong></p>
<pre>
exten =&gt; 7201,1,GoSub(chanlog,s,1(1,${CHANNEL} has called ${EXTEN}))
</pre>
<p><strong>Example of enabling debugging for a device from the Asterisk CLI:</strong></p>
<pre>
*CLI&gt; database put ChanLog SIP/myphone 3 
</pre>
<p><strong>chanlog routine implementation:</strong></p>
<pre>
[chanlog]

exten =&gt; s,1,GotoIf($[${DB_EXISTS(ChanLog/all)} = 0]?checkchan1)
    same =&gt; n,GotoIf($[${ARG1}  n(checkchan1),Set(KEY=ChanLog/channel/${CHANNEL})
    same =&gt; n,GotoIf($[${DB_EXISTS(${KEY})} = 0]?checkchan2)
    same =&gt; n,GotoIf($[${ARG1}  n(checkchan2),Set(KEY=ChanLog/channel/${CUT(CHANNEL,-,1)})
    same =&gt; n,GotoIf($[${DB_EXISTS(${KEY})} = 0]?return)
    same =&gt; n,GotoIf($[${ARG1}  n(return),Return() ; Return without logging
    same =&gt; n(log),Verbose(0,${ARG2})
    same =&gt; n,Return()
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/russellbryantnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/russellbryantnet.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=russellbryantnet.wordpress.com&#038;blog=35218887&#038;post=257&#038;subd=russellbryantnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://russellbryantnet.wordpress.com/2011/03/04/debugging-the-asterisk-dialplan-with-verbose/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/58f6efad5252a711e34840701dab7cde?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">russellbryant</media:title>
		</media:content>
	</item>
	</channel>
</rss>
