<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Labix Blog &#187; Cloud</title>
	<atom:link href="http://blog.labix.org/tag/cloud/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.labix.org</link>
	<description>by Gustavo Niemeyer</description>
	<lastBuildDate>Mon, 16 Jan 2012 04:02:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Ensemble, Go, and MongoDB at Canonical</title>
		<link>http://blog.labix.org/2011/08/05/ensemble-go-and-mongodb-at-canonical</link>
		<comments>http://blog.labix.org/2011/08/05/ensemble-go-and-mongodb-at-canonical#comments</comments>
		<pubDate>Fri, 05 Aug 2011 03:49:14 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=706</guid>
		<description><![CDATA[About 1 year after development started in Ensemble, today the stars finally aligned just the right way (review queue mostly empty, no other pressing needs, etc) for me to start writing the specification about the repository system we&#8217;ve been jointly &#8230; <a href="http://blog.labix.org/2011/08/05/ensemble-go-and-mongodb-at-canonical">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>About 1 year after development started in <a href="https://ensemble.ubuntu.com">Ensemble</a>, today the stars finally aligned just the right way (review queue mostly empty, no other pressing needs, etc) for me to start writing the specification about the repository system we&#8217;ve been jointly planning for a long time. This is the system that the Ensemble client will communicate with for discovering which <a href="https://ensemble.ubuntu.com/docs/formula.html">formulas</a> are available, for publishing new formulas, for obtaining formula files for deployment, and so on.</p>
<p><span id="more-706"></span>We of course would have liked for this part of the project to have been specified and written a while ago, but unfortunately that wasn&#8217;t possible for several reasons. That said, there are also good sides of having an important piece flying around in minds and conversations for such a long time: sitting down to specify the system and describe the inner-working details has been a breeze. Even details such as the namespacing of formulas, which hasn&#8217;t been entirely clear in my mind, was just streamed into the document as the ideas we&#8217;ve been evolving finally got together in a written form. </p>
<p>One curious detail: this is the first long term project at <a href="https://www.canonical.com">Canonical</a> that will be developed in <a href="http://golang.org">Go</a>, rather than Python or C/C++, which are the most used languages for projects within Canonical. Not only that, but we&#8217;ll also be using <a href="http://www.mongodb.org">MongoDB</a> for a change, rather than the traditional <a href="http://www.postgresql.com">PostgreSQL</a>, and will also use (you guessed) the <a href="http://labix.org/mgo">mgo driver</a> which I&#8217;ve been pushing entirely as a personal project for about 8 months now.</p>
<p>Naturally, with so many moving parts that are new to the company culture, this is still being seen as a closely watched experiment. Still, this makes me highly excited, because when I started developing mgo, the MongoDB driver for Go, my hopes that the Go, MongoDB, and mgo trio would eventually be used at Canonical were very low, precisely because they were all alien to the culture. We only got here after quite a lot of internal debate, experiments, and trust too.</p>
<p>All of that means these are happy times. Important feature in Ensemble being specified and written, very exciting tools, home grown software being useful..</p>
<p>Awesomeness.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2011/08/05/ensemble-go-and-mongodb-at-canonical/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Vector clock support for Go</title>
		<link>http://blog.labix.org/2010/12/21/vector-clock-support-for-go</link>
		<comments>http://blog.labix.org/2010/12/21/vector-clock-support-for-go#comments</comments>
		<pubDate>Tue, 21 Dec 2010 18:03:47 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Snippet]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=564</guid>
		<description><![CDATA[One more Go library oriented towards building distributed systems hot off the presses: govclock. This one offers full vector clock support for the Go language. Vector clocks allow recording and analyzing the inherent partial ordering of events in a distributed &#8230; <a href="http://blog.labix.org/2010/12/21/vector-clock-support-for-go">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One more Go library oriented towards building distributed systems hot off the presses: <a href="http://labix.org/govclock">govclock</a>. This one offers full <a href="http://en.wikipedia.org/wiki/Vector_clock">vector clock</a> support for the <a href="http://golang.org">Go language</a>.  Vector clocks allow recording and analyzing the inherent partial ordering of events in a distributed system in a comfortable way.</p>
<p>The following features are offered by govclock, in addition to basic event tracking:</p>
<p><span id="more-564"></span>
<ul>
<li>Compact serialization and deserialization
<li>Flexible truncation (min/max entries, min/max update time)
<li>Unit-independent update times
<li>Traditional merging
<li>Fast and memory efficient
</ul>
<p>If you&#8217;d like to know more about vector clocks, the Basho guys did a great job in the following pair of blog posts:</p>
<ul>
<li><a href="http://blog.basho.com/2010/01/29/why-vector-clocks-are-easy/">Why vector clocks are easy</a>
<li><a href="http://blog.basho.com/2010/04/05/why-vector-clocks-are-hard/">Why vector clocks are hard</a>
</ul>
<p>The following sample program demonstrates some sequential and concurrent events, dumping and loading, as well as merging of clocks.  For more details, please look at the <a href="http://labix.org/govclock">web page</a>.  The project is available under a BSD license.</p>
<pre>

package main

import (
    "launchpad.net/govclock"
    "fmt"
)

func main() {
    vc1 := govclock.New()
    vc1.Update([]byte("A"), 1)

    vc2 := vc1.Copy()
    vc2.Update([]byte("B"), 0)

    fmt.Println(vc2.Compare(vc1, govclock.Ancestor))   // => true
    fmt.Println(vc1.Compare(vc2, govclock.Descendant)) // => true

    vc1.Update([]byte("C"), 5)

    fmt.Println(vc1.Compare(vc2, govclock.Descendant)) // => false
    fmt.Println(vc1.Compare(vc2, govclock.Concurrent)) // => true

    vc2.Merge(vc1)

    fmt.Println(vc1.Compare(vc2, govclock.Descendant)) // => true

    data := vc2.Bytes()
    fmt.Printf("%#v\n", string(data))
    // => "\x01\x01\x01\x01A\x01\x01\x01B\x01\x00\x01C"

    vc3, err := govclock.FromBytes(data)
    if err != nil { panic(err.String()) }

    fmt.Println(vc3.Compare(vc2, govclock.Equal))      // => true
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2010/12/21/vector-clock-support-for-go/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating IRC with LDAP and two-way SMSing</title>
		<link>http://blog.labix.org/2010/06/19/integrating-irc-with-ldap-and-two-way-smsing</link>
		<comments>http://blog.labix.org/2010/06/19/integrating-irc-with-ldap-and-two-way-smsing#comments</comments>
		<pubDate>Sat, 19 Jun 2010 21:56:07 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=296</guid>
		<description><![CDATA[A bit of history I don&#8217;t know exactly why, but I&#8217;ve always enjoyed IRC bots. Perhaps it&#8217;s the fact that it emulates a person in an easy-to-program way, or maybe it&#8217;s about having a flexible and shared &#8220;command line&#8221; tool, &#8230; <a href="http://blog.labix.org/2010/06/19/integrating-irc-with-ldap-and-two-way-smsing">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><b>A bit of history</b></p>
<p>I don&#8217;t know exactly why, but I&#8217;ve always enjoyed IRC bots.  Perhaps it&#8217;s the fact that it emulates a person in an easy-to-program way, or maybe it&#8217;s about having a flexible and shared &#8220;command line&#8221; tool, or maybe it&#8217;s just the fact that it helps people perceive things in an asynchronous way without much effort.  Probably a bit of everything, actually.</p>
<p><span id="more-296"></span></p>
<p>My bot programming started with <a href="http://labix.org/pybot">pybot</a> many years ago, when I was still working at <a href="http://www.conectiva.com.br">Conectiva</a>.  Besides having many interesting features, this bot eventually got in an abandonware state, since <a href="http://www.canonical.com">Canonical</a> already had pretty much equivalent features available when I joined, and I had other interests which got in the way.  The code was a bit messy as well.. it was a time when I wasn&#8217;t very used to testing software properly (a friend has a great excuse for that kind of messy software: <i>&#8220;I was young, and needed the money!&#8221;</i>).</p>
<p>Then, a couple of years ago, while working in the <a href="http://landscape.canonical.com">Landscape</a> project, there was an opportunity of getting some information more visible to the team.  Coincidently, it was also a time when I wanted to get some practice with the concepts of <a href="http://erlang.org">Erlang</a>, so I decided to write a bot from scratch with some nice support for plugins, just to get a feeling of how the promised stability of Erlang actually took place for real.  This bot is called <a href="https://launchpad.net/mup">mup</a> (Mup Pet, more formally), and its code is available publicly through <a href="https://launchpad.net/mup">Launchpad</a>.</p>
<p>This was a nice experiment indeed, and I did learn quite a bit about the ins and outs of Erlang with it.  Somewhat unexpected, though, was the fact that the bot grew up a few extra features which multiple teams in Canonical started to appreciate.  This was of course very nice, but it also made it more obvious that the egocentric reason for having a bot written in Erlang would now hurt, because most of Canonical&#8217;s own coding is done in Python, and that&#8217;s what internal tools should generally be written in for everyone to contribute and help maintaining the code.</p>
<p>That&#8217;s where the desire of migrating mup into a Python-based brain again came from, and having a new feature to write was the perfect motivator for this.</p>
<p><b>LDAP and two-way SMSing over IRC</b></p>
<p>Canonical is a <i>very</i> distributed company.  Employees are distributed over dozens of countries, literally.  Not only that, but most people also work from their homes, rather than in an office.  Many different countries also means many different timezones, and working from home with people from different timezones means flexible timing.  All of that means communication gets&#8230; well.. interesting.</p>
<p>How do we reach someone that should be in an online meeting and is not?  Or someone that is traveling to get to a sprint?  Or how can someone that has no network connectivity reach an IRC channel to talk to the team?  There are probably several answers to this question, but one of them is of course SMS.  It&#8217;s not exactly cheap if we consider the cost of the data being transfered, but pretty much everyone has a mobile phone which can do SMS, and the model is not that far away from IRC, which is the main communication system used by the company.</p>
<p>So, the itch was itching.  Let&#8217;s scratch it!</p>
<p>Getting the mobile phone of employees was already a solved problem for mup, because it had a plugin which could interact with the LDAP directory, allowing people to do something like this:</p>
<blockquote><p>
&lt;joe&gt; mup: poke gustavo<br />
&lt;mup&gt; joe: niemeyer is Gustavo Niemeyer &lt;&#8230;@canonical.com&gt; &lt;time:&#8230;&gt; &lt;mobile:&#8230;&gt;
</p></blockquote>
<p>This just had to be migrated from Erlang into a Python-based brain for the reasons stated above. This time, though, there was no reason to write something from scratch.  I could even have used pybot itself, but there was also <a href="http://sourceforge.net/projects/supybot/">supybot</a>, an IRC bot which started around the same time I wrote the first version of pybot, and unlike the latter, supybot&#8217;s author was much more diligent in evolving it.  There is quite a comprehensive list of plugins for supybot nowadays, and it includes means for testing plugins and so on.  The choice of using it was straighforward, and getting &#8220;<i>poke</i>&#8221; support ported into a plugin wasn&#8217;t hard at all.</p>
<p>So, on to SMSing.  Canonical already had a contract with an SMS gateway company which we established to test-drive some ideas on <a href="https://landscape.canonical.com">Landscape</a>. With the mobile phone numbers coming out of the LDAP directory in hands and an SMS contract established, all that was needed was a plugin for the bot to talk to the SMS gateway.  That &#8220;conversation&#8221; with the SMS gateway allows not only sending messages, but also receiving SMS messages which were sent to a specific number.</p>
<p>In practice, this means that people which are connected to IRC can very easily deliver an SMS to someone using their nicks.  Something like this:</p>
<blockquote><p>
&lt;joe&gt; @sms niemeyer Where are you?  We&#8217;re waiting!
</p></blockquote>
<p>And this would show up in the mobile screen as:</p>
<blockquote><p>
joe&gt; Where are you?  We&#8217;re waiting!
</p></blockquote>
<p>In addition to this, people which have <i>no connectivity</i> can also contact individuals and channels on IRC, with mup working as a middle man.  The message would show up on IRC in a similar way to:</p>
<blockquote><p>
&lt;mup&gt; [SMS] &lt;niemeyer&gt; Sorry, the flight was delayed. Will be there in 5.
</p></blockquote>
<p>The communication from the bot to the gateway happens via plain HTTPS.  The communication back is a bit more complex, though.  There is a small proxy service deployed in <a href="http://code.google.com/appengine">Google App Engine</a> to receive messages from the SMS gateway.  This was done to avoid losing messages when the bot itself is taken down for maintenance.  The SMS gateway doesn&#8217;t handle this case very well, so it&#8217;s better to have something which will be up most of the time buffering messages.</p>
<p>A picture is worth 2<sup>10</sup> words, so here is a simple diagram explaining how things got linked together:</p>
<p><a href="http://blog.labix.org/wp-content/uploads/2010/06/mup-sms.png"><img src="http://blog.labix.org/wp-content/uploads/2010/06/mup-sms.png" alt="" title="SMS integration diagram" width="449" height="255" class="aligncenter size-full wp-image-308" /></a></p>
<p>This is now up for experimentation, and so far it&#8217;s working nicely.  I&#8217;m hoping that in the next few weeks we&#8217;ll manage to port the rest of mup into the supybot-based brain.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2010/06/19/integrating-irc-with-ldap-and-two-way-smsing/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recovering a bootable EBS image</title>
		<link>http://blog.labix.org/2010/03/09/recovering-a-bootable-ebs-image</link>
		<comments>http://blog.labix.org/2010/03/09/recovering-a-bootable-ebs-image#comments</comments>
		<pubDate>Tue, 09 Mar 2010 21:45:43 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Cloud]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=250</guid>
		<description><![CDATA[Scott Moser has just announced this week that the new Ubuntu images which boot out of an EBS-based root filesystem in EC2, and thus will persist across reboots, are available for testing. As usual with something that just left the &#8230; <a href="http://blog.labix.org/2010/03/09/recovering-a-bootable-ebs-image">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Scott Moser has <a href="https://lists.ubuntu.com/archives/ubuntu-cloud/2010-March/000155.html">just announced</a> this week that the new Ubuntu images which boot out of an EBS-based root filesystem in EC2, and thus will persist across reboots, are available for testing.</p>
<p>As usual with something that just left the oven and is explicitly labeled <i>for testing purposes</i>, there was a minor bug in the first iteration of images which was even mentioned in the announcement itself.  The bug, if not worked around as specified in the announcement, will prevent the image from rebooting.</p>
<p>Having an bootable EBS image which can&#8217;t reboot is a quite interesting (and ironic) problem.  You have an image which persists, but suddenly you have no way to see what is inside the image anymore because you can&#8217;t boot it.  Naturally, even if the said bug didn&#8217;t exist in the first place, it&#8217;s fairly easy to get into such a situation accidentally if you&#8217;re fiddling with the image configuration.</p>
<p>So, in this post we&#8217;ll see how to recover from a situation where a bootable EBS image can&#8217;t boot.</p>
<p><span id="more-250"></span></p>
<p><b>Getting started</b></p>
<p>To start this up, we&#8217;ll boot one of the EBS images which Scott mentioned in his announcement: ami-8bec03e2.  As we see in the output of <i>ec2-describe-images</i>, this is an EBS-based image for <i>i386</i>:</p>
<blockquote><p>
% ec2-describe-images ami-8bec03e2<br />
IMAGE	ami-8bec03e2	099720109477/ebs/ubuntu-images-testing/ubuntu-lucid-daily-i386-server-20100305	099720109477	available	public		i386	machine	aki-3fdb3756			ebs<br />
BLOCKDEVICEMAPPING	/dev/sda1		snap-f1efd098	15
</p></blockquote>
<p>Let&#8217;s run this image.  Remember to replace the value passed in the <i>-k</i> command line option with your own key pair name.</p>
<blockquote><p>
% ec2-run-instances -k gsg-keypair ami-8bec03e2<br />
RESERVATION	r-9e4615f6	626886203892	default<br />
INSTANCE	i-e3e33a88	ami-8bec03e2			pending	gsg-keypair	0		m1.small	2010-03-09T20:04:12+0000	us-east-1c	aki-3fdb3756			monitoring-disabled			ebs
</p></blockquote>
<p>There we go.  We got an instance allocated in the availability zone us-east-1c.  It&#8217;s important to keep track of this information, since EBS volumes are zone-specific.</p>
<p>As part of the above command, we must have been allocated an EBS volume automatically, and it should be attached to the instance we just started.  We can investigate it with the <i>ec2-describe-volumes</i> command:</p>
<blockquote><p>
% ec2-describe-volumes<br />
VOLUME	vol-edca1684	15	snap-f1efd098	us-east-1c	in-use	2010-03-09T20:04:20+0000<br />
ATTACHMENT	vol-edca1684	i-e3e33a88	/dev/sda1	attached	2010-03-09T20:04:24+0000
</p></blockquote>
<p>Now, we&#8217;ll get into the running instance and do some arbitrary modifications, just as a way to demonstrate that the data we don&#8217;t want to lose actually survives the recovering operation. Note that the domain name is obtained with the <i>ec2-describe-instances</i> command.</p>
<blockquote><p>
% ssh -i ~/.ssh/id_dsa_gsg-keypair ubuntu@ec2-184-73-51-147.compute-1.amazonaws.com<br />
(&#8230;)</p>
<p>ubuntu@domU-12-31-39-0E-A0-03:~$ echo &#8220;Important data&#8221; > important-data<br />
ubuntu@domU-12-31-39-0E-A0-03:~$ ls -l important-data<br />
-rw-r&#8211;r&#8211; 1 ubuntu ubuntu 15 Mar  9 20:15 important-data</p>
<p>ubuntu@domU-12-31-39-0E-A0-03:~$ sudo reboot<br />
Broadcast message from ubuntu@domU-12-31-39-0E-A0-03<br />
	(/dev/pts/0) at 20:18 &#8230;<br />
The system is going down for reboot NOW!
</p></blockquote>
<p>Note that we didn&#8217;t actually fix the problem reported by Scott, so our machine won&#8217;t really reboot.  If we wait a while, we can even see that the problem is exactly what was reported in the announcement (note it really takes a bit for the output to be synced up):</p>
<blockquote><p>
% ec2-get-console-output i-e3e33a88 | tail -4<br />
mount: special device ephemeral0 does not exist<br />
mountall: mount /mnt [294] terminated with status 32<br />
mountall: Filesystem could not be mounted: /mnt
</p></blockquote>
<p>Alright, now what?  Machine is dead.. and can&#8217;t reboot.  How do we get to our important data?</p>
<p><b>Fixing the problem</b></p>
<p>The first thing we do is to <b>stop</b> the instance.  Do <i>not</i> terminate it, or you&#8217;ll lose the EBS volume!  After stopping it, we&#8217;ll detach the EBS volume that was being used as the root filesystem, so that we can attach somewhere else.</p>
<blockquote><p>
% ec2-stop-instances i-e3e33a88<br />
INSTANCE	i-e3e33a88	running	stopping</p>
<p>% ec2-detach-volume vol-edca1684<br />
ATTACHMENT	vol-edca1684	i-e3e33a88	/dev/sda1	detaching	2010-03-09T20:04:22+0000
</p></blockquote>
<p>Now, we need to attach this volume in an image which actually boots, so that we can fix it.  For this experiment, we&#8217;ll pick one of the daily Lucid images, but we could use any other working image really.  Just remind that the image must be running in the same availability zone as our previous instance, since the EBS volume won&#8217;t be accessible otherwise.</p>
<blockquote><p>
% ec2-run-instances -k gsg-keypair -z us-east-1c ami-b5f619dc<br />
RESERVATION	r-967427fe	626886203892	default<br />
INSTANCE	i-fd08d196	ami-b5f619dc			pending	gsg-keypair	0		m1.small	2010-03-09T21:10:11+0000	us-east-1c	aki-3fdb3756			monitoring-disabled			instance-store		</p>
<p>% ec2-attach-volume vol-edca1684 -i i-fd08d196 -d /dev/sdh1<br />
ATTACHMENT	vol-edca1684	i-fd08d196	/dev/sdh1	attaching	2010-03-09T21:10:51+0000
</p></blockquote>
<p>With the instance running and the EBS root device attached with an alternative device name, we can then login to fix the original problem which prevented the image from booting correctly.  In our case, we&#8217;ll simply do what Scott suggested in the announcement.</p>
<blockquote><p>
% ssh -i ~/.ssh/id_dsa_gsg-keypair ubuntu@ec2-204-236-194-196.compute-1.amazonaws.com<br />
(&#8230;)<br />
$ mkdir ebs-root<br />
$ sudo mount /dev/sdh1 ebs-root<br />
$ sudo sed -i &#8216;s/^ephemeral0/#ephemeral0/&#8217; ebs-root/etc/fstab<br />
$ sudo umount ebs-root<br />
$ logout<br />
Connection to ec2-204-236-194-196.compute-1.amazonaws.com closed.
</p></blockquote>
<p>Done!  Our EBS volume is now correct, and it should boot alright.  We&#8217;ll detach the volume from the temporary instance we created, and will reattach it back to the old bootable EBS instance which is stopped.  Note that we won&#8217;t yet terminate the temporary instance, because we may need it in case something else is still wrong, and we are already paying to use it for the hour anyway.  We just have to remind ourselves to terminate it once we&#8217;re fully done.</p>
<blockquote><p>
% ec2-detach-volume vol-edca1684<br />
ATTACHMENT	vol-edca1684	i-fd08d196	/dev/sdh1	detaching	2010-03-09T21:10:51+0000</p>
<p>% ec2-attach-volume vol-edca1684 -i i-e3e33a88 -d /dev/sda1<br />
ATTACHMENT	vol-edca1684	i-e3e33a88	/dev/sda1	attaching	2010-03-09T21:24:55+0000</p>
<p>% ec2-describe-volumes vol-edca1684<br />
VOLUME	vol-edca1684	15	snap-f1efd098	us-east-1c	in-use	2010-03-09T20:04:20+0000<br />
ATTACHMENT	vol-edca1684	i-e3e33a88	/dev/sda1	attached	2010-03-09T21:24:55+0000
</p></blockquote>
<p>Okay!  It should all be good now.  It&#8217;s time to restart our instance, and see if it is working.  Note that since you stopped and started the instance, the public domain name most probably has changed, and thus we need to find it out again with <i>ec2-describe-instances</i> once the instance is running.</p>
<blockquote><p>
% ec2-start-instances i-e3e33a88<br />
INSTANCE	i-e3e33a88	stopped	pending</p>
<p>% ec2-describe-instances i-e3e33a88<br />
RESERVATION	r-9e4615f6	626886203892	default<br />
INSTANCE	i-e3e33a88	ami-8bec03e2	ec2-184-73-72-214.compute-1.amazonaws.com	domU-12-31-39-03-B8-21.compute-1.internal	running	gsg-keypair	0		m1.small	2010-03-09T21:28:43+0000	us-east-1c	aki-3fdb3756			monitoring-disabled	184.73.72.214	10.249.187.207			ebs<br />
BLOCKDEVICE	/dev/sda1	vol-edca1684	2010-03-09T21:24:55.000Z	</p>
<p>% ssh -i ~/.ssh/id_dsa_gsg-keypair ubuntu@ec2-184-73-72-214.compute-1.amazonaws.com<br />
(&#8230;)<br />
$ cat important-data<br />
Important data</p>
<p>$ logout<br />
Connection to ec2-184-73-72-214.compute-1.amazonaws.com closed.
</p></blockquote>
<p>It worked, and our important data is still there!</p>
<p>Don&#8217;t forget to kill the temporary instance you&#8217;ve used to fix it after you&#8217;re comfortable with the result:</p>
<blockquote><p>
% ec2-terminate-instances i-fd08d196<br />
INSTANCE	i-fd08d196	running	shutting-down
</p></blockquote>
<p><b>Conclusion</b></p>
<p>Concluding, in this post we have seen how to fix a bootable EBS machine which can&#8217;t actually boot.  The technique consists of detaching the volume from the stopped instance, attaching it to a temporary instance, fixing the image, and then reattaching it back to the original image.  This back and forth of EBS volumes is quite useful in many circumstances, so keep it in your tool belt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2010/03/09/recovering-a-bootable-ebs-image/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The last 4 years (and the next N?)</title>
		<link>http://blog.labix.org/2009/11/25/the-last-4-years-and-the-next-n</link>
		<comments>http://blog.labix.org/2009/11/25/the-last-4-years-and-the-next-n#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:16:59 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=190</guid>
		<description><![CDATA[Some interesting changes have been happening in my professional life, so I wanted to share it here to update friends and also for me to keep track of things over time (at some point I will be older and will &#8230; <a href="http://blog.labix.org/2009/11/25/the-last-4-years-and-the-next-n">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some interesting changes have been happening in my professional life, so I wanted to share it here to update friends and also for me to keep track of things over time (at some point I will be older and will certainly laugh at what I called &#8220;interesting changes&#8221; in the ol&#8217;days).  Given the goal, I apologize but this may come across as more egocentric than usual, so please feel free to jump over to your next blog post at any time.</p>
<p><span id="more-190"></span></p>
<p>It&#8217;s been little more than four years since I left <a href="http://www.conectiva.com.br">Conectiva / Mandriva</a> and joined <a href="http://www.canonical.com">Canonical</a>, in August of 2005.  Shortly after I joined, I had the luck of spending a few months working on the different projects which the company was pushing at the time, including <a href="http://launchpad.net">Launchpad</a>, then <a href="http://bazaar-vcs.org/en/">Bazaar</a>, then a little bit on some projects which didn&#8217;t end up seeing much light. It was a great experience by itself, since all of these projects were abundant in talent.  Following that, in the beginning of 2006, counting on the trust of people which knew more than I did, I was requested/allowed to lead the development of a brand new project the company wanted to attempt.  After a few months of research I had the chance to sit next to Chris Armstrong and Jamu Kakar to bootstrap the development of what is now known as the <a href="https://landscape.canonical.com">Landscape</a> distributed systems management project.</p>
<p>Fast forward three and a half years, in mid 2009, and Landscape became a massive project with hundreds of thousands of very well tested lines, sprawling not only a client branch, but also external child projects such as the <a href="https://storm.canonical.com">Storm Object Relational Mapper</a>, in use also by Launchpad and <a href="https://one.ubuntu.com">Ubuntu One</a>.  In the commercial side of things it looks like Landscape&#8217;s life is just starting, with its hosted and standalone versions getting more and more attention from enterprise customers.  And the three guys which started the project didn&#8217;t do it alone, for sure.  The toy project of early 2006 has grown to become a well structured team, with added talent spreading areas such as development, business and QA.</p>
<p>While I wasn&#8217;t watching, though, something happened.  Facing that great action, my attention was slowly being spread thinly among management, architecture, development, testing, code reviews, meetings, and other tasks, sometimes in areas not entirely related, but very interesting of course.  The net result of increased attention sprawl isn&#8217;t actually good, though.  If it persists, even when the several small tasks may be individually significant, the achievement just doesn&#8217;t feel significant given the invested effort as a whole.  At least not for someone that truly enjoys being a software architect, and loves to feel that the effort invested in the growth of a significant working software is really helping people out in the same magnitude of that investment.  In simpler words, it felt like my position within the team just wasn&#8217;t helping the team out the same way it did before, and thus it was time for a change.</p>
<p>Last July an external factor helped to catapult that change. <a href="http://www.eucalyptus.com">Eucalyptus</a> needed a feature to be released with Ubuntu 9.10, due in October, to greatly simplify the installation of some standard machine images.. an <i>Image Store</i>.  It felt like a very tight schedule, even more considering that I hadn&#8217;t been doing Java for a while, and Eucalyptus uses some sexy (and useful) new technology called  the <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a>, something I had to get acquainted with.  Two months looked like a tight schedule, and a risky bet overall, but it also felt like a great opportunity to strongly refocus on a task that needed someone&#8217;s attention urgently.  Again I was blessed with trust I&#8217;m thankful for, and by now I&#8217;m relieved to look back and perceive that it went alright, certainly thanks to the help of other people like Sidnei da Silva and Mathias Gug.  Meanwhile, on the Landscape side, my responsibilities were distributed within the team so that I could be fully engaged on the problem.</p>
<p>Moving this forward a little bit we reach the current date.  Right now the Landscape project has a new organizational structure, and it actually feels like it&#8217;s moving along quite well.  Besides the internal changes, a major organizational change also took place around Landscape over that period, and the planned restructuring led me to my current role.  In practice, I&#8217;m now engaging into the research of a new concept which I&#8217;m hoping to publish openly quite soon, if everything goes well.    It&#8217;s challenging, it&#8217;s exciting, and most importantly, allows me to focus strongly on something which has a great potential (I will stop teasing you now).  In addition to this, I&#8217;ll definitely be spending some of that time on the progress of Landscape and the Image Store, but mostly from an architectural point of view, since both of these projects will have bright hands taking care of them more closely.</p>
<p>Sit by the fireside if you&#8217;re interested in the upcoming chapters of that story. <img src='http://blog.labix.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2009/11/25/the-last-4-years-and-the-next-n/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google won&#8217;t kill standalone GPS</title>
		<link>http://blog.labix.org/2009/10/30/google-wont-kill-standalone-gps</link>
		<comments>http://blog.labix.org/2009/10/30/google-wont-kill-standalone-gps#comments</comments>
		<pubDate>Sat, 31 Oct 2009 00:17:33 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[GPS]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=184</guid>
		<description><![CDATA[It was already dead. In some senses, anyway. Google announced a couple of days ago that they&#8217;re advancing into the business of GPS guided navigation, rather than staying with their widely popular offering of mapping and positioning only. This announcement &#8230; <a href="http://blog.labix.org/2009/10/30/google-wont-kill-standalone-gps">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It was already dead.  In some senses, anyway.</p>
<p>Google <a href="http://googlemobile.blogspot.com/2009/10/announcing-google-maps-navigation-for.html">announced</a> a couple of days ago that they&#8217;re advancing into the business of GPS guided navigation, rather than staying with their widely popular offering of mapping and positioning only.  This announcement affected the rest of the industry immediately, and some of the industry leaders in the area have quickly <a href="http://www.wiseandroid.com/NewsItem.aspx?category=News&#038;path=October&#038;itemid=37">taken a hit</a> on their share value.</p>
<p>As usual, Slashdot <a href="http://mobile.slashdot.org/story/09/10/30/1459253/Will-Google-and-Android-Kill-Standalone-GPS?from=rss">caught up</a> on the news and asked the question: <i>Will Google and Android kill standalone GPS?</i></p>
<p>Let me point out that the way the facts were covered by Slashdot was quite misguided.  Google may be giving a hand to change the industry dynamics a bit faster, but both Garmin and TomTom, the companies which reportedly had an impact in their share value, have phone-based offerings of their own, so it&#8217;s not like Google suddenly had an idea for creating a phone-based navigation software which will replace every other offering.  The world is slowly converging towards a multi-purpose device for quite a while, and these multi-purpose devices are putting GPSes in the hands of people that in many cases never considered buying a GPS.</p>
<p>The real reason why these companies are taking a hit in their shares now is because Google announced it will offer for free something that these companies charge quality money for at the moment, being it in a standalone GPS or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2009/10/30/google-wont-kill-standalone-gps/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Private Cloud is not the Private Cloud</title>
		<link>http://blog.labix.org/2009/08/27/virtual-private-cloud-is-not-the-private-cloud</link>
		<comments>http://blog.labix.org/2009/08/27/virtual-private-cloud-is-not-the-private-cloud#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:12:04 +0000</pubDate>
		<dc:creator>Gustavo Niemeyer</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>

		<guid isPermaLink="false">http://blog.labix.org/?p=148</guid>
		<description><![CDATA[More than 40 years ago, a guy named Douglas Parkhill described the concept of utility computing. He described it as containing features such as: Essentially simultaneous use of the system by many remote users. Concurrent running of different multiple programs. &#8230; <a href="http://blog.labix.org/2009/08/27/virtual-private-cloud-is-not-the-private-cloud">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>More than 40 years ago, <a href="http://blog.gardeviance.org/2009/08/cloud-computing-deja-vu.html">a guy named Douglas Parkhill described the concept of utility computing.</a>  He described it as containing features such as:</p>
<blockquote>
<ul>
<li>Essentially simultaneous use of the system by many remote users.
<li>Concurrent running of different multiple programs.
<li>Availability of at least the same range of facilities and capabilities at the remote stations as the user would expect if he where the sole operator of a private computer.
<li>A system of charging based upon a flat service charge and a variable charge based on usage.
<li>Capacity for indefinite growth, so that as the customer load increases, the system can expanded without limit by various means.
</ul>
</blockquote>
<p>Fast forward 40 years, and we now name pretty much this same concept as <i>Cloud Computing</i>, and everyone is very excited about the possibilities that exist within this new world.  Different companies are pushing this idea in different ways.  One of the pioneers in that area is of course Amazon, which managed to create a quite good <i>public cloud</i> offering through their <a href="http://aws.amazon.com">Amazon Web Services</a> product.</p>
<p><span id="more-148"></span></p>
<p>This kind of publicly consumable infrastructure is very interesting, because it allows people to do exactly what Douglas Parkhill described 40 years ago, so individuals and organizations can rent computing resources with minimum initial investment, and pay for as much as they need, no more no less.</p>
<p>This is all good, but one of the details is that not every organization can afford to send data or computations to a public cloud like Amazon&#8217;s AWS.  There are many potential reasons for this, from legal regulations to volume cost.  Out of these issues the term <i>Private Cloud</i> was coined.   It basically represents exactly the same ideas that Douglas Parkhill described, but rather than using third party infrastructure, some organizations opt to use the same kind of technology, such as the <a href="http://www.eucalyptus.com">Eucalyptus project</a> deployed in a private infrastructure, so that the teams within the organization can still benefit from the mentioned features.</p>
<p>So we have the Public Cloud and the Private Cloud.  Now, what would a <i>Virtual Private Cloud</i> be?</p>
<p>Well, it turns out that this is just a <i>marketing term</i>, purposefully coined to blur the line between a Private and a Public cloud .</p>
<p>The term was used in <a href="http://aws.amazon.com/about-aws/whats-new/2009/08/26/introducing-amazon-virtual-private-cloud/">the announcement Amazon has made yesterday</a>:</p>
<blockquote><p>Amazon VPC enables enterprises to connect their existing infrastructure to a set of isolated AWS compute resources via a Virtual Private Network (VPN) connection, (&#8230;)</p></blockquote>
<p>So, what is interesting about this is that this is actually <i>not</i> a Private Cloud, because the resources on the other side of the VPN are actually <i>public</i> infrastructure, and as such it doesn&#8217;t solve any of the problems which private clouds were created for solving in the first place.</p>
<p>Not only that, but it creates the <i>false</i> impression that organizations would have their own isolated resources.  What isolated resources?  A physical computer?  Storage?  Network?  Of course, isolating these is not economically viable if you are charging 10 cents an hour per computer instance:</p>
<blockquote><p>Each month, you pay for VPN Connection-hours and the amount of data transferred via the VPN connections. VPCs, subnets, VPN gateways, customer gateways, and data transferred between subnets within the same VPC are free. Charges for other AWS services, including Amazon EC2, are billed separately at published standard rates.</p></blockquote>
<p>That doesn&#8217;t quite fit together, does it?</p>
<p>To complete the plot, <a href="http://www.allthingsdistributed.com/2009/08/amazon_virtual_private_cloud.html">Werner Vogels runs to his blog</a> and screams out loud <i>&#8220;Private Cloud is not the Cloud&#8221;</i>, while announcing the <i>Virtual Private Cloud</i> which is actually a <i>VPN</i> to his <i>Public Cloud</i>, with infrastructure shared with the world.</p>
<p>Sure.  What can I say?  Well, maybe that <i>Virtual Private Cloud is not the Private Cloud</i>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.labix.org/2009/08/27/virtual-private-cloud-is-not-the-private-cloud/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

