<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Ken Pepple</title>
 <link href="http://ken.pepple.info/atom.xml" rel="self"/>
 <link href="http://ken.pepple.info"/>
 <language>en</language>
 <updated>2013-02-17T14:10:40-08:00</updated>
 <id>http://ken.pepple.info/</id>
 <author>
   <name>Ken Pepple</name>
 </author>

 
 <entry>
   <title>OpenStack Folsom Architecture</title>
   <link href="http://ken.pepple.info/openstack/2012/09/25/openstack-folsom-architecture/"/>
   <updated>2012-09-25T00:00:00-07:00</updated>
   <id>BLOG_URL/openstack/2012/09/25/openstack-folsom-architecture</id>
   <content type="html">&lt;p&gt;&lt;em&gt;As the Folsom release of OpenStack is due to be released this week, I've taken the time to update my &quot;Intro to OpenStack Architecture 101&quot; for the official documentation. It &lt;a href=&quot;https://review.openstack.org/#/c/13566/2&quot;&gt;merged into the repos yesterday&lt;/a&gt; and below is an &lt;strong&gt;expanded&lt;/strong&gt; version of it.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;OpenStack Components&lt;/h2&gt;

&lt;p&gt;There are currently seven core components of OpenStack: Compute, Object Storage,
Identity, Dashboard, Block Storage, Network and Image Service. Let's look at
each in turn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object Store (codenamed &quot;&lt;a href=&quot;http://swift.openstack.org&quot;&gt;Swift&lt;/a&gt;&quot;) allows you to
store or retrieve files (but not mount directories like a fileserver). Several
companies provide commercial storage services based on Swift. These include
KT, Rackspace (from which Swift originated) and Internap. Swift is also used
internally at many large companies to store their data.&lt;/li&gt;
&lt;li&gt;Image (codenamed &quot;&lt;a href=&quot;http://glance.openstack.org&quot;&gt;Glance&lt;/a&gt;&quot;) provides a catalog
and repository for virtual disk images. These disk images are mostly commonly
used in OpenStack Compute. While this service is technically optional, any
cloud of size will require it.&lt;/li&gt;
&lt;li&gt;Compute (codenamed &quot;&lt;a href=&quot;http://nova.openstack.org/&quot;&gt;Nova&lt;/a&gt;&quot;) provides virtual
servers upon demand. &lt;a href=&quot;http://www.rackspace.com&quot;&gt;Rackspace&lt;/a&gt; and
&lt;a href=&quot;https://www.hpcloud.com/&quot;&gt;HP&lt;/a&gt; provide commercial compute services built on
Nova and it is used internally at companies like Mercado Libre and NASA (where
it originated).&lt;/li&gt;
&lt;li&gt;Dashboard (codenamed &quot;&lt;a href=&quot;http://horizon.openstack.org/&quot;&gt;Horizon&lt;/a&gt;&quot;) provides a
modular web-based user interface for all the OpenStack services. With this web
GUI, you can perform most operations on your cloud like launching an instance,
assigning IP addresses and setting access controls.&lt;/li&gt;
&lt;li&gt;Identity (codenamed &quot;&lt;a href=&quot;http://keystone.openstack.org/&quot;&gt;Keystone&lt;/a&gt;&quot;) provides
authentication and authorization for all the OpenStack services. It also
provides a service catalog of services within a particular OpenStack
cloud.&lt;/li&gt;
&lt;li&gt;Network (codenamed &quot;&lt;a href=&quot;http://quantum.openstack.org/&quot;&gt;Quantum&lt;/a&gt;&quot;) provides
&quot;network connectivity as a service&quot; between interface devices managed by other
OpenStack services (most likely Nova). The service works by allowing users to
create their own networks and then attach interfaces to them. Quantum has a
pluggable architecture to support many popular networking vendors and
technologies. &lt;strong&gt;Quantum is new in the Folsom release&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Block Storage (codenamed &quot;Cinder&quot;) provides persistent block storage to guest
VMs. This project was born from code originally in Nova (the &lt;code&gt;nova-volume&lt;/code&gt;
service described below). Please note that this is block storage (or volumes)
not filesystems like NFS or CIFS share. &lt;strong&gt;Cinder is new for the Folsom
  release&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In addition to these core projects, there are also a number of &quot;incubation&quot; projects that are being considered for future inclusion in the OpenStack core.&lt;/p&gt;

&lt;h2&gt;Comparison Against AWS&lt;/h2&gt;

&lt;p&gt;Although all of the OpenStack services are made to stand on their own, many users want some form of AWS compatibility for tools, APIs or just familiarity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nova is conceptually similar to EC2. In fact, there is are a variety of ways to provide EC2 API compatibility to it.&lt;/li&gt;
&lt;li&gt;Swift is conceptually similar to S3. It implements a subset of the S3 API in WSGI middleware.&lt;/li&gt;
&lt;li&gt;Glance provides many of the same features as Amazon's AMI catalog.&lt;/li&gt;
&lt;li&gt;Cinder provides block services similar to EBS.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conceptual Architecture&lt;/h2&gt;

&lt;p&gt;The OpenStack project as a whole is designed to &quot;deliver(ing) a massively
scalable cloud operating system.&quot; To achieve this, each of the constituent
services are designed to work together to provide a complete Infrastructure as a
Service (IaaS). This integration is facilitated through public application
programming interfaces (APIs) that each service offers (and in turn can
consume). While these APIs allow each of the services to use another service, it
also allows an implementer to switch out any service as long as they maintain
the API. These are (mostly) the same APIs that are available to end users of the
cloud.&lt;/p&gt;

&lt;p&gt;Conceptually, you can picture the relationships between the services as so:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://26a0ff8ca8ba32139f7d-db711c577a50b6bdc946ea71aaca027d.r97.cf1.rackcdn.com/openstack-conceptual-arch-folsom.jpg&quot;&gt;&lt;img src=&quot;http://26a0ff8ca8ba32139f7d-db711c577a50b6bdc946ea71aaca027d.r97.cf1.rackcdn.com/openstack-conceptual-arch-folsom.jpg&quot; alt=&quot;OpenStack Folsom Conceptual Architecture&quot; width=&quot;700px&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dashboard (&quot;Horizon&quot;) provides a web front end to the other OpenStack services&lt;/li&gt;
&lt;li&gt;Compute (&quot;Nova&quot;) stores and retrieves virtual disks (&quot;images&quot;) and associated
metadata in Image (&quot;Glance&quot;)&lt;/li&gt;
&lt;li&gt;Network (&quot;Quantum&quot;) provides virtual networking for Compute.&lt;/li&gt;
&lt;li&gt;Block Storage (&quot;Cinder&quot;) provides storage volumes for Compute.&lt;/li&gt;
&lt;li&gt;Image (&quot;Glance&quot;) can store the actual virtual disk files in the Object
Store(&quot;Swift&quot;)&lt;/li&gt;
&lt;li&gt;All the services authenticate with Identity (&quot;Keystone&quot;)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is a stylized and simplified view of the architecture, assuming that the
implementer is using all of the services together in the most common
configuration. It also only shows the &quot;operator&quot; side of the cloud -- it does
not picture how consumers of the cloud may actually use it. For example, many
users will access object storage heavily (and directly).&lt;/p&gt;

&lt;h2&gt;Logical Architecture&lt;/h2&gt;

&lt;p&gt;As you can imagine, the logical architecture is far more complicated than the
conceptual architecture shown above. As with any service-oriented architecture,
diagrams quickly become &quot;messy&quot; trying to illustrate all the possible
combinations of service communications. The diagram below, illustrates the most
common architecture of an OpenStack-based cloud. However, as OpenStack supports
a wide variety of technologies, it does not represent the only architecture
possible.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://26a0ff8ca8ba32139f7d-db711c577a50b6bdc946ea71aaca027d.r97.cf1.rackcdn.com/openstack-logical-arch-folsom.jpg&quot;&gt;&lt;img src=&quot;http://26a0ff8ca8ba32139f7d-db711c577a50b6bdc946ea71aaca027d.r97.cf1.rackcdn.com/openstack-logical-arch-folsom.jpg&quot; alt=&quot;OpenStack Folsom Logical Architecture&quot; width=&quot;700px&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This picture is consistent with the conceptual architecture above in that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End users can interact through a common web interface (Horizon) or directly to
each service through their API&lt;/li&gt;
&lt;li&gt;All services authenticate through a common source (facilitated through
Keystone)&lt;/li&gt;
&lt;li&gt;Individual services interact with each other through their public APIs (except
where privileged administrator commands are necessary)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In the sections below, we'll delve into the architecture for each of the
services.&lt;/p&gt;

&lt;h3&gt;Dashboard&lt;/h3&gt;

&lt;p&gt;Horizon is a modular &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django web application&lt;/a&gt;
that provides an end user and administrator interface to OpenStack services.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://xip-1077754327103.http.internapcdn.net/xip-1077754327103/blog/horizon-screenshot.jpg&quot; alt=&quot;OpenStack Horizon Screenshot&quot; width=&quot;700px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As with most web applications, the architecture is fairly simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Horizon is usually deployed via &lt;a href=&quot;http://code.google.com/p/modwsgi/&quot;&gt;mod_wsgi&lt;/a&gt;
in Apache. The code itself is separated into a reusable python module with
most of the logic (interactions with various OpenStack APIs) and presentation
(to make it easily customizable for different sites).&lt;/li&gt;
&lt;li&gt;A database (configurable as to which one). As it relies mostly on the other
services for data, it stores very little data of its own.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;From a network architecture point of view, this service will need to be customer
accessible as well as be able to talk to each service's public APIs. If you wish
to use the administrator functionality (i.e. for other services), it will also
need connectivity to their Admin API endpoints (which &lt;strong&gt;should not&lt;/strong&gt; be customer
accessible).&lt;/p&gt;

&lt;h3&gt;Compute&lt;/h3&gt;

&lt;p&gt;Nova is the most complicated and distributed component of OpenStack. A large
number of processes cooperate to turn end user API requests into running virtual
machines. Below is a list of these processes and their functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nova-api&lt;/code&gt; accepts and responds to end user compute API calls. It supports
OpenStack Compute API, Amazon's EC2 API and a special Admin API (for
privileged users to perform administrative actions). It also initiates most of
the orchestration activities (such as running an instance) as well as enforces
some policy (mostly quota checks).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-compute&lt;/code&gt; process is primarily a worker daemon that creates and
terminates virtual machine instances via hypervisor's APIs (XenAPI for
XenServer/XCP, libvirt for KVM or QEMU, VMwareAPI for VMware, etc.). The
process by which it does so is fairly complex but the basics are simple:
accept actions from the queue and then perform a series of system commands
(like launching a KVM instance) to carry them out while updating state in the
database.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nova-volume&lt;/code&gt; manages the creation, attaching and detaching of persistent
volumes to compute instances (similar functionality to Amazon’s Elastic Block
Storage). It can use volumes from a variety of providers such as iSCSI or
&lt;a href=&quot;http://ceph.newdream.net&quot;&gt;Rados Block Device in Ceph&lt;/a&gt;. A new OpenStack
projects, Cinder, will eventually replace &lt;code&gt;nova-volume&lt;/code&gt; functionality. In the
Folsom release, &lt;code&gt;nova-volume&lt;/code&gt; and the Block Storage service will have similar
functionality.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-network&lt;/code&gt; worker daemon is very similar to &lt;code&gt;nova-compute&lt;/code&gt; and
&lt;code&gt;nova-volume&lt;/code&gt;. It accepts networking tasks from the queue and then performs
tasks to manipulate the network (such as setting up bridging interfaces or
changing iptables rules). This functionality is being migrated to Quantum, a
separate OpenStack service. In the Folsom release, much of the functionality
will be duplicated between &lt;code&gt;nova-network&lt;/code&gt; and Quantum.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-schedule&lt;/code&gt; process is conceptually the simplest piece of code in
OpenStack Nova: take a virtual machine instance request from the queue and
determines where it should run (specifically, which compute server host it
should run on).&lt;/li&gt;
&lt;li&gt;The queue provides a central hub for passing messages between daemons. This is
usually implemented with &lt;a href=&quot;http://www.rabbitmq.com/&quot;&gt;RabbitMQ&lt;/a&gt; today, but could
be any AMPQ message queue (such as &lt;a href=&quot;http://qpid.apache.org/&quot;&gt;Apache Qpid&lt;/a&gt;).
New to the Folsom release is support for &lt;a href=&quot;http://www.zeromq.org/&quot;&gt;Zero MQ&lt;/a&gt;
(&lt;em&gt;note: I've only included this so that Eric Windisch won't be hounding me
mercilessly about it's omission&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;The SQL database stores most of the build-time and run-time state for a cloud
infrastructure. This includes the instance types that are available for use,
instances in use, networks available and projects. Theoretically, OpenStack
Nova can support any database supported by SQL-Alchemy but the only databases
currently being widely used are sqlite3 (only appropriate for test and
development work), MySQL and PostgreSQL.&lt;/li&gt;
&lt;li&gt;Nova also provides console services to allow end users to access their virtual
instance's console through a proxy. This involves several daemons
(&lt;code&gt;nova-console&lt;/code&gt;, &lt;code&gt;nova-vncproxy&lt;/code&gt; and &lt;code&gt;nova-consoleauth&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Nova interacts with many other OpenStack services: Keystone for authentication,
Glance for images and Horizon for web interface. The Glance interactions are
central. The API process can upload and query Glance while &lt;code&gt;nova-compute&lt;/code&gt; will
download images for use in launching images.&lt;/p&gt;

&lt;h3&gt;Object Store&lt;/h3&gt;

&lt;p&gt;The swift architecture is very distributed to prevent any single point of
failure as well as to scale horizontally. It includes the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proxy server (&lt;code&gt;swift-proxy-server&lt;/code&gt;) accepts incoming requests via
the OpenStack Object API or just raw HTTP. It accepts files to upload,
modifications to metadata or container creation. In addition, it will also
serve files or container listing to web browsers. The proxy server may utilize
an optional cache (usually deployed with memcache) to improve performance.&lt;/li&gt;
&lt;li&gt;Account servers manage accounts defined with the object storage service.&lt;/li&gt;
&lt;li&gt;Container servers manage a mapping of containers (i.e folders) within the
object store service.&lt;/li&gt;
&lt;li&gt;Object servers manage actual objects (i.e. files) on the storage nodes.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are also a number of periodic process which run to perform housekeeping
tasks on the large data store. The most important of these is the replication
services, which ensures consistency and availability through the cluster. Other
periodic processes include auditors, updaters and reapers.&lt;/p&gt;

&lt;p&gt;The object store can also serve static web pages and objects via HTTP. In fact, the diagrams in this blog post are being served out of Rackspace Cloud's Swift service.&lt;/p&gt;

&lt;p&gt;Authentication is handled through configurable WSGI middleware (which will
usually be Keystone).&lt;/p&gt;

&lt;h3&gt;Image Store&lt;/h3&gt;

&lt;p&gt;The Glance architecture has stayed relatively stable since the Cactus release.
The biggest architectural change has been the addition of authentication, which
was added in the Diablo release. Just as a quick reminder, Glance has four main
parts to it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;glance-api&lt;/code&gt; accepts Image API calls for image discovery, image retrieval and
image storage.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;glance-registry&lt;/code&gt; stores, processes and retrieves metadata about images (size,
type, etc.).&lt;/li&gt;
&lt;li&gt;A database to store the image metadata. Like Nova, you can choose your
database depending on your preference (but most people use MySQL or SQlite).&lt;/li&gt;
&lt;li&gt;A storage repository for the actual image files. In the diagram above, Swift
is shown as the image repository, but this is configurable. In addition to
Swift, Glance supports normal filesystems, RADOS block devices, Amazon S3 and
HTTP. Be aware that some of these choices are limited to read-only usage.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are also a number of periodic process which run on Glance to support
caching. The most important of these is the replication services, which ensures
consistency and availability through the cluster. Other periodic processes
include auditors, updaters and reapers.&lt;/p&gt;

&lt;p&gt;As you can see from the diagram in the Conceptual Architecture section, Glance
serves a central role to the overall IaaS picture. It accepts API requests for
images (or image metadata) from end users or Nova components and can store its
disk files in the object storage service, Swift.&lt;/p&gt;

&lt;h3&gt;Identity&lt;/h3&gt;

&lt;p&gt;Keystone provides a single point of integration for OpenStack policy, catalog,
token and authentication.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;keystone&lt;/code&gt; handles API requests as well as providing configurable
catalog, policy, token and identity services.&lt;/li&gt;
&lt;li&gt;Each Keystone function has a pluggable backend which allows different ways to
use the particular service. Most support standard backends like LDAP or SQL,
as well as Key Value Stores (KVS).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Most people will use this as a point of customization for their current
authentication services.&lt;/p&gt;

&lt;h3&gt;Network&lt;/h3&gt;

&lt;p&gt;Quantum provides &quot;network connectivity as a service&quot; between interface devices
managed by other OpenStack services (most likely Nova). The service works by
allowing users to create their own networks and then attach interfaces to them.
Like many of the OpenStack services, Quantum is highly configurable due to it's
plug-in architecture. These plug-ins accommodate different networking equipment
and software. As such, the architecture and deployment can vary dramatically. In
the above architecture, a simple Linux networking plug-in is shown.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;quantum-server&lt;/code&gt; accepts API requests and then routes them to the
appropriate quantum plugin for action.&lt;/li&gt;
&lt;li&gt;Quantum plugins and agents perform the actual actions such as plugging and
unplugging ports, creating networks or subnets and IP addressing. These
plugins and agents differ depending on the vendor and technologies used in the
particular cloud. Quantum ships with plugins and agents for: Cisco virtual and
physical switches, Nicira NVP product, NEC OpenFlow products, Open vSwitch,
Linux bridging and the Ryu Network Operating System. &lt;a href=&quot;https://github.com/midokura/midonet-openstack&quot;&gt;Midokua also provides a
plug-in for Quantum
integration&lt;/a&gt;. The common agents
are L3 (layer 3), DHCP (dynamic host IP addressing) and the specific plug-in
agent.&lt;/li&gt;
&lt;li&gt;Most Quantum installations will also make use of a messaging queue to route
information between the &lt;code&gt;quantum-server&lt;/code&gt; and various agents as well as a
database to store networking state for particular plugins.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Quantum will interact mainly with Nova, where it will provide networks and
connectivity for its instances.&lt;/p&gt;

&lt;h3&gt;Block Storage&lt;/h3&gt;

&lt;p&gt;Cinder separates out the persistent block storage functionality that was
previously part of Openstack Compute (in the form of &lt;code&gt;nova-volume&lt;/code&gt;) into it's own
service. The OpenStack Block Storage API allows for manipulation of volumes,
volume types (similar to compute flavors) and volume snapshots.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cinder-api&lt;/code&gt; accepts API requests and routes them to cinder-volume
for action.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cinder-volume&lt;/code&gt; acts upon the requests by reading or writing to the
Cinder database to maintain state, interacting with other processes (like
&lt;code&gt;cinder-scheduler&lt;/code&gt;) through a message queue and directly upon block
storage providing hardware or software. It can interact with a variety of
storage providers through a driver architecture. Currently, there are drivers
for IBM, SolidFire, NetApp, Nexenta, Zadara, linux iSCSI and other storage
providers.&lt;/li&gt;
&lt;li&gt;Much like &lt;code&gt;nova-scheduler&lt;/code&gt;, the &lt;code&gt;cinder-scheduler&lt;/code&gt; daemon picks the optimal
block storage provider node to create the volume on.&lt;/li&gt;
&lt;li&gt;Cinder deployments will also make use of a messaging queue to route
information between the cinder processes as well as a database to store volume
state.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Like Quantum, Cinder will mainly interact with Nova, providing volumes for its
instances.&lt;/p&gt;

&lt;h2&gt;Future Projects&lt;/h2&gt;

&lt;p&gt;A number of projects are in the work for future versions of OpenStack. They include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ceilometer&lt;/strong&gt; is a metering project. The project offers metering information
and the ability to code more ways to know what has happened on an OpenStack
cloud. While it provides metering, it is not a billing project. A full billing
solution requires metering, rating, and billing. Metering lets you know what
actions have taken place, rating enables pricing and line items, and billing
gathers the line items to create a bill to send to the consumer and collect
payment. Ceilometer is available as a preview.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heat&lt;/strong&gt; provides a REST API to orchestrate multiple cloud applications
implementing standards such as AWS CloudFormation.&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Revisiting OpenStack Architecture: Essex Edition</title>
   <link href="http://ken.pepple.info/openstack/2012/02/21/revisit-openstack-architecture-diablo/"/>
   <updated>2012-02-21T00:00:00-08:00</updated>
   <id>BLOG_URL/openstack/2012/02/21/revisit-openstack-architecture-diablo</id>
   <content type="html">&lt;p&gt;While it is still &lt;a href=&quot;http://wiki.openstack.org/EssexReleaseSchedule&quot;&gt;seven weeks until OpenStack &quot;Essex&quot; (2012.1) officially is released&lt;/a&gt;, release candidates are just around the corner. With this in mind, I thought it would be a good chance to revisit my earlier blog post on &lt;a href=&quot;http://ken.pepple.info/openstack/2011/04/22/openstack-nova-architecture/&quot;&gt;OpenStack Compute (&quot;Nova&quot;) architecture&lt;/a&gt;. This time around, instead of detailing the architecture of just a single service, I'll look at all the pieces of the OpenStack project working together.&lt;/p&gt;

&lt;p&gt;To level-set everyone's understanding, let's briefly review the OpenStack project components and history. Founded in 2010 by Rackspace and NASA, the project has &lt;a href=&quot;http://wiki.openstack.org/Releases&quot;&gt;released four versions&lt;/a&gt; and is set to release the fifth (&quot;Essex&quot; or 2012.1) &lt;a href=&quot;http://wiki.openstack.org/EssexReleaseSchedule&quot;&gt;in April&lt;/a&gt;. Originally, it consisted of a trio of &quot;core&quot; services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object Store (&lt;a href=&quot;http://swift.openstack.org&quot;&gt;&quot;Swift&quot;&lt;/a&gt;) provides object storage. It allows you to store or retrieve files (but not mount directories like a fileserver). Several companies provide commercial storage services based on Swift. These include KT, Rackspace (from which Swift originated) and my company   &lt;a href=&quot;http://www.internap.com/flexible-cloud-hosting-solutions/cloud-storage/&quot;&gt;Internap&lt;/a&gt;. In fact, the images for this blog post are being served via the Internap Swift implementation.&lt;/li&gt;
&lt;li&gt;Image (&lt;a href=&quot;http://glance.openstack.org&quot;&gt;&quot;Glance&quot;&lt;/a&gt;) provides a catalog and repository for virtual disk images. These disk images are mostly commonly used in OpenStack Compute. While this service is technically optional, any cloud of size will require it.&lt;/li&gt;
&lt;li&gt;Compute (&lt;a href=&quot;http://nova.openstack.org/&quot;&gt;&quot;Nova&quot;&lt;/a&gt;) provides virtual servers upon demand. Similar to Amazon's EC2 service, it also provides volume services analogous to Elastic Block Services (EBS). &lt;a href=&quot;http://www.internap.com/flexible-cloud-hosting-solutions/enterprise-public-cloud-solutions/open-public-cloud-solutions/&quot;&gt;Internap&lt;/a&gt; provide a commercial compute service built on Nova and it is used internally at &lt;a href=&quot;http://openstack.org/user-stories/mercadolibre-inc/&quot;&gt;Mercado Libre&lt;/a&gt; and NASA (where it originated).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The upcoming release promotes two new projects to &quot;core&quot; project status:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dashboard (&lt;a href=&quot;http://horizon.openstack.org/&quot;&gt;&quot;Horizon&quot;&lt;/a&gt;) provides a modular web-based user interface for all the OpenStack services.&lt;/li&gt;
&lt;li&gt;Identity (&lt;a href=&quot;http://keystone.openstack.org/&quot;&gt;&quot;Keystone&quot;&lt;/a&gt;) provides authentication and authorization for all the OpenStack services. It also provides a service catalog of services within a particular deployment.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;These new projects provide additional infrastructure to support the original three projects.&lt;/p&gt;

&lt;h1&gt;Conceptual Architecture&lt;/h1&gt;

&lt;p&gt;The OpenStack project as a whole is designed to &quot;deliver(ing) a massively scalable cloud operating system.&quot; To achieve this, each of the constituent services are designed to work together to provide a complete Infrastructure as a Service (IaaS). This integration is facilitated through public application programming interfaces (APIs) that each service offers (and in turn can consume). While these APIs allow each of the services to use another service, it also allows an implementer to switch out any service as long as they maintain the API. These are (mostly) the same APIs that are available to end users of the cloud.&lt;/p&gt;

&lt;p&gt;Conceptually, you can picture the relationships between the services as so:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://xip-1077754327103.http.internapcdn.net/xip-1077754327103/blog/nova-concept-int-essex.jpg&quot; alt=&quot;OpenStack Essex Conceptual Integration&quot; width=&quot;700px&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Horizon provides a web front end to the other OpenStack services&lt;/li&gt;
&lt;li&gt;Nova stores and retrieves virtual disks (&quot;images&quot;) and associated metadata in Glance&lt;/li&gt;
&lt;li&gt;Glance can store the actual virtual disk files in Swift&lt;/li&gt;
&lt;li&gt;All the services (&lt;em&gt;will eventually&lt;/em&gt;) authenticate with Keystone&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is a stylized and simplified view of the architecture, assuming that the implementer is using all of the services together in the most common configuration. It also only shows the &quot;operator&quot; side of the cloud -- it does not picture how consumers of the cloud may actually use it. For example, many compute users will use object storage heavily (and directly).&lt;/p&gt;

&lt;h1&gt;Logical Architecture&lt;/h1&gt;

&lt;p&gt;As you can imagine, the actual logical architecture is far more complicated than the conceptual architecture shown above. As with any service-oriented architecture, diagrams quickly become &quot;messy&quot; trying to illustrate all the possible combinations of service communications. In the diagram below, I illustrate what I believe will be the most common, &quot;integrated&quot; architecture of an OpenStack-based cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://xip-1077754327103.http.internapcdn.net/xip-1077754327103/blog/nova-logical-arch-essex.jpg&quot; target=&quot;blank&quot; &gt;&lt;img src=&quot;http://xip-1077754327103.http.internapcdn.net/xip-1077754327103/blog/nova-logical-arch-essex.jpg&quot; alt=&quot;OpenStack Essex Logical Architecture&quot; width=&quot;700px&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This picture is consistent with the description above in that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End users can interact through a common web interface (Horizon) or directly to each service through their API&lt;/li&gt;
&lt;li&gt;All services authenticate through a common source (facilitated through Keystone)&lt;/li&gt;
&lt;li&gt;Individual services interact with each other through their public APIs (except where privileged administrator commands are necessary)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In the sections below, we'll delve into the architecture for each of the services.&lt;/p&gt;

&lt;h2&gt;Dashboard&lt;/h2&gt;

&lt;p&gt;Horizon is a modular &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;Django web application&lt;/a&gt; that provides an end user and administrator interface to OpenStack services.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://xip-1077754327103.http.internapcdn.net/xip-1077754327103/blog/horizon-screenshot.jpg&quot; alt=&quot;OpenStack Horizon Screenshot&quot; width=&quot;700px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As with most web applications, the architecture is fairly simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Horizon is usually deployed via &lt;a href=&quot;http://code.google.com/p/modwsgi/&quot;&gt;mod_wsgi&lt;/a&gt; in Apache. The code itself is seperated into a reusable python module with most of the logic (interactions with various OpenStack APIs) and presentation (to make it easily customizable for different sites).&lt;/li&gt;
&lt;li&gt;A database (configurable to which one). As it relies mostly on the other services for data, it stores very little data of it's own.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;From a network architecture point of view, this service will need to customer accessible as well as be able to talk to each services public APIs. If you wish to use the administrator functionality (i.e. for other services), it will also need connectivity to their Admin API endpoints (which should be non-customer accessible).&lt;/p&gt;

&lt;h2&gt;Compute&lt;/h2&gt;

&lt;p&gt;Not much has really changed with Nova's architecture. They have added a few new helper services for EC2 compatibility and console services.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nova-api&lt;/code&gt; accepts and responds to end user compute and volume API calls. It supports OpenStack API, Amazon's EC2 API and a special Admin API (for privileged users to perform administrative actions). It also initiates most of the orchestration activities (such as running an instance) as well as enforces some policy (mostly quota checks). In the Essex release, nova-api has been modularized, allowing for implementers to run only specific APIs.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-compute&lt;/code&gt; process is primarily a worker daemon that creates and terminates virtual machine instances via hypervisor's APIs (XenAPI for XenServer/XCP, libvirt for KVM or QEMU, VMwareAPI for VMware, etc.). The process by which it does so is fairly complex but the basics are simple: accept actions from the queue and then perform a series of system commands (like launching a KVM instance) to carry them out while updating state in the database.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nova-volume&lt;/code&gt; manages the creation, attaching and detaching of persistent volumes to compute instances (similar functionality to Amazon’s Elastic Block Storage). It can use volumes from a variety of providers such as iSCSI or &lt;a href=&quot;http://ceph.newdream.net/&quot;&gt;Rados Block Device in Ceph&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-networ&lt;/code&gt;k worker daemon is very similar to &lt;code&gt;nova-compute&lt;/code&gt; and &lt;code&gt;nova-volume&lt;/code&gt;. It accepts networking tasks from the queue and then performs tasks to manipulate the network (such as setting up bridging interfaces or changing iptables rules).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;nova-schedule&lt;/code&gt; process is conceptually the simplest piece of code in OpenStack Nova: take a virtual machine instance request from the queue and determines where it should run (specifically, which compute server host it should run on).&lt;/li&gt;
&lt;li&gt;The queue provides a central hub for passing messages between daemons. This is usually implemented with &lt;a href=&quot;http://www.rabbitmq.com/&quot;&gt;RabbitMQ&lt;/a&gt; today, but could be any AMPQ message queue (such as &lt;a href=&quot;http://qpid.apache.org/&quot;&gt;Apache Qpid&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The SQL database stores most of the build-time and run-time state for a cloud infrastructure. This includes the instance types that are available for use, instances in use, networks available and projects. Theoretically, OpenStack Nova can support any database supported by SQL-Alchemy but the only databases currently being widely used are sqlite3 (only appropriate for test and development work), MySQL and PostgreSQL.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;During the last two releases, Nova has augmented it's console services. Console services allow end users to access their virtual instance's console through a proxy. This involves a pair of new daemons (nova-console and nova-consoleauth).&lt;/p&gt;

&lt;p&gt;Nova interacts with all of the usual suspects: Keystone for authentication, Glance for images and Horizon for web interface. The Glance interacts is interesting, though. The API process can upload and query Glance while nova-compute will download images for use in launching images.&lt;/p&gt;

&lt;h2&gt;Object Store&lt;/h2&gt;

&lt;p&gt;The swift architecture is very distributed to prevent any single point of failure as well as to scale horizontally. It includes the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proxy server accepts incoming requests via the OpenStack Object API or just raw HTTP. It accepts files to upload, modifications to metadata or container creation. In addition, it will also serve files or container listing to web browsers. The proxy server may utilize an optional cache (usually deployed with memcache) to improve performance.&lt;/li&gt;
&lt;li&gt;Account servers manage accounts defined with the object storage service.&lt;/li&gt;
&lt;li&gt;Container servers manage a mapping of containers (i.e folders) within the object store service.&lt;/li&gt;
&lt;li&gt;Object servers manage actual objects (i.e. files) on the storage nodes.&lt;/li&gt;
&lt;li&gt;There are also a number of periodic process which run to perform housekeeping tasks on the large data store. The most important of these is the replication services, which ensures consistency and availability through the cluster. Other periodic processes include auditors, updaters and reapers.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Authentication is handled through configurable WSGI middleware (which will usually be Keystone).&lt;/p&gt;

&lt;h2&gt;Image Store&lt;/h2&gt;

&lt;p&gt;The Glance architecture has stayed relatively stable since the Cactus release. The biggest architectural change has been the addition of authentication, which was added in the Diablo release. Just as a quick reminder, Glance has four main parts to it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;glance-api&lt;/code&gt; accepts Image API calls for image discovery, image retrieval and image storage&lt;/li&gt;
&lt;li&gt;&lt;code&gt;glance-registry&lt;/code&gt; stores, processes and retrieves metadata about images (size, type, etc.)&lt;/li&gt;
&lt;li&gt;A database to store the image metadata. Like Nova, you can choose your database depending on your preference (but most people use MySQL or SQlite).&lt;/li&gt;
&lt;li&gt;A storage repository for the actual image files. In the diagram, I have shown the most likely configuration (using Swift as the image repository), but this is configurable. In addition to Swift, Glance supports normal filesystems, RADOS block devices, Amazon S3 and HTTP. Be aware that some of these choices are limited to read-only usage.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are also a number of periodic process which run on Glance to support caching. The most important of these is the replication services, which ensures consistency and availability through the cluster. Other periodic processes include auditors, updaters and reapers.&lt;/p&gt;

&lt;p&gt;As you can see from the diagram, Glance serves a central role to the overall IaaS picture. It accepts API requests for images (or image metadata) from end users or Nova components and can store it's disk files in&lt;/p&gt;

&lt;h2&gt;Identity&lt;/h2&gt;

&lt;p&gt;Keystone provides a single point of integration for OpenStack policy, catalog, token and authentication.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keystone handles API requests as well as providing configurable catalog, policy, token and identity services.&lt;/li&gt;
&lt;li&gt;Each keystone function has a pluggable backend which allows different ways to use the particular service. Most support standard backends like LDAP or SQL, as well as Key Value Stores (KVS).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Most people will use this as a point of customization for their current authentication services.&lt;/p&gt;

&lt;h2&gt;Future Projects&lt;/h2&gt;

&lt;p&gt;This completes the tour of the OpenStack Essex architecture. However, OpenStack will not be stopping here - the following OpenStack release (&quot;Folsom&quot;) &lt;a href=&quot;http://eavesdrop.openstack.org/meetings/openstack-meeting/2012/openstack-meeting.2012-02-21-19.59.html&quot;&gt;will welcome another core service to the fold&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network (&lt;a href=&quot;http://docs.openstack.org/incubation/openstack-network/admin/content/&quot;&gt;Quantum&lt;/a&gt;) provides &quot;network connectivity as a service&quot; between interface devices managed by other Openstack services (most likely Nova). The service works by allowing users to create their own networks and then attach interfaces to them.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Although the &lt;a href=&quot;http://www.openstack.org/conference/san-francisco-2012/&quot;&gt;release schedule for Folsom&lt;/a&gt; is not yet set (probably Fall 2012), I won't wait six months to update the picture for this.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>OpenStack Has A Mascot: The "Tenrec" Book</title>
   <link href="http://ken.pepple.info/openstack/2011/08/05/openstack-book/"/>
   <updated>2011-08-05T00:00:00-07:00</updated>
   <id>BLOG_URL/openstack/2011/08/05/openstack-book</id>
   <content type="html">&lt;div style=&quot;float:right;&quot; markdown=&quot;1&quot;&gt;
  &lt;a href=&quot;http://oreilly.com/catalog/9781449311056/&quot; target=&quot;_blank&quot;&gt;
    &lt;img src=&quot;/images/tenrec.jpg&quot;&gt;
    &lt;/a&gt; 
&lt;/div&gt;


&lt;p&gt;You may have noticed that I have not posted anything in the last two months. And as you have probably guessed, it was because I was busy working on something else.&lt;/p&gt;

&lt;p&gt;That &quot;something else&quot; was writing &lt;a href=&quot;http://oreilly.com/catalog/9781449311056/&quot;&gt;&quot;Deploying OpenStack&quot;&lt;/a&gt; for O'Reilly Media.&lt;/p&gt;

&lt;p&gt;The book is intended to provide an introduction to the OpenStack project (Glance, Swift and Nova) &quot;Cactus&quot; release, an architectural overview of each component and some best practices for their deployment. In particular, we wanted to go beyond the documentation to arm readers with information to make smart decisions for their installations. However, we also went step by step to describe the installation process using normal packages as well as the StackOps distribution. Here are the chapter listings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The OpenStack Project&lt;/li&gt;
&lt;li&gt;Understanding Swift&lt;/li&gt;
&lt;li&gt;Understanding Glance&lt;/li&gt;
&lt;li&gt;Understanding Nova&lt;/li&gt;
&lt;li&gt;Obtaining Nova&lt;/li&gt;
&lt;li&gt;Planning Nova Deployment&lt;/li&gt;
&lt;li&gt;Installing Nova (via packages and &lt;a href=&quot;http://www.stackops.com/&quot;&gt;StackOps&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Using Nova&lt;/li&gt;
&lt;li&gt;Administering Nova&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;However, this book is not &quot;&lt;em&gt;OpenStack: The Definitive Guide&lt;/em&gt;&quot; or any such tome:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is a relatively short 80 pages.&lt;/li&gt;
&lt;li&gt;It is also very heavily weighted towards Nova. That is not to say that we don't cover Swift or Glance, just not to the same level of detail. For example, we don't cover Swift installation, while we devote an entire chapter to Nova's installation.&lt;/li&gt;
&lt;li&gt;It only documents a single node installation in two controlled ways. It doesn't cover every hardware variation or deployment scenario.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Most importantly, OpenStack now has an mascot. The humble tailless tenrec is an African mammal similar to hedgehogs (I prefer to believe that the cover picture is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Greater_Hedgehog_Tenrec&quot;&gt;Greater Hedgehog Tenrec&lt;/a&gt;). Please commence creating  &lt;a href=&quot;http://www.thinkgeek.com/geektoys/plush/e5ac/&quot;&gt;plushy&lt;/a&gt; &lt;a href=&quot;http://www.thinkgeek.com/geektoys/plush/288e/&quot;&gt;toys&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are interested in this book, &lt;em&gt;I would highly recommend getting the Ebook version&lt;/em&gt;. It is cheaper, it comes in almost any format (&lt;a href=&quot;http://oreilly.com/store/ebooks.html&quot;&gt;ePub, Mobi, PDF&lt;/a&gt;) and it will be updated. &lt;strong&gt;Yes, updated&lt;/strong&gt;. You will see additional content come out for it, as it is written. For anyone that has been following the OpenStack community, you will realize that the code changes quickly.&lt;/p&gt;

&lt;p&gt;I also wanted to send big thanks to my technical reviewers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Josh Kearney (&lt;a href=&quot;http://jk0.org/&quot;&gt;jk0&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Diego Parrilla (CEO of &lt;a href=&quot;http://www.stackops.com/&quot;&gt;StackOps&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Brian Pepple (former chairman of the &lt;a href=&quot;http://fedoraproject.org/wiki/Development/SteeringCommittee&quot;&gt;Fedora Engineering Steering Committee&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Su-hyung &quot;Nick&quot; Lee&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Their expertise made the book immeasurably better.&lt;/p&gt;

&lt;p&gt;Oh yeah, &lt;a href=&quot;http://oreilly.com/catalog/9781449311056/&quot;&gt;you can buy it here&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Finding Your OpenStack Nova version</title>
   <link href="http://ken.pepple.info/openstack/2011/04/30/openstack-nova-version/"/>
   <updated>2011-04-30T00:00:00-07:00</updated>
   <id>BLOG_URL/openstack/2011/04/30/openstack-nova-version</id>
   <content type="html">&lt;p&gt;&lt;em&gt;I just got back from the &lt;a href=&quot;http://summit.openstack.org/&quot;&gt;OpenStack Developers Summit&lt;/a&gt; and while I am still trying to compile my thoughts on the event, I thought I'd dash off this little tidbit:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A slight annoyance in administering (and troubleshooting) OpenStack Nova is identifying your installed version. This information is actually readily (i.e. programmatically) available within the code (&lt;em&gt;and logged at the beginning of most logfiles&lt;/em&gt;), but we hadn't exposed it to administrators on the command line until &lt;a href=&quot;http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/revision/1036&quot;&gt;Nova trunk revision #1036&lt;/a&gt;. With this change, you can now simply type &lt;span class=&quot;code-inline&quot;&gt;nova-manage version list&lt;/span&gt; to find which OpenStack Nova version is installed. For example:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage version list
2011.3-dev &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2011.3-workspace:tarmac-20110428165803-elcz2wp2syfzvxm8&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As you can probably guess, this machine is installed with a post-Cactus / pre-Diablo version of Nova (&quot;2011.3-dev&quot;) from the ppa:trunk packages (&quot;tarmac-20110428165803&quot;). Final released versions will report non-dev version numbers like &lt;code&gt;2011.1&lt;/code&gt; (Bexar), &lt;code&gt;2011.2&lt;/code&gt; (Cactus) or &lt;code&gt;2011.3&lt;/code&gt; (upcoming Diablo). Releases from Launchpad's ppa/trunk or ppa/release repositories will report &quot;tarmac&quot; in the string.&lt;/p&gt;

&lt;p&gt;For those who aren't following Nova trunk (cutting edge builds) or wanting to understand this deeper: In &lt;a href=&quot;http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/view/head:/nova/version.py&quot;&gt;nova/version.py&lt;/a&gt; there are two methods, &lt;code&gt;version_string()&lt;/code&gt; and &lt;code&gt;version_string_with_vcs()&lt;/code&gt;. You can see their use here in the python shell:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nova&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;manage&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shell&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;python&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Python&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;2.6&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r266&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;84292&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Sep&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2010&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;22&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GCC&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;4.4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;linux2&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Type&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;help&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;copyright&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;credits&amp;quot;&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;license&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;more&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;information&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;InteractiveConsole&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;nova&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;version_string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;&amp;#39;2011.3-dev&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;version_string_with_vcs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;u&amp;#39;2011.3-workspace:tarmac-20110428165803-elcz2wp2syfzvxm8&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;code&gt;version_string()&lt;/code&gt; pulls info straight from constants in the source code while &lt;code&gt;version_string_with_vcs()&lt;/code&gt; is generated at package creation time in the setup.py file (which basically writes the &lt;code&gt;nova/vcsversion.py&lt;/code&gt; file with &lt;span class=&quot;code-inline&quot;&gt;bzr version-info --python&lt;/span&gt; output). Unless you have run setup.py (such as when you are developing a local branch), you'll just see &lt;code&gt;2011.3-LOCALBRANCH:LOCALREVISION&lt;/code&gt; as your &lt;code&gt;vcsversion&lt;/code&gt; string.&lt;/p&gt;

&lt;p&gt;I am working on adding more diagnostic, operational support features for Diablo (service versions, flag state, etc.) and will post as they merge into OpenStack Nova trunk.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>OpenStack Nova Architecture</title>
   <link href="http://ken.pepple.info/openstack/2011/04/22/openstack-nova-architecture/"/>
   <updated>2011-04-22T00:00:00-07:00</updated>
   <id>BLOG_URL/openstack/2011/04/22/openstack-nova-architecture</id>
   <content type="html">&lt;p&gt;&lt;b&gt;NOTE&lt;/b&gt;: &lt;i&gt;I've updated and expanded this blog post for the Folsom release. &lt;a href=&quot;/openstack/2012/09/25/openstack-folsom-architecture/&quot;&gt;Click here to read the updated version&lt;/a&gt;.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;One of the common refrains I hear from people getting started with &lt;a href=&quot;http://www.openstack.org/&quot;&gt;OpenStack&lt;/a&gt; is the lack of good introductory architectural overviews of the project. I was confronted by the same problem when I first started with the project - it was easy to get the low level code and API documentation but it was very difficult to find a “lay of the land”-type overview. Now that &lt;a href=&quot;http://www.openstack.org/blog/2011/04/openstack-announces-cactus-release/&quot;&gt;Cactus&lt;/a&gt; (OpenStack’s third version) has been released, I thought I’d take advantage of the lull in development to write up a quick architectural overview from my point of view. Since OpenStack is a fairly broad topic, I’ll break my thoughts into several posts. Today’s post will deal with OpenStack Nova’s (compute cloud) high level architecture. &lt;/p&gt;

&lt;p&gt;Before we dive into the conceptual and logic architecture, let’s take a second to explain the OpenStack project: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;OpenStack is a collection of open source technologies delivering a massively scalable cloud operating system.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can think of it as software to power your own Infrastructure as a Service (IaaS) offering like &lt;a href=&quot;http://aws.amazon.com&quot;&gt;Amazon Web Services&lt;/a&gt;. It currently encompasses three main projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://launchpad.net/swift&quot;&gt;Swift&lt;/a&gt; which provides object/blob storage. This is roughly analogous to Rackspace Cloud Files (from which it is derived) or Amazon S3.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://launchpad.net/glance&quot;&gt;Glance&lt;/a&gt; which provides discovery, storage and retrieval of virtual machine images for OpenStack Nova.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://launchpad.net/nova&quot;&gt;Nova&lt;/a&gt; which provides virtual servers upon demand. This is similar to Rackspaces Cloud Servers or Amazon EC2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While these three projects provide the core of the cloud infrastructure, OpenStack is open and evolving — &lt;a href=&quot;http://wiki.openstack.org/Projects&quot;&gt;there will be more projects&lt;/a&gt; (there are already related projects for &lt;a href=&quot;https://launchpad.net/openstack-dashboard&quot;&gt;web interfaces&lt;/a&gt; and a &lt;a href=&quot;http://wiki.openstack.org/QueueService&quot;&gt;queue service&lt;/a&gt;). With that brief introduction, let’s delve into a conceptual architecture and then examine how OpenStack Nova could map to it.  &lt;/p&gt;

&lt;h1 id=&quot;cloudproviderconceptualarchitecture&quot;&gt;Cloud Provider Conceptual Architecture&lt;/h1&gt;

&lt;p&gt;Imagine that we are going to build our own IaaS cloud and offer it to customers. To achieve this, we would need to provide several high level features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Allow application owners to register for our cloud services, view their usage and see their bill (basic customer relations management functionality)&lt;/li&gt;
&lt;li&gt;Allow Developers/DevOps folks to create and store custom images for their applications (basic build-time functionality)&lt;/li&gt;
&lt;li&gt;Allow DevOps/Developers to launch, monitor and terminate instances (basic run-time functionality)&lt;/li&gt;
&lt;li&gt;Allow the Cloud Operator to configure and operate the cloud infrastructure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While there are certainly many, many other features that we would need to offer (especially if we were to follow are more complete industry framework like &lt;a href=&quot;http://www.tmforum.org/BusinessProcessFramework/1647/home.html&quot;&gt;eTOM&lt;/a&gt;), these four get to the very heart of providing IaaS. Now assuming that you agree with these four top level features, you might put together a conceptual architecture that looks something like this:&lt;/p&gt;

&lt;p&gt;&lt;img id=&quot;iaasconceptualarchitecture&quot; src=&quot;http://c204396.r96.cf1.rackcdn.com/nova-cactus-conceptual.gif&quot; alt=&quot;IaaS Conceptual Architecture&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In this model, I’ve imagined four sets of users (developers, devops, owners and operators) that need to interact with the cloud and then separated out the functionality needed for each. From there, I’ve followed a pretty common tiered approach to the architecture (presentation, logic and resources) with two orthogonal areas (integration and management). Let’s explore each a little further:    &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As with presentation layers in more typical application architectures, components here interact with users to accept and present information. In this layer, you will find web portals to provide graphical interfaces for non-developers and API endpoints for developers. For more advanced architectures, you might find load balancing, console proxies, security and naming services present here also.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The logic tier would provide the intelligence and control functionality for our cloud. This tier would house orchestration (workflow for complex tasks), scheduling (determining mapping of jobs to resources), policy (quotas and such) , image registry (metadata about instance images), logging (events and metering).    &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There will need to integration functions within the architecture. It is assumed that most service providers will already have a customer identity and billing systems. Any cloud architecture would need to integrate with these systems.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As with any complex environment, we will need a management tier to operate the environment. This should include an API to access the cloud administration features as well as some forms of monitoring. It is likely that the monitoring functionality will take the form of integration into an existing tool. While I’ve highlighted monitoring and an admin API for our fictional provider, in a more complete architecture you would see a vast array of operational support functions like provisioning and configuration management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, since this is a compute cloud, we will need actual compute, network and storage resources to provide to our customers. This tier provides these services, whether they be servers, network switches, network attached storage or other resources.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this model in place, let’s shift gears and look at OpenStack Nova’s logical architecture.&lt;/p&gt;

&lt;h1 id=&quot;openstacknovalogicalarchitecture&quot;&gt;OpenStack Nova Logical Architecture&lt;/h1&gt;

&lt;p&gt;Now that we’ve looked at a proposed conceptual architecture, let’s see how OpenStack Nova is logically architected. Since Cactus is the newest release, I will concentrate there (which means if you are viewing this after around July 2011, this will be out of date). There are several logical components of OpenStack Nova architecture but the majority of these components are custom written python daemons of two varieties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WSGI applications to receive and mediate API calls (&lt;span class=&quot;code-inline&quot;&gt;nova-api&lt;/span&gt;, &lt;span class=&quot;code-inline&quot;&gt;glance-api&lt;/span&gt;, etc.)&lt;/li&gt;
&lt;li&gt;Worker daemons to carry out orchestration tasks (&lt;span class=&quot;code-inline&quot;&gt;nova-compute&lt;/span&gt;, &lt;span class=&quot;code-inline&quot;&gt;nova-network&lt;/span&gt;, &lt;span class=&quot;code-inline&quot;&gt;nova-schedule&lt;/span&gt;, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, there are two essential pieces of the logical architecture are neither custom written nor Python based: the messaging queue and the database. These two components facilitate the asynchronous orchestration of complex tasks through message passing and information sharing.
Putting this all together we get a picture like this:&lt;/p&gt;

&lt;p&gt;&lt;img id=&quot;openstacknovalogicalarchitecture&quot; src=&quot;http://c204396.r96.cf1.rackcdn.com/nova-cactus-logical.gif&quot; alt=&quot;OpenStack Nova Logical Architecture&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This complicated, but not overly informative, diagram as it can be summed up in three sentences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;End users (DevOps, Developers and even other OpenStack components) talk to &lt;span class=&quot;code-inline&quot;&gt;nova-api&lt;/span&gt; to interface with OpenStack Nova&lt;/li&gt;
&lt;li&gt;OpenStack Nova daemons exchange info through the queue (actions) and database (information) to carry out API requests&lt;/li&gt;
&lt;li&gt;OpenStack Glance is basically a completely separate infrastructure which OpenStack Nova interfaces through the Glance API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we see the overview of the processes and their interactions, let’s take a closer look at each component.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;span class=&quot;code-inline&quot;&gt;nova-api&lt;/span&gt; daemon is the heart of the OpenStack Nova. You may see it illustrated on many pictures of OpenStack Nova as API and “Cloud Controller”. While this is partly true, cloud controller is really just a class (specifically the CloudController in trunk/nova/api/ec2/cloud.py) within the &lt;span class=&quot;code-inline&quot;&gt;nova-api&lt;/span&gt; daemon. It provides an endpoint for all API queries (either &lt;a href=&quot;http://docs.rackspacecloud.com/api/&quot;&gt;OpenStack API&lt;/a&gt; or &lt;a href=&quot;http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/&quot;&gt;EC2 API&lt;/a&gt;), initiates most of the orchestration activities (such as running an instance) and also enforces some policy (mostly quota checks).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;span class=&quot;code-inline&quot;&gt;nova-schedule&lt;/span&gt; process is conceptually the simplest piece of code in OpenStack Nova: take a virtual machine instance request from the queue and determines where it should run (specifically, which compute server host it should run on). In practice however, I am sure this will grow to be the most complex as it needs to factor in current state of the entire cloud infrastructure and apply complicated algorithm to ensure efficient usage. To that end, &lt;span class=&quot;code-inline&quot;&gt;nova-schedule&lt;/span&gt; implements a pluggable architecture that let’s you choose (or write) your own algorithm for scheduling. Currently, there are several to choose from (simple, chance, etc) and it is a area of hot development for the future releases of OpenStack Nova.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;span class=&quot;code-inline&quot;&gt;nova-compute&lt;/span&gt; process is primarily a worker daemon that creates and terminates virtual machine instances. The process by which it does so is fairly complex (&lt;a href=&quot;http://www.laurentluce.com/?p=227&quot;&gt;see this blog post by Laurence Luce for the gritty details&lt;/a&gt;) but the basics are simple: accept actions from the queue and then perform a series of system commands (like launching a KVM instance) to carry them out while updating state in the database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As you can gather by the name, &lt;span class=&quot;code-inline&quot;&gt;nova-volume&lt;/span&gt; manages the creation, attaching and detaching of persistent volumes  to compute instances (similar functionality to &lt;a href=&quot;http://aws.amazon.com/ebs/&quot;&gt;Amazon’s Elastic Block Storage&lt;/a&gt;).  It can use volumes from a variety of providers such as iSCSI or AoE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;span class=&quot;code-inline&quot;&gt;nova-network&lt;/span&gt; worker daemon is very similar to &lt;span class=&quot;code-inline&quot;&gt;nova-compute&lt;/span&gt; and &lt;span class=&quot;code-inline&quot;&gt;nova-volume&lt;/span&gt;. It accepts networking tasks from the queue and then performs tasks to manipulate the network (such as setting up bridging interfaces or changing &lt;span class=&quot;code-inline&quot;&gt;iptables&lt;/span&gt; rules). &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The queue provides a central hub for passing messages between daemons. This is currently implemented with &lt;a href=&quot;http://www.rabbitmq.com/&quot;&gt;RabbitMQ&lt;/a&gt; today, but theoretically could be any &lt;a href=&quot;http://www.amqp.org/confluence/display/AMQP/Advanced+Message+Queuing+Protocol&quot;&gt;AMPQ message queue&lt;/a&gt; supported by the python &lt;a href=&quot;http://barryp.org/software/py-amqplib/&quot;&gt;ampqlib&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/SQL&quot;&gt;SQL database&lt;/a&gt; stores most of the build-time and run-time state for a cloud infrastructure. This includes the instance types that are available for use, instances in use, networks available and projects. Theoretically, OpenStack Nova can support any database supported by &lt;a href=&quot;http://www.sqlalchemy.org/&quot;&gt;SQL-Alchemy&lt;/a&gt; but the only databases currently being widely used are &lt;a href=&quot;http://www.sqlite.org/&quot;&gt;sqlite3&lt;/a&gt; (only appropriate for test and development work), &lt;a href=&quot;http://mysql.com/&quot;&gt;MySQL&lt;/a&gt; and &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OpenStack Glance is a separate project from OpenStack Nova, but as shown above, complimentary. While it is an optional part of the overall compute architecture, I can’t imagine that most OpenStack Nova installation will not be using it (or a complimentary product). There are three pieces to Glance: &lt;span class=&quot;code-inline&quot;&gt;glance-api&lt;/span&gt;, &lt;span class=&quot;code-inline&quot;&gt;glance-registry&lt;/span&gt; and the image store. As you can probably guess, &lt;span class=&quot;code-inline&quot;&gt;glance-api&lt;/span&gt; accepts API calls, much like &lt;span class=&quot;code-inline&quot;&gt;nova-api&lt;/span&gt;, and the actual image blobs are placed in the image store. The &lt;span class=&quot;code-inline&quot;&gt;glance-registry&lt;/span&gt; stores and retrieves metadata about images. The image store can be a number of different object stores, including OpenStack Swift.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, another optional project that we will need for our fictional service provider is an user dashboard. I have picked the OpenStack Dashboard here, but there are also several other web front ends available for OpenStack Nova. The OpenStack Dashboard provides a web interface into OpenStack Nova to give application developers and devops staff  similar functionality to the API. It is currently implemented as a &lt;a href=&quot;http://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt; web application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This logical architecture represents just one way to architect OpenStack Nova. With it’s pluggable architecture, we could easily swap out OpenStack Glance with another image service or use another dashboard. In the coming releases of OpenStack, expect to see more modularization of the code especially in the network and volume areas.&lt;/p&gt;

&lt;h1 id=&quot;novaconceptualmapping&quot;&gt;Nova Conceptual Mapping&lt;/h1&gt;

&lt;p&gt;Now that we’ve seen a conceptual architecture for a fictional cloud provider and examined the logical architecture of OpenStack Nova, it is fairly easy to map the OpenStack components to the conceptual areas to see what we are lacking:&lt;/p&gt;

&lt;p&gt;&lt;img id=&quot;openstacknovaconceptualcoverage&quot; src=&quot;http://c204396.r96.cf1.rackcdn.com/nova-cactus-conceptual-coverage.gif&quot; alt=&quot;OpenStack Nova conceptual coverage&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As you can see from the illustration, I’ve overlaid logical components of OpenStack Nova, Glance and Dashboard to denote functional coverage. For each of the overlays, I’ve added the name of the logical component within the project that provides the functionality. While all of these judgements are highly subjective, you can see that we have a majority coverage of the functional areas with a few notable exceptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The largest gap in our functional coverage is logging and billing. At the moment, OpenStack Nova doesn’t have a billing component that can mediate logging events, rate the logs and create/present bills. That being said, most service providers will already have one (or &lt;em&gt;many&lt;/em&gt;) of these so the focus is really on the logging and integration with billing. This could be remedied in a variety of ways: augmentations of the code (which should happen in the next release “Diablo”), integration with commercial products or services (perhaps &lt;a href=&quot;http://www.zuora.com/&quot;&gt;Zuora&lt;/a&gt;) or custom log parsing. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identity is also a point which will likely need to be augmented. Unless we are running a stock LDAP for our identity system, we will need to integrate our solution with OpenStack Nova. Having said that, this is true of almost all cloud solutions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;The customer portal will also be an integration point. While OpenStack Nova provides a user dashboard (to see running instance, launch new instances, etc.), it doesn’t provide an interface to allow application owners to signup for service, track their bills and lodge trouble tickets. Again, this is probably something that it is already in place at our imaginary service provider.  &lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ideally, the Admin API would replicate all functionality that we’d be able to do via the command line interface (which in this case is mostly the exposed through the nova-manage command). This will get better in the Diablo release with the &lt;a href=&quot;http://wiki.openstack.org/NovaAdminAPI&quot;&gt;Admin API&lt;/a&gt; work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloud monitoring and operations will be an important area of focus for our service provider. A key to any good operations approach is good tooling. While OpenStack Nova provides nova-instancemonitor, which tracks compute node utilization, we’re really going to need a number of third party tools for monitoring.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Policy is an extremely important area but very provider specific. Everything from quotas (which are supported) to quality of service (QoS) to privacy controls can fall under this. I’ve given OpenStack Nova partial coverage here, but that might vary depending on the intricacies of the providers needs. For the record, OpenStack Nova Cactus provides quotas for instances (number and cores used), volumes (size and number), floating IP addresses and metadata.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scheduling within OpenStack Nova is fairly rudimentary for larger installations today. The pluggable scheduler supports chance (random host assignment), simple (least loaded) and zone (random nodes within an availability zone). As within most areas on this list, this will be greatly augmented in Diablo. In development are distributed schedulers and schedulers that understand heterogeneous hosts (for support of GPUs and differing CPU architectures).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, OpenStack Nova provides a fair basis for our mythical service provider, as long as we are willing to do some integration here and there. In my next post, I’ll dive deeper into OpenStack Nova with a discussion on deployment architecture choices.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Auto Blogging with Rake & Rails</title>
   <link href="http://ken.pepple.info/rails/2011/03/26/auto-blogging-with-rails-and-rake/"/>
   <updated>2011-03-26T00:00:00-07:00</updated>
   <id>BLOG_URL/rails/2011/03/26/auto-blogging-with-rails-and-rake</id>
   <content type="html">&lt;p&gt;I have a long running blog that I struggle to keep current. The blog centers on mountain bike racing scene here in Northern California, so the content needs to stay timely as there are races every weekend all year long. Unfortunately, I don't have a lot of free time to devote to it. Long story short, I wanted to automatically create a post every Thursday morning to let people know what races were being held that weekend. You can see an example of what I wanted at &lt;a href=&quot;http://norcalmtnbikeracing.blogspot.com/2011/03/norcal-mtb-racing-this-weekend-3-mar-8.html&quot; target=&quot;_blank&quot;&gt;NorCal MTB Racing blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The basic idea was to create a &lt;span class=&quot;code-inline&quot;&gt;cron&lt;/span&gt; job that pulls a list of races (with a link for details) from my rails application's database, plot the events on map, add some text and then post it to my blog on Blogger. Most of this is pretty standard rails stuff, but I did need some help for the map and posting.&lt;/p&gt;

&lt;p&gt;For the maps, I used &lt;a href=&quot;http://code.google.com/apis/maps/documentation/staticmaps/&quot; target=&quot;_blank&quot;&gt;Google Static Maps&lt;/a&gt;. This allows you to embed a Google Maps image on your webpage just like a normal image. All you need to do it feed it the right parameters. For example, this HTML code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;NorCal MTB Race Event Map&amp;quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;http://maps.google.com/maps/api/staticmap?size=600x200&amp;amp;amp;maptype=roadmap&amp;amp;amp;sensor=false&amp;amp;amp;markers=color:blue|label:1|38.7067,-122.903&amp;amp;amp;markers=color:blue|label:2|37.7756,-122.438&amp;amp;amp;markers=color:blue|label:4|38.028,-121.885&amp;quot;&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Produces this map:&lt;/p&gt;

&lt;p&gt;&lt;img alt=&quot;NorCal MTB Race Event Map&quot; src=&quot;http://maps.google.com/maps/api/staticmap?size=600x200&amp;amp;maptype=roadmap&amp;amp;sensor=false&amp;amp;markers=color:blue|label:1|38.7067,-122.903&amp;amp;markers=color:blue|label:2|37.7756,-122.438&amp;amp;markers=color:blue|label:4|38.028,-121.885&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To post to Blogger, I used the &lt;span class=&quot;code-inline&quot;&gt;blogger gem&lt;/span&gt; (&lt;a href=&quot;http://blogger.rubyforge.org/&quot; target=&quot;_blank&quot;&gt;installation instructions&lt;/a&gt;). There are other ruby gems out there that interface with Blogger, but this was by far the most straight forward. To use the gem, you need username, password and blog ID. I found my blog ID through an &lt;a href=&quot;http://www.google.com/support/forum/p/blogger/thread?tid=44fc0d69e2a4f283&amp;hl=en&quot; target=&quot;_blank&quot;&gt;answer in the blogger support forum&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Got to your dashboard and click Settings for the blog you want the ID of. In the address bar you should then see something like this:&lt;/p&gt;
  &lt;p&gt;http://www.blogger.com/blog-options-basic.g?blogID=9101099271220909428&lt;/p&gt;
  &lt;p&gt;The long number at the end of the URL is your blog's ID number.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;p&gt;I decided that this would be best implemented as a rake task, so I could full access to all the rails application environment (especially the database connection). Here is the complete rake task:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:blogger&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;post weekend update to blogger&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:weekend_update&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:environment&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;blogger&amp;#39;&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;# preferences for blogger login&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sample@gmail.com&amp;#39;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# change this to your username&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;password&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;xxx129304xxxx&amp;#39;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# change this to your password&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;blog_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;123456&amp;#39;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# change this to your blogid&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# my entry preferences&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;days_ahead&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# how many days of events ?&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;blog_entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;For those of you making your weekend plans, &lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                  here is quick rundown of this weekend&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;#39;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;s MTB racing schedule &lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                  for NorCal:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;# google static map preferences &lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;base_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;http://maps.google.com/maps/api/staticmap?&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;map_params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;size=400x400&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;maptype=roadmap&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;sensor=false&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# find all events in the mtbcalendar.com db for this weekend&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@events&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Event&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find_tagged_with&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;norcal&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;ss&quot;&gt;:conditions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;start_date &amp;gt;= CURRENT_DATE AND start_date &amp;lt; ?&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
                        &lt;span class=&quot;n&quot;&gt;days_ahead&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;ss&quot;&gt;:order&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;start_date asc&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# loop through events adding place markers to the google static map URL&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@events&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;map_params&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;markers=color:blue|label:&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;blog_entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;. [&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;](http://mtbcalendar.com/events/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                    (&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;marker&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:compact&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# marker loop&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# add the google static map to post body&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;map_pic_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;base_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;map_params&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;amp;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;blog_entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;![NorCal MTB Race Event Map](&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;map_pic_url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;)&amp;quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# create title for the post&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;blog_title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;NorCal MTB Racing This Weekend: &lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                  &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:short&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; - &lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                  &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;days_ahead&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;days&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;from_now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:short&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, &lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;                  &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# login into blogger and post this draft&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;account&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Blogger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Account&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;new_post&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Blogger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:title&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blog_title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
                                    &lt;span class=&quot;ss&quot;&gt;:content&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;blog_entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                                    &lt;span class=&quot;ss&quot;&gt;:formatter&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:rdiscount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                                    &lt;span class=&quot;ss&quot;&gt;:draft&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;account&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;blog_id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new_post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# task    &lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# namespace&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Although I did this with a rake task, you could also make it just a regular ruby script. However, then you would need to handle all of the database login and queries yourself.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Custom iPhone Notifications with Prowl</title>
   <link href="http://ken.pepple.info/iphone/2011/03/21/custom-iphone-notifications-with-prowl/"/>
   <updated>2011-03-21T00:00:00-07:00</updated>
   <id>BLOG_URL/iphone/2011/03/21/custom-iphone-notifications-with-prowl</id>
   <content type="html">&lt;img style=&quot;float: right;&quot; src=&quot;/images/prowl_empty.jpg&quot; /&gt;&lt;p&gt;On of my favorite iPhone feature is &lt;a href=&quot;http://en.wikipedia.org/wiki/Apple_Push_Notification_Service&quot; target=&quot;_blank&quot;&gt;push notifications&lt;/a&gt;. However, only a few applications use these well (ESPN ScoreCenter, AP mobile, Twitter, etc.) and I've always wished I could write my own without creating a full blown iPhone application. Enter a simple application called &lt;a href=&quot;http://www.prowlapp.com/&quot; target=&quot;_blank&quot;&gt;Prowl&lt;/a&gt;. Prowl is a &lt;a href=&quot;http://growl.info/&quot; target=&quot;_blank&quot;&gt;Growl&lt;/a&gt; client for iOS that pushes notifications to your iPhone, iPod touch or iPad with a simple API.&lt;/p&gt;

&lt;p&gt;To send yourself custom push notifications, you'll first need to buy &lt;a href=&quot;http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271&quot; target=&quot;_blank&quot;&gt;Prowl&lt;/a&gt; for your iPhone (around USD$2.99). Once you've downloaded and installed it on your iPhone, you need to &lt;a href=&quot;https://www.prowlapp.com/api_settings.php&quot; target=&quot;_blank&quot;&gt;generate an API key&lt;/a&gt;. With that completed, you are all set to receive Prowl alerts.&lt;/p&gt;
&lt;p&gt;Some desktop/server apps work with it out of the box (a semi-full list is at &lt;a href=&quot;http://www.prowlapp.com/apps.php&quot; target=&quot;_blank&quot;&gt;http://www.prowlapp.com/apps.php&lt;/a&gt;). Others like &lt;a href=&quot;http://en.znc.in/wiki/Prowl&quot; target=&quot;_blank&quot;&gt;znc&lt;/a&gt;, &lt;a href=&quot;http://flexget.com/wiki/Plugins/prowl&quot; target=&quot;_blank&quot;&gt;flexget&lt;/a&gt; or &lt;a href=&quot;http://reluctanthacker.rollett.org/content/setting-nagios3-send-prowl-notifications&quot; target=&quot;_blank&quot;&gt;Nagios&lt;/a&gt; require a plugin. To create you own custom alert, you'll need to write some scripting code. I prefer using Python or Ruby for this, but &lt;a href=&quot;http://www.prowlapp.com/api.php#libraries&quot; target=&quot;_blank&quot;&gt;there are plenty of libraries available for other languages&lt;/a&gt;.&lt;/p&gt;


&lt;h4&gt;Prowl API&lt;/h4&gt;
&lt;p&gt;The &lt;a href=&quot;http://www.prowlapp.com/api.php&quot; target=&quot;_blank&quot;&gt;Prowl API&lt;/a&gt; is very simple:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
  &lt;li&gt;&lt;span class=&quot;code-inline&quot;&gt;add&lt;/span&gt; (POST) which sends notifications to your iPhone&lt;/li&gt;
  &lt;li&gt;&lt;span class=&quot;code-inline&quot;&gt;verify&lt;/span&gt; (GET) which checks the validity of your API key&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just recently the API was updated to version 1.2 which added two new methods - &lt;span class=&quot;code-inline&quot;&gt;retrieve/token&lt;/span&gt; (GET) and &lt;span class=&quot;code-inline&quot;&gt;retrieve/apikey&lt;/span&gt; (GET) - which appeal mostly to website operators. They facilitate giving people your API key in a secure manner.&lt;/p&gt;
&lt;p&gt;While the API is very simple, and you could certainly use it from the command line with a tool like curl, most people will want to use a library for their favorite programming language. I use two of these libraries, Prowly for Ruby and ProwlPy for Python.&lt;/p&gt;


&lt;h4&gt;Prowly for Ruby&lt;/h4&gt;
&lt;p&gt;The &lt;a href=&quot;http://raflabs.com/blogs/silence-is-foo/2010/06/30/prowly-a-ruby-api-wrapper-for-prowl-the-growl-client-for-the-iphone/&quot; target=&quot;_blank&quot;&gt;Prowly gem was written by Rafael Magana&lt;/a&gt; to make the Prowl API a bit more Ruby-friendly. It is dead simple to use. First, install the gem:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo gem install prowly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then create a simple script like the one below:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;prowly&amp;#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# your api key from https://www.prowlapp.com/api_settings.php&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;my_api_key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1234567890123456789012345678901234567890&amp;quot;&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Prowly&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;notify&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;apikey&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_api_key&lt;/span&gt; 
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;priority&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Prowly&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Notification&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;Priority&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:MODERATE&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;application&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Prowly&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Notification&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;description&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Your server is under attack!!!&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;http://www.myserver.com&amp;quot;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# requires API 1.2 support&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That is basically all there is to it. Of course, you'll want your script to actually do something (check a stock, parse a RSS feed, etc.), but sending the prowl is really that simple. Prowly also includes a command line script to send notifications without any scripting.&lt;/p&gt;
&lt;p&gt;Right now, the current gem has not been updated to use version 1.2 of the API. I've put in a &lt;a href=&quot;https://github.com/rafmagana/prowly/pull/1&quot; target=&quot;_blank&quot;&gt;pull request to get my upgrades merged in&lt;/a&gt; but in the meantime you can clone the updated one from my gtihub repository at  &lt;a href=&quot;https://github.com/slashk/prowly&quot; target=&quot;_blank&quot;&gt;https://github.com/slashk/prowly&lt;/a&gt;.&lt;/p&gt;


&lt;h4&gt;ProwlPy for Python&lt;/h4&gt;
&lt;p&gt;A corresponding Python library is called ProwlPy and was written by Jacob Burch and Olivier Hervieu. It is very similar to the Prowly. To use it, install the python library (which doesn't appear to be on PyPi):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone https://github.com/jacobb/prowlpy.git
... snip ...
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;prowlpy
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;python setup.py install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then just create a simple script like the ruby one above:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;prowlpy&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# your api key from https://www.prowlapp.com/api_settings.php&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;my_api_key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39;1234567890123456789012345678901234567890&amp;#39;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# your api key&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;prowlpy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Prowl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my_api_key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;ProwlPy&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
          &lt;span class=&quot;s&quot;&gt;&amp;#39;Notification&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
          &lt;span class=&quot;s&quot;&gt;&amp;#39;Your server is under attack&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
          &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
          &lt;span class=&quot;s&quot;&gt;&amp;quot;http://www.myserver.com&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I also upgraded this library to version 1.2 of the API and my changes have already been merged into the main repository at &lt;a href=&quot;https://github.com/jacobb/prowlpy&quot;&gt;https://github.com/slashk/prowly&lt;/a&gt;.&lt;/p&gt;


&lt;h4&gt;Creating Your Own Prowl Notifiers&lt;/h4&gt;
&lt;img style=&quot;float: right;&quot; src=&quot;/images/prowl_alert.jpg&quot; /&gt;&lt;p&gt;Once you've grokked the basics of using the Prowl API, it's time to actually put it to use. To do that, you'll need to create your own script (with whatever logic you need), have it execute at common intervals (usually via &lt;span class=&quot;code-inline&quot;&gt;cron&lt;/span&gt;) and then just wait for prowl notifications to roll in.&lt;/p&gt;
&lt;p&gt;To get you started, I've created a repository of scripts that I use over at &lt;a href=&quot;https://github.com/slashk/prowl-scripts&quot; target=&quot;_blank&quot;&gt;https://github.com/slashk/prowl-scripts&lt;/a&gt;. There you'll see a few scripts to notify you of:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://www.transmissionbt.com/&quot; target=&quot;_blank&quot;&gt;transmission bit torrent&lt;/a&gt; download completions&lt;/li&gt;
    &lt;li&gt;daily and monthly Google AdSense balances&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://www.woot.com/&quot; target=&quot;_blank&quot;&gt;woot!&lt;/a&gt; deals&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;I'll be adding more as I clean up my other scripts (weather, stock prices, steep and cheap, etc).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Configurable Instance Types For OpenStack Nova</title>
   <link href="http://ken.pepple.info/openstack/2011/03/03/Configurable-Instance-Types-For-OpenStack-Nova/"/>
   <updated>2011-03-03T00:00:00-08:00</updated>
   <id>BLOG_URL/openstack/2011/03/03/Configurable-Instance-Types-For-OpenStack-Nova</id>
   <content type="html">&lt;p&gt;Over the past three weeks, new Nova core developer Josh Kearney (&lt;em&gt;congrats &lt;a href=&quot;http://twitter.com/#!/jk0&quot;&gt;@jk0&lt;/a&gt;&lt;/em&gt;) and I have been working on adding runtime configuration of instance types (&lt;a href=&quot;http://wiki.openstack.org/ConfigureInstanceTypesDynamically&quot;&gt;read the full specification&lt;/a&gt;) to the &lt;a href=&quot;https://launchpad.net/nova&quot;&gt;OpenStack Nova compute service&lt;/a&gt;.  Instance types (or &quot;flavors&quot; as Rackspace calls them) are resources granted to virtual machines (&quot;instances&quot;) in the Nova cloud. In more specific terms, this is the size of the instance (vCPUs, RAM, Storage, etc.) that you will be launching. You may recognize these by the names &quot;m1.large&quot; or &quot;m1.tiny&quot; in AWS EC2 parlance. The Rackspace's API (&lt;a href=&quot;http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide-20110112.pdf&quot;&gt;PDF&lt;/a&gt;) calls these &quot;flavors&quot; and they tend to have names like &quot;256 MB Server&quot; and such.&lt;/p&gt;

&lt;p&gt;In the released version of OpenStack Nova (Bexar), instance types are defined statically in the &lt;code&gt;nova/instance_types.py&lt;/code&gt; file (which corresponds to the initial Amazon EC2 instance types) before run-time. This change, which will be part of the upcoming version of Nova (Cactus), instance types can be created by the Nova administrator during run-time through the &lt;span class=&quot;code-inline&quot;&gt;nova-manage&lt;/span&gt; command. If you are following the Nova trunk (or just impatient), you can find this merged in at &lt;a href=&quot;http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/revision/757&quot;&gt;revision number 757&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Basic Management&lt;/h4&gt;

&lt;p&gt;Instance types / flavor are managed through the &lt;span class=&quot;code-inline&quot;&gt;nova-manage&lt;/span&gt; binary with the &lt;span class=&quot;code-inline&quot;&gt;instance_type&lt;/span&gt; command and an appropriate subcommand. As we are using the &lt;span class=&quot;code-inline&quot;&gt;nova-manage&lt;/span&gt; command, we need to be on the Nova database server to configure instance types. Right now, instance type manipulation isn't exposed through the APIs nor the adminclient.&lt;/p&gt;
  
&lt;p&gt;Note that you can also use the &lt;span class=&quot;code-inline&quot;&gt;flavor&lt;/span&gt; command as a synonym for &lt;span class=&quot;code-inline&quot;&gt;instance_types&lt;/span&gt; for any of these examples.&lt;/p&gt;

&lt;p&gt;To see all currently active instance types, use the list subcommand:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage instance_type list
m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Again, and just for emphasis, you could just have easily used the &lt;span class=&quot;code-inline&quot;&gt;flavor&lt;/span&gt; subcommand to get the exact same output:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage flavor list
m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To create an instance type, use the &lt;span class=&quot;code-inline&quot;&gt;create&lt;/span&gt; subcommand with the following positional arguments:&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot;&gt;
&lt;li&gt;memory (expressed in megabytes)&lt;/li&gt;
&lt;li&gt;vcpu(s) (integer)&lt;/li&gt;
&lt;li&gt;local storage (expressed in gigabytes)&lt;/li&gt;
&lt;li&gt;flavorid (unique integer)&lt;/li&gt;
&lt;li&gt;swap space (expressed in megabytes, defaults to zero, optional)&lt;/li&gt;
&lt;li&gt;RXTX quotas (expressed in gigabytes, defaults to zero, optional)&lt;/li&gt;
&lt;li&gt;RXTX cap (expressed in gigabytes, defaults to zero, optional)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following example creates an instance type named &quot;m1.xxlarge&quot;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage instance_type create m1.xxlarge 32768 16 320 0 0 0
m1.xxlarge created
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To delete an instance type, use the &lt;span class=&quot;code-inline&quot;&gt;delete&lt;/span&gt; subcommand and specify the name:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage instance_type delete m1.xxlarge
m1.xxlarge deleted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Please note that the &lt;span class=&quot;code-inline&quot;&gt;delete&lt;/span&gt; command only marks the instance type as inactive in the database; it does not actually remove the instance type. This is done to preserve the instance type definition for long running instances (which may not terminate for months or years). If you are sure that you want to delete this instance type from the database, pass the &lt;span class=&quot;code-inline&quot;&gt;--purge&lt;/span&gt; flag after the name:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;nova-manage instance_type delete m1.xxlarge --purge
m1.xxlarge purged
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Be careful with deleting instance types, you might need this information later. Unless you truly need to prune the size of your instance_types table you are much safer to just &lt;span class=&quot;code-inline&quot;&gt;delete&lt;/span&gt; the instance type.&lt;/p&gt;

&lt;h4&gt;Implementation&lt;/h4&gt;
&lt;p&gt;This feature is implemented with an additional database table (instance_types), which has rows for each instance type/flavor. The &lt;span class=&quot;code-inline&quot;&gt;nova-manage&lt;/span&gt; command allows you to manipulate this table. At installation time (actually when the &lt;span class=&quot;code-inline&quot;&gt;nova-manage db sync&lt;/span&gt; command is run), the database table is seeded with instance type values for the five default types: m1.small, m1.tiny, m1.medium, m1.large and m1.xlarge.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>OpenStack Development with virtualenvwrapper</title>
   <link href="http://ken.pepple.info/openstack/2011/01/24/OpenStack-With-Virtualenvwrapper/"/>
   <updated>2011-01-24T00:00:00-08:00</updated>
   <id>BLOG_URL/openstack/2011/01/24/OpenStack-With-Virtualenvwrapper</id>
   <content type="html">&lt;p&gt;Coming from the ruby/ruby on rails world, i’ve been a bit lost when it comes to the python development process used in the openstack project. One of the biggest hurdles has been the usage of virtualenv in the workflow. Basically, virtualenv lets you create a stable configuration of python libraries (eggs) much like freezing gems in your rails application. The pitfalls here is that you need to integrate it’s usage into your development flow (activate/deactivate environments), it can take some time to recreate environments if you use a lot of eggs (like nova does) and it seems pretty fragile (it lives in repo and takes some chicanery to avoid duplicating in each bzr branch).&lt;/p&gt;

&lt;p&gt;However, I recently found &lt;a href=&quot;http://www.doughellmann.com/projects/virtualenvwrapper/&quot; target=&quot;_blank&quot;&gt;virtualenvwrapper&lt;/a&gt; which has erased much of this heartache:&lt;/p&gt;

&lt;blockquote&gt;virtualenvwrapper is a set of extensions to Ian Bicking’s virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.&lt;/blockquote&gt;

&lt;p&gt;Basically, it centralizes the location of your virtual environments and gives you easy commands to manipulate them: mkvirtaulenv creates one, rmvirtaulenv deletes one and workon activates one. It also allows you to create per environment, user customizable hooks that automatically fire on all the operations. I have created a simple one that automagically changes my directory to my nova trunk directory when I activate my nova virtual environment.&lt;/p&gt;

&lt;p&gt;With all that said, here is how I hack on OpenStack Nova on Ubuntu 10.10 (illustrated with nova bzr revno 604). First, install the pre-reqs for getting the code and your basic python environment:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo apt-get install python-dev swig libssl-dev python-pip bzr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

This loads a ton of dependencies packages. Next, pull in our virtualenv eggs:

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo pip install virtualenv 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo pip install virtualenvwrapper
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Now, setup virtualenvwrapper for your account:

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;source /usr/local/bin/virtualenvwrapper.sh&amp;quot;&lt;/span&gt; &amp;gt;&amp;gt; .bashrc 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; /usr/local/bin/virtualenvwrapper.sh 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;WORKON_HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/.virtualenv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

With that done, we can start pulling down the source code. I’ve put my nova code branches in ~/src/nova/ :

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir -p src 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;src 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bzr init-repo nova 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;nova/ 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bzr branch lp:nova trunk 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;trunk/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

With that in place, let’s create our virtual environment and pull in our python requirements. This is where virtualenvwrapper shines - just one command and we have a portable virtual environment and another to fill it up for all of our branches:

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkvirtualenv nova 
New python executable in nova/bin/python Installing setuptools............done. virtualenvwrapper.user_scripts creating /home/nova/.virtualenv/nova/bin/predeactivate virtualenvwrapper.user_scripts creating /home/nova/.virtualenv/nova/bin/postdeactivate virtualenvwrapper.user_scripts creating /home/nova/.virtualenv/nova/bin/preactivate virtualenvwrapper.user_scripts creating /home/nova/.virtualenv/nova/bin/postactivate virtualenvwrapper.user_scripts creating /home/nova/.virtualenv/nova/bin/get_env_details
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/nova/trunk&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/nova/trunk&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pip install -r tools/pip-requires
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Now that we got everything good to go, let’s run our tests to make sure everything is good (use -N option, otherwise the script wants to wrap everything with plain virtualenv commands):

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/nova/trunk&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./run_tests.sh -N 
AdminAPITest 
test_admin_disabled ok 
test_admin_enabled ok 
APITest 
test_exceptions_are_converted_to_faults ok
…. SNIP …
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Perfect. When you are done, just deactivate:

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/nova/trunk&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

While that makes everything nice and neat, the big win is when you decide to move your repo or create a new branch. To branch, just create the directory (which can be anywhere now), branch your code from trunk and activate your virtual environment (suing the workon command):

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;nova@openstack:~/src&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;patch 
nova@openstack:~/src/patch&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bzr branch ../nova/trunk/ lp708221 
Branched 604 revision&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;. 
nova@openstack:~/src/patch&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;lp708221/ 
nova@openstack:~/src/patch/lp708221&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;workon nova 
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/patch/lp708221&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./run_tests.sh -N 
AdminAPITest 
test_admin_disabled ok 
test_admin_enabled ok
.... snip ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

If you need to recreate your virtualenv (say after a big change in tools/pip-requires), you can just remove it and then recreate it

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rmvirtualenv nova 
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkvirtualenv nova2 
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;nova/trunk 
&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nova2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;nova@openstack:~/src/nova/trunk&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;pip install -r tools/pip-requires
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

All in all, virtualenvwrapper has made my hacking flow much better. Once I get a chance, I’ll document this same setup in Fedora and see if we can’t change some of the nova support scripts to better utilize virtualenvwrapper.</content>
 </entry>
 
 <entry>
   <title>Speaking at CommunityOne 2009</title>
   <link href="http://ken.pepple.info/cloud/2009/05/30/Speaking-at-CommunityOne-2009/"/>
   <updated>2009-05-30T00:00:00-07:00</updated>
   <id>BLOG_URL/cloud/2009/05/30/Speaking-at-CommunityOne-2009</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/C1W_170x93_Speaking_v2-1.gif&quot; border=&quot;0&quot; alt=&quot;C1W_170x93_Speaking_v2-1.gif&quot; width=&quot;170&quot; height=&quot;93&quot; align=&quot;right&quot; /&gt;Over the past few weeks, &lt;a href=&quot;http://blogs.sun.com/downstream/&quot;&gt;Scott Mattoon&lt;/a&gt;, &lt;a href=&quot;http://blogs.sun.com/stanford/&quot;&gt;John Stanford&lt;/a&gt; and I have been documenting infrastructure patterns to help application developers architect for cloud computing environments as part of a larger program around enabling cloud computing for our customers. It's been an interesting project, as cloud computing is both very new, but based on some very old concepts.&lt;/p&gt;
&lt;p&gt;On Monday, we will be presenting our work in progress at &lt;a href=&quot;http://developers.sun.com/events/communityone/2009/west/index.jsp&quot;&gt;CommunityOne West&lt;/a&gt; in San Francisco's Moscone Center. Around the same time, we hope to move our work into the public view on &lt;a href=&quot;http://wikis.sun.com/display/cloud/Patterns&quot;&gt;wikis.sun.com&lt;/a&gt; for comments and contributions. I'll post something here as soon as it happens.&lt;/p&gt;
&lt;p&gt;Our talk will highlight three sets of pattern domains: provisioning, monitoring and resource administration. You can expect to hear talk of motivations and implementations, with sequence diagrams, architecture pictures and code snippets for illustration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/puppet_example.png&quot; border=&quot;0&quot; alt=&quot;puppet_example.png&quot; width=&quot;338&quot; height=&quot;264&quot; /&gt;&lt;img src=&quot;/images/static-example-code.png&quot; border=&quot;0&quot; alt=&quot;static-example-code.png&quot; width=&quot;338&quot; height=&quot;264&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you are attending the conference (you can &lt;a href=&quot;http://developers.sun.com/events/communityone/2009/west/index.jsp&quot;&gt;still sign up for free here&lt;/a&gt;), our presentations will be:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div id=&quot;hcalendar-Practical-Cloud-Computing-Patterns&quot; class=&quot;vevent&quot;&gt;&lt;a href=&quot;http://feeds.technorati.com/events/http://blogs.sun.com/home/entry/speaking_at_communityone_2009&quot;&gt;&lt;img src=&quot;http://blogs.sun.com/home/resource/_515868619_ed9cda470a_o.png&quot; border=&quot;0&quot; alt=&quot;515868619_ed9cda470a_o.png&quot; width=&quot;29&quot; height=&quot;18&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;abbr class=&quot;dtstart&quot; title=&quot;2009-06-01T14:40-07:0000&quot;&gt;June 1, 2009 from 2:40&lt;/abbr&gt; to &lt;abbr class=&quot;dtend&quot; title=&quot;2009-06-01T15:30-07:00&quot;&gt;3:30pm&lt;/abbr&gt; PDT &lt;br /&gt; &lt;a class=&quot;url&quot; href=&quot;http://developers.sun.com/events/communityone/2009/west/agenda.jsp&quot;&gt;&lt;span class=&quot;summary&quot;&gt;Practical Cloud Computing Patterns&lt;/span&gt;&lt;/a&gt; &lt;br /&gt; &lt;span class=&quot;location&quot;&gt;Gateway 104, Moscone Center, &lt;span class=&quot;adr&quot;&gt;&lt;span class=&quot;locality&quot;&gt;San Francisco&lt;/span&gt;, &lt;span class=&quot;region&quot;&gt;CA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you can't be in San Francisco for the conference, I believe you can watch our presentation on a live webcast: &lt;a href=&quot;http://wikis.sun.com/display/CommunityOne/LiveWebcast&quot;&gt;Check here for details&lt;/a&gt;. We are &quot;&lt;strong&gt;2:40 - 3:30 pm | Practical Cloud Computing Patterns (Gateway 104)&lt;/strong&gt;&quot; under the Cloud Platforms topic.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Open Group Beijing Kickoff</title>
   <link href="http://ken.pepple.info/cloud/2009/05/26/Open-Group-Beijing-Cloud-Kickoff/"/>
   <updated>2009-05-26T00:00:00-07:00</updated>
   <id>BLOG_URL/cloud/2009/05/26/Open-Group-Beijing-Cloud-Kickoff</id>
   <content type="html">&lt;p&gt;I had a great opportunity to revisit China, part of my old region (and now part of my new global responsibility), as part of The Open Group's kickoff last week:&lt;/p&gt;
&lt;blockquote&gt;&lt;a href=&quot;http://www.opengroup.org/&quot;&gt;The Open Group&lt;/a&gt;, which recently established a franchise in China with &lt;a href=&quot;http://kingdee.com/en/index.jsp&quot;&gt;Kingdee&lt;/a&gt;, is a vendor-neutral and technology-neutral consortium, which drives the creation of Boundaryless Information Flow™ that will enable access to integrated information within and between enterprises based on open standards and global interoperability.
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://blogs.sun.com/home/resource/_togaf-china-kickoff.jpg&quot; border=&quot;0&quot; alt=&quot;togaf-china-kickoff.jpg&quot; width=&quot;600&quot; height=&quot;450&quot; /&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;That's Allen Brown, President and CEO of the Open Group, giving the opening talk.&lt;/p&gt;
&lt;p&gt;I was there to speak about cloud computing, its challenges and opportunities to enterprise architects. Kingdee and TOG put on a great conference, which was well attended. Maybe I'll go back in October when they have their practitioners conference in Hong Kong.&lt;/p&gt;
&lt;p&gt;Learn more about the &lt;a href=&quot;http://www.opengroup.org/beijing2009/&quot;&gt;The Open Group Conference - Beijing&lt;/a&gt; at their website.&lt;/p&gt;</content>
 </entry>
 
 
</feed>