<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.alestic.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
    <title>Alestic.com</title>
    <link rel="alternate" type="text/html" href="http://alestic.com/" />
    
    <id>tag:alestic.com,2009-04-25://1</id>
    <updated>2012-01-05T01:38:33Z</updated>
    <subtitle>Ubuntu on Amazon EC2</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.25</generator>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.alestic.com/alestic" /><feedburner:info uri="alestic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>alestic</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry>
    <title>You Should Use EBS Boot Instances on Amazon EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/N5NZdFpXkUE/ec2-ebs-boot-recommended" />
    <id>tag:alestic.com,2012://1.134</id>

    <published>2012-01-03T19:00:00Z</published>
    <updated>2012-01-05T01:38:33Z</updated>

    <summary>EBS boot vs. instance-store If you are just getting started with Amazon EC2, then use EBS boot instances and stop reading this article. Forget that you ever heard about instance-store and accept my apology that I just mentioned it. Once...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="advice" label="advice" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebs" label="EBS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebsboot" label="EBS boot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instancestore" label="instance-store" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instances" label="instances" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;&lt;em&gt;EBS boot vs. instance-store&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you are just getting started with Amazon EC2, then use EBS boot
instances and stop reading this article.  Forget that you ever heard
about instance-store and accept my apology that I just mentioned
it.  Once you are completely comfortable with using EBS boot instances on
EC2, you may (or may not) want to come back here and read why you made
a good decision.&lt;/p&gt;

&lt;p&gt;EC2 experts may find that there are specific cases, few and far
between, where instance-store might make sense, but they don&amp;#8217;t attempt
to use instance-store without understanding and accounting for all the
serious drawbacks and dangers that go with making this choice.  For
example, experts using instance-store don&amp;#8217;t mind losing all of the
data on the instance as they have designed the system so that the data
is stored elsewhere and so that a new instance can easily and
automatically be rebuilt from scratch.&lt;/p&gt;

&lt;p&gt;One of the challenges for beginners is that many of the benefits of
EBS boot don&amp;#8217;t necessarily seem like something you&amp;#8217;ll need to use
right away.  Then they get down the road and into situations where
they realize that they would have been much better off if they had
gone with EBS boot in the first place and may find it takes some work
to make the transition.&lt;/p&gt;

&lt;h2&gt;Big benefits of EBS boot instances&lt;/h2&gt;

&lt;p&gt;Here are some of the reasons I use and recommend EBS boot instances.
None of these benefits are available with instance-store, so even a
single one of these can be an overriding factor for choosing EBS boot.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;EBS boot instances store the root file system on an EBS volume
which is persistent storage.  If the instance hardware fails, the
EBS volume remains accessible.  It is also possible to request the
EBS volume to persist beyond the termination of an EC2 instance.
&lt;em&gt;When an instance-store instance fails or is shut down, all of the
data on the root disk is lost forever and can never be retrieved.&lt;/em&gt;
Read more about &lt;a href="http://alestic.com/2010/01/ec2-instance-locking"&gt;protecting EC2 instances from accidental
termination and loss of data&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EBS boot instances can be stopped and restarted at will.  The
&amp;#8220;stopped&amp;#8221; state suspends the hourly instance billing charges,
preserving the information on the EBS volumes.  The stopped
instance can be started again a few minutes later or months later,
restoring state just as if the instance was rebooted.  &lt;em&gt;An
instance-store instance can only be left running with full charges
or terminated, which causes you to lose all data on the disk.&lt;/em&gt; Read
more about &lt;a href="http://alestic.com/2011/09/ec2-reboot-stop-start"&gt;how stop/start of an EBS boot instance is similar to
and different from a simple reboot&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When something goes wrong with an EBS boot instance so that it
can&amp;#8217;t be booted, or you lose access through ssh (e.g., lost keys,
bad ssh config change), you can still view and modify or fix the
EBS root volume by attaching it to another running instance.  &lt;em&gt;With
an instance-store instance, everything on the root disk is lost and
cannot be recovered.&lt;/em&gt; Read more about &lt;a href="http://alestic.com/2011/02/ec2-fix-ebs-root"&gt;fixing files on the root EBS
volume of an EC2 instance&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EBS boot instances can be run with a root EBS volume size from the
default specified by the AMI (often 8GB) up to 1,000GB (1TB).  &lt;em&gt;The
instance-store AMIs have a max root disk size of 10GB with no way
to increase it.&lt;/em&gt; Read more about &lt;a href="http://alestic.com/2009/12/ec2-ebs-boot-resize"&gt;increasing the root disk size of
an EBS boot AMI&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is possible to grow the size of the root disk after an EBS boot
instance has been started. &lt;em&gt;An instance-store instance has no way
to grow the root disk size.&lt;/em&gt; Read more about &lt;a href="http://alestic.com/2010/02/ec2-resize-running-ebs-root"&gt;resizing the root
disk on a running EBS boot EC2 instance&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is possible to change the instance type for a running EBS boot
instance without needing to start a new instance.  For example, you
can scale up from an m1.large to an m1.xlarge and then a few hours
or days later, scale back down.  &lt;em&gt;An instance-store instance is
stuck with the type on which it was originally run.&lt;/em&gt; Read more
about &lt;a href="http://alestic.com/2011/02/ec2-change-type"&gt;changing the instance type of a running EBS boot
instance&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can easily replace the hardware for your instance if you are
running an EBS boot instance.  This is extremely valuable if your
instance is having problems that you suspect may be related to the
underlying hardware.  &lt;em&gt;An instance-store instance is bound to the
hardware it started on and cannot be moved.&lt;/em&gt; Read more about &lt;a href="http://alestic.com/2011/02/ec2-move-hardware"&gt;using
stop/start to replace EC2 hardware&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EBS boot AMIs are simpler and faster to create than instance-store
AMIs.  In fact, you can trigger the creation of an EBS boot AMI
from a running instance in one command, API call, or console click.
&lt;em&gt;You need to copy sensitive AWS credentials to the instance when
creating an instance-store AMI.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon has stated that EBS boot AMIs boot up faster than S3 based
AMIs (instance-store).  In my recent experience, the difference is
negligible, especially when testing popular AMIs that are likely to
be cached, but we might as well chalk this up as another benefit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The t1.micro instance type released recently by Amazon only
supports EBS boot instances.  This move is like a sign from Amazon
that you really don&amp;#8217;t want to run the legacy instance-store
instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some versions of Windows (Server 2008) only run on EBS boot instances.  I believe this may be related to the disk size limitations of instance-store, but I don&amp;#8217;t use Windows, so am not an expert in that area.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Possible benefits of instance-store instances&lt;/h2&gt;

&lt;p&gt;EBS volumes and EBS boot instances aren&amp;#8217;t perfect.  Running an
instance-store instance might be preferable in some very specific
cases where you don&amp;#8217;t care so much about losing the data you are
storing on the root disk.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m going to list some of the possible benefits of instance-store, but
each of these may not be as beneficial as they appear at first glance
and you must remember that running instance-store loses all of the
above benefits.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There is a negigible cost savings with instance-store, as there is
 no charge for an EBS volume nor the I/O transactions.  &lt;em&gt;Note
 however, that the cost for an 8GB root EBS volume is only around 80
 cents per month (depending on the region) and you get about a
 billion I/O requests for a dollar, billed by the penny increment.
 The cost savings to run instance-store is generally not worth the
 increased risk of losing your valuable data, especially when you
 compare it as a percentage of the cost of running the instance
 hours in the first place (tens or hundreds of dollars per month).&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There may be some applications that perform somewhat better when
 running against ephemeral or instance-store disks than against EBS
 volumes.  Some high end users have also reported inconsistency
 in the performance they see from EBS volumes at high I/O transaction
 rates for long periods of time.
 &lt;em&gt;EBS volumes perform better for some applications and are
 generally good enough for most applications.  If you don&amp;#8217;t care
 about losing your application data, and you have tested to see that
 instance-store performs better than EBS volumes, then you could
 either run instance-store instances, or you could run EBS boot
 instances and drop your data on the ephemeral disks available to
 all instances above t1.micro.  It is also becoming increasingly popular
 to run multiple EBS volumes in a mdadm RAID-0 or LVM striping
 configuration to improve performance and smooth out some
 experiences of performance volatility.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are a couple historical failure modes that have happened with
 EBS volumes that could not happen for instance-store disks.  &lt;em&gt;You
 may hear people say this is a reason not to use EBS volumes, but
 EBS volumes are still far more reliable, persistent, and protected
 against failure than instance-store.  The fact that it is possible
 for EBS to fail is not a reason to use the less persistent
 instance-store.  It is a reason to create regular snapshots of your
 EBS volumes to improve reliability and act as backups.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are creating a &amp;#8220;paid AMI&amp;#8221; you can only do it as an
 instance-store AMI, not EBS boot.  &lt;em&gt;Only two of the thousands of
 people reading this article are creating paid AMIs and they already
 know this fact.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Why did I write this article?&lt;/h2&gt;

&lt;p&gt;I regularly provide consulting services in public communities like
&lt;a href="http://alestic.com/2011/09/ec2-serverfault"&gt;serverfault&lt;/a&gt;, the ##aws IRC channel on Freenode, the
&lt;a href="http://groups.google.com/group/ec2ubuntu"&gt;ec2ubuntu Google group&lt;/a&gt;, and Amazon&amp;#8217;s &lt;a href="https://forums.aws.amazon.com/forum.jspa?forumID=30"&gt;EC2 forum&lt;/a&gt;.
It&amp;#8217;s a rare week that passes where I am not telling somebody that they
would not have the problem they&amp;#8217;re having if they had been using EBS
boot instances.&lt;/p&gt;

&lt;p&gt;The saddest response I can give to a plea for help is that the
customer&amp;#8217;s valuable data has been lost because they were running
instance-store instead of EBS boot and they did not have real-time
streaming backups.&lt;/p&gt;

&lt;h2&gt;Historical background&lt;/h2&gt;

&lt;p&gt;When Amazon launched EC2 in 2006, only instance-store AMIs were
available (though they weren&amp;#8217;t called instance-store at the time as
they were the only kind).  For years, Amazon customers learned to work
with the server limitations of risking the loss of all data at any
point in time.&lt;/p&gt;

&lt;p&gt;In August of 2008, Amazon introduced the concept of EBS volumes, and
there was much rejoicing.  Data could finally be stored on persistent
disks even though the root disk remained on ephemeral storage
(another name for instance-store).&lt;/p&gt;

&lt;p&gt;In December of 2009, Amazon released the ability to launch instances
with EBS volumes as the root disk, or EBS boot instances.  Now, the
entire server could be persistent and all of the above benefits were
realized.&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;p&gt;Just because EBS boot volumes are &amp;#8220;persistent&amp;#8221; does not mean that they
do not ever fail.  Amazon has released figures about their failure
rates, which are proportional to the number of blocks modified since
the last EBS snapshot was created.  Regular snapshots improve the
intrinsic reliability of your EBS volumes in addition to acting as
backups.  I also recommend creating regular off-site backups (outside
of Amazon) to eliminate your AWS account as a single point of
failuire.&lt;/p&gt;

&lt;p&gt;Even if you use an EBS boot instance, I still recommend keeping your
data on a separate EBS volume.  This has a number of benefits that
could perhaps form the core of a followup article.  Read &lt;a href="http://aws.amazon.com/articles/1663"&gt;an example
of how to set up a MySQL database on a separate EBS boot volume&lt;/a&gt;.
I still follow this approach with EBS boot instances, storing data on a second volume.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;[Update 2011-01-04: Added benefit #11 (Windows Server 2008).  Added note about potential (in)consistency of EBS IO at sustained, high rates.]&lt;/em&gt;&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2012/01/ec2-ebs-boot-recommended"&gt;http://alestic.com/2012/01/ec2-ebs-boot-recommended&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/N5NZdFpXkUE" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2012/01/ec2-ebs-boot-recommended</feedburner:origLink></entry>

<entry>
    <title>Retrieve Public ssh Key From EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/S2phPfJZNKg/ec2-public-ssh-key" />
    <id>tag:alestic.com,2011://1.133</id>

    <published>2011-12-20T14:00:00Z</published>
    <updated>2011-12-20T05:54:40Z</updated>

    <summary>A serverfault poster had a problem that I thought was a cool challenge. I had so much fun coming up with this answer, I figured I’d share it here as it demonstrates a few handy features of EC2. Challenge The...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="challenges" label="challenges" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ssh" label="ssh" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="userdata" label="user-data" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="userdatascript" label="user-data script" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;A serverfault poster had &lt;a href="http://serverfault.com/questions/342530/how-to-download-public-key-from-amazon-aws/342615#342615"&gt;a problem&lt;/a&gt; that I thought was a cool challenge.  I had so much fun coming up with this answer, I figured I&amp;#8217;d share it here as it demonstrates a few handy features of EC2.&lt;/p&gt;

&lt;h2&gt;Challenge&lt;/h2&gt;

&lt;p&gt;The basic need is to get the public ssh key from a keypair that exists inside of EC2.  You don&amp;#8217;t have access to the private key at the moment (but somebody else does or you will at a different location).&lt;/p&gt;

&lt;p&gt;The AWS console and EC2 API do not let you ask for the public ssh key associated with a keypair.  However, EC2 does pass the public ssh key to a new EC2 instance when you run it with a specific keypair.&lt;/p&gt;

&lt;p&gt;The problem is that we don&amp;#8217;t currently have the private key, so we can&amp;#8217;t log in to the EC2 instance to get the public key.  (Besides, if we did have the private key, we could extract the public key from it directly.)&lt;/p&gt;

&lt;h2&gt;Solution&lt;/h2&gt;

&lt;p&gt;I proposed creating a user-data script that sends the public ssh key to the EC2 instance console output.  You can retrieve the console output without logging in to the EC2 instance.&lt;/p&gt;

&lt;p&gt;Save the following code to a file named &lt;code&gt;output-ssh-key.userdata&lt;/code&gt; on your local computer.  DO NOT RUN THESE COMMANDS LOCALLY!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/bash -ex
exec&amp;gt; &amp;gt;(tee /var/log/user-data.log|logger -t user -s 2&amp;gt;/dev/console) 2&amp;gt;&amp;amp;1
adminkey=$(GET instance-data/latest/meta-data/public-keys/ | 
  perl -ne 'print $1 if /^0=[^a-z0-9]*([-.@\w]*)/i')
cat &amp;lt;&amp;lt;EOF
SSHKEY:===================================================================
SSHKEY:HERE IS YOUR PUBLIC SSH KEY FOR KEYPAIR "$adminkey":
SSHKEY:$(cat /home/ubuntu/.ssh/authorized_keys)
SSHKEY:===================================================================
SSHKEY:Halting in 50min ($(date --date='+50 minutes' +"%Y-%m-%d %H:%M UTC"))
EOF
sleep 3000
halt
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run a stock Ubuntu 10.04 LTS instance with the above file as a &lt;a href="http://alestic.com/2009/06/ec2-user-data-scripts"&gt;user-data script&lt;/a&gt;.  Specify the keypair for which you want to retrieve the public ssh key:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ec2-run-instances \
  --key YOURKEYPAIRHERE \
  --instance-type t1.micro \
  --instance-initiated-shutdown-behavior terminate \
  --user-data-file output-ssh-key.userdata \
  ami-ab36fbc2
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Keep requesting the console output from the instance until it shows your public ssh key.  Specify the instance id returned from the run-instances command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ec2-get-console-output YOURINSTANCEID | grep SSHKEY: | cut -f3- -d:
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Repeat the above command a couple times a minute and within 2-10 minutes you will get output like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;===================================================================
HERE IS YOUR PUBLIC SSH KEY FOR KEYPAIR "erich":
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6rn8cl41CkzaH4ZBhczOJZaR4xBBDI1Kelc2ivzVvCB
THcdJRWpDd5I5hY5W9qke9Tm4fH3KaUVndlcP0ORGvS3PAL4lTpkS4D4goMEFrwMO8BG0NoE8sf2U/7g
aUkdcrDC7jzKYdwleRCI3uibNXiSdeG6RotClAAp7pMflDVp5WjjECDZ+8Jzs2wasdTwQYPhiWSiNcfb
fS97QdtROf0AcoPWElZAgmabaDFBlvvzcqxQRjNp/zbpkFHZBSKp+Sm4+WsRuLu6TDe9lb2Ps0xvBp1F
THlJRUVKP2yeZbVioKnOsXcjLfoJ9TEL7EMnPYinBMIE3kAYw3FzZZFeX3Q== erich
===================================================================
Halting in 50min (2011-12-20 05:58 UTC)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The temporary instance will automatically terminate itself in under an hour, but you can terminate it yourself if you&amp;#8217;d like to make sure that you aren&amp;#8217;t charged more than the two cents this will cost to run.&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you currently have access to the private ssh key (not true in the above challenge) you can extract the public ssh key using a command like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh-keygen -y -f KEYFILE.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but that&amp;#8217;s obviously not as fun.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is no way to retrieve the &lt;em&gt;private ssh key&lt;/em&gt; if you have lost it.  To protect your security, Amazon EC2 does not store a copy of this.  If you are looking to get access to an EC2 instance where you have lost the private ssh key, I recommend following the approach I wrote about in this article: &lt;a href="http://alestic.com/2011/02/ec2-fix-ebs-root"&gt;http://alestic.com/2011/02/ec2-fix-ebs-root&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In seemingly-related-but-not news, Scott Moser is working on &lt;a href="https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/893400"&gt;an enhancement to cloud-init&lt;/a&gt; (used by Ubuntu on EC2, Amazon Linux, and perhaps others) so that the &lt;em&gt;public ssh host keys&lt;/em&gt; are output to the console output on instance startup.  This cool feature will allow us to add the ssh host keys to our local known_hosts files, safely avoiding that pesky &lt;em&gt;&amp;#8220;Are you sure you want to continue connecting (yes/no)?&amp;#8221;&lt;/em&gt; warning.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/12/ec2-public-ssh-key"&gt;http://alestic.com/2011/12/ec2-public-ssh-key&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/S2phPfJZNKg" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/12/ec2-public-ssh-key</feedburner:origLink></entry>

<entry>
    <title>Running EC2 Instances on a Recurring Schedule with Auto Scaling</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/kpoYn0_2ElE/ec2-schedule-instance" />
    <id>tag:alestic.com,2011://1.132</id>

    <published>2011-11-15T13:00:00Z</published>
    <updated>2011-11-15T05:47:44Z</updated>

    <summary>Do you want to run short jobs on Amazon EC2 on a recurring schedule, but don’t want to pay for an instance running all the time? Would you like to do this using standard Amazon AWS services without needing an...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="autoscaling" label="Auto Scaling" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cron" label="cron" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scheduling" label="scheduling" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="userdata" label="user-data" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="userdatascripts" label="user-data scripts" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;Do you want to run short jobs on Amazon EC2 on a recurring schedule, but
don&amp;#8217;t want to pay for an instance running all the time?&lt;/p&gt;

&lt;p&gt;Would you like to do this using standard Amazon AWS services without
needing an external server to run and terminate the instance?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://aws.amazon.com/autoscaling/"&gt;Amazon EC2 Auto Scaling&lt;/a&gt; is normally used to keep a
reasonable number of instances running to handle measured or expected
load (e.g., web site traffic, queue processing).&lt;/p&gt;

&lt;p&gt;In this article I walk through the steps to create an Auto Scaling
configuration that runs an instance on a recurring schedule (e.g.,
four times a day) starting up a pre-defined task and letting that
instance shut itself down when it is finished.  We tweak the Auto
Scaling group so that this uses the minumum cost in instance run time,
even though we may not be able to predict in advance exactly how long
it will take to complete the job.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a high level overview for folks familiar with Auto Scaling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The instance is started using a recurring schedule action that
raises the min and max to 1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The launch configuration is set to pass in a user-data script that
runs the desired job on first boot.  There&amp;#8217;s no need to build our
own AMI unless the software installation takes too long.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The user-data script runs shutdown at the end to move the instance
to the &amp;#8220;stopped&amp;#8221; state, suspending hourly run charges.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Another recurring schedule action lowers the min and max to 0.
This is done long after the job should have completed, just to
clean up the stopped instance or to terminate an instance that
perhaps failed to shut itself down.  It also resets the min/max
count so a new instance will be started the next time they are
raised.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The missing key I found through experimentation is that we need to
also suspend Auto Scaling&amp;#8217;s (usually valid) desire to replace any
unhealthy instances.  If we don&amp;#8217;t turn off this behavior, Auto Scaling
will start another instance as soon as the first one shuts itself
down, causing the job to be run over and over.&lt;/p&gt;

&lt;h2&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;The examples in this article assume that you have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Installed and set up the EC2 command line tools&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Installed and set up the EC2 Auto Scaling command line tools&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tell EC2 about your ssh keys using the approach described here:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://alestic.com/2010/10/ec2-ssh-keys"&gt;Uploading Personal ssh Keys to Amazon EC2&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;User-data Script&lt;/h2&gt;

&lt;p&gt;The first step in setting up this process is to create a &lt;a href="http://alestic.com/2009/06/ec2-user-data-scripts"&gt;user-data
script&lt;/a&gt; that performs the tasks you want your scheduled
instance to execute each time it runs.&lt;/p&gt;

&lt;p&gt;This user-data script can do anything you want as long as it runs this
command after all the work has beeen completed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;shutdown -h now
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have created a &lt;a href="https://raw.github.com/alestic/demo-ec2-schedule-instance/master/user-data/demo-user-data-script.sh"&gt;demo user-data script&lt;/a&gt; for this article
which you can download to your local computer now, saving it as
&lt;code&gt;demo-user-data-script.sh&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;wget -q https://raw.github.com/alestic/demo-ec2-schedule-instance/master/user-data/demo-user-data-script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;WARNING: Do not attempt to run this user-data script on your local computer!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Edit the downloaded &lt;code&gt;demo-user-data-script.sh&lt;/code&gt; file and change this
line at the top of the script to reflect your email address:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;EMAIL=youraddress@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This demo user-data script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Upgrades the Ubuntu instance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Installs Postfix with a generic configuration so that it can send email&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sends you a demo informative message about the instance at the
email address you edited in the script.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sleeps for 5 minutes giving the email a chance to be delivered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shuts down the EC2 instance&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first time you run this demo, try using the script as it stands,
only changing your email address.  Then, try adjusting the script
little by little to make it do tasks that you would find more useful.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;d like, you can test the user-data script by itself running an
instance of Ubuntu 11.10.  Please update the AMI id to use the &lt;a href="http://alestic.com/"&gt;latest
release&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ami_id=ami-a7f539ce # Ubuntu 11.10 Oneiric server
ec2-run-instances \
  --key $USER \
  --instance-type t1.micro \
  --instance-initiated-shutdown-behavior terminate \
  --user-data-file demo-user-data-script.sh \
  $ami_id
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You should see an email from the instance and then it should terminate
itself about 5 minutes later.  Make sure you terminate it manually if
it stays running after 10 minutes.&lt;/p&gt;

&lt;h2&gt;Auto Scaling Group&lt;/h2&gt;

&lt;p&gt;With the user-data script in hand, we are now ready to create the Auto
Scaling setup.&lt;/p&gt;

&lt;p&gt;Set some variables used in the commands below.  Make sure you are
using the latest release of the appropriate AMI.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ami_id=ami-a7f539ce # Ubuntu 11.10 Oneiric server
region=us-east-1    # Region for running the demo

zone=${region}a     # A zone in that region
export EC2_URL=https://$region.ec2.amazonaws.com
export AWS_AUTO_SCALING_URL=https://autoscaling.$region.amazonaws.com
launch_config=demo-launch-config
auto_scale_group=demo-auto-scale-group
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This lauch configuration describes how we want our instance run each
time including the AMI id, instance type, ssh key, and most
importantly, our user-data script we edited above:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-create-launch-config \
  --key $USER \
  --instance-type t1.micro \
  --user-data-file demo-user-data-script.sh \
  --image-id $ami_id \
  --launch-config "$launch_config"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The Auto Scaling group keeps track of many things including how many
instances we want to have running, how they should be run (launch
config above), and what instances are currently running.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-create-auto-scaling-group \
  --auto-scaling-group "$auto_scale_group" \
  --launch-configuration "$launch_config" \
  --availability-zones "$zone" \
  --min-size 0 \
  --max-size 0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here&amp;#8217;s a non-obvious but key part of this approach!  Tell the Auto
Scaling group that we don&amp;#8217;t want it to restart our instance right
after the instance intentionally shuts down (or fails):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-suspend-processes \
  "$auto_scale_group" \
  --processes ReplaceUnhealthy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we&amp;#8217;re finally ready to tell EC2 Auto Scaling when we want to run
the instance launch configuration in the Auto Scaling group.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s an example that starts one instance four times a day to run the
above user-data script:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# UTC: 1:00, 7:00, 13:00, 19:00
as-put-scheduled-update-group-action \
  --name "demo-schedule-start" \
  --auto-scaling-group "$auto_scale_group" \
  --min-size 1 \
  --max-size 1 \
  --recurrence "0 01,07,13,19 * * *"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And, we need to create a matching action to make sure the instance is
terminated at some point after the longest time the job could take.  For
this demo, we&amp;#8217;ll trigger it 55 minutes later, but it could just as
easily be 3 hours and 55 minutes later:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# UTC: 1:55, 7:55, 13:55, 19:55
as-put-scheduled-update-group-action \
  --name "demo-schedule-stop" \
  --auto-scaling-group "$auto_scale_group" \
  --min-size 0 \
  --max-size 0 \
  --recurrence "55 01,07,13,19 * * *"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The recurrence value is in a &lt;a href="http://en.wikipedia.org/wiki/Cron"&gt;cron format&lt;/a&gt; using UTC.  &lt;/p&gt;

&lt;p&gt;You are welcome to change the specs in the above commands to any time
you want to run the demo, especially if you don&amp;#8217;t want to wait up to
six hours for it to trigger.&lt;/p&gt;

&lt;p&gt;Before setting new schedules, make sure you delete the existing
schedule (see the next section).  Don&amp;#8217;t forget to make the stop
time(s) match up appropriately with the start time(s).&lt;/p&gt;

&lt;h2&gt;Clean up&lt;/h2&gt;

&lt;p&gt;Once you&amp;#8217;re done with this demo, you can delete the AWS resources we
created by following these steps:&lt;/p&gt;

&lt;p&gt;Delete the schedule start and stop actions:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-delete-scheduled-action \
  --force \
  --name "demo-schedule-start" \
  --auto-scaling-group "$auto_scale_group"
as-delete-scheduled-action \
  --force \
  --name "demo-schedule-stop" \
  --auto-scaling-group "$auto_scale_group"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Scale the Auto Scaling group down to zero instances.  This will
terminate any running instances:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-update-auto-scaling-group \
  "$auto_scale_group" \
  --min-size 0 \
  --max-size 0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Delete the Auto Scaling group&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-delete-auto-scaling-group \
  --force-delete \
  --auto-scaling-group "$auto_scale_group"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Delete the Auto Scaling launch config:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-delete-launch-config \
  --force \
  --launch-config "$launch_config"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You might now want to check to make sure nothing was left over.  This
works best in a wide terminal:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;as-describe-launch-configs --headers
as-describe-auto-scaling-groups --headers
as-describe-scheduled-actions --headers
as-describe-auto-scaling-instances --headers
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Timing&lt;/h2&gt;

&lt;p&gt;Everything takes a little time to filter through the system including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;scheduled action to raise min/max&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;triggering the start of an instance after a min/max is raised&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;starting an instance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;booting an instance, installing software&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;running your job&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;shutting down an instance&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;scheduled action to lower min/max&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;triggering the termination of an instance after a min/max is lowered&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you set up the schedules, remember to make room for these
things. For example, don&amp;#8217;t schedule the termination of your instance
too early or it could kill your job before it has a chance to
complete.&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;p&gt;Here are some great resources from Amazon for getting started with
and learning about Auto Scaling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://docs.amazonwebservices.com/AutoScaling/latest/GettingStartedGuide/"&gt;Auto Scaling Getting Started Guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://docs.amazonwebservices.com/AutoScaling/latest/DeveloperGuide/"&gt;Auto Scaling Developer Guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The user-data script logging uses the approach described here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://alestic.com/2010/12/ec2-user-data-output"&gt;Logging user-data Script Output on EC2 Instances&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Watching the output of the user-data script lets you monitor its
progress as well as debug where things might be going wrong.&lt;/p&gt;

&lt;p&gt;I haven&amp;#8217;t run the above approach except in testing, and would welcome
any pointers or improvements folks might have to offer.&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/11/ec2-schedule-instance"&gt;http://alestic.com/2011/11/ec2-schedule-instance&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/kpoYn0_2ElE" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/11/ec2-schedule-instance</feedburner:origLink></entry>

<entry>
    <title>AWS Virtual MFA and the Google Authenticator for Android</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/JxyT0wpRQXA/aws-virtual-mfa" />
    <id>tag:alestic.com,2011://1.131</id>

    <published>2011-11-03T03:41:00Z</published>
    <updated>2011-11-03T03:55:56Z</updated>

    <summary>Amazon just announced that the AWS MFA (multi-factor authentication) now supports virtual or software MFA devices in addition to the physical hardware MFA devices like the one that’s been taking up unwanted space in my pocket for two years. Multi-factor...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="aws" label="AWS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="googleauthenticator" label="Google Authenticator" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mfa" label="MFA" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="security" label="security" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="virtualmfa" label="Virtual MFA" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;Amazon &lt;a href="http://aws.typepad.com/aws/2011/11/new-virtual-software-multi-factor-authentication-rfc-6238-support.html"&gt;just announced&lt;/a&gt; that the AWS MFA (multi-factor authentication) now supports virtual or software MFA devices in addition to the physical hardware MFA devices like the one that&amp;#8217;s been taking up unwanted space in my pocket for two years.&lt;/p&gt;

&lt;p&gt;Multi-factor authentication means that in order to log in to my AWS account using the AWS console or portal (including the AWS forums) you not only need my secret password, you also need access to a device that I carry around with me.&lt;/p&gt;

&lt;p&gt;Before, this was a physical device attached to my key ring.  Now, this is my smart phone which has the virtual (software) MFA device on it.  I already carry my phone with me, so the software doesn&amp;#8217;t take up any additional space.&lt;/p&gt;

&lt;p&gt;To log in to AWS, I enter my password and then the current 6 digit access code displayed by the Android app on my phone.  These digits change every 30 seconds in an unguessable pattern, so this enhances the security of my AWS account.&lt;/p&gt;

&lt;p&gt;I started by using Amazon&amp;#8217;s AWS Virtual MFA app for my Android phone, but had some complaints about it including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You have to click on an account name to see the current digits instead of just having them shown when the app is run. There&amp;#8217;s nothing else for the app to do but show me these digits.  Just do it!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The digits disappear from the screen too fast.  Sometimes I want to glance back and see if I typed them in correctly, but they&amp;#8217;re gone and I have to click again, hoping that they haven&amp;#8217;t changed yet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It&amp;#8217;s hard to choose your own account names so that you know which entry to use for different AWS accounts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I then noticed some cryptic information in the announcements: the new feature will work with &amp;#8220;any application that supports the open OATH TOTP standard&amp;#8221;.&lt;/p&gt;

&lt;p&gt;Hmmm&amp;#8230;&lt;/p&gt;

&lt;p&gt;Sure &amp;#8216;nuff!  &lt;/p&gt;

&lt;p&gt;I already use the &lt;a href="https://market.android.com/details?id=com.google.android.apps.authenticator"&gt;Google Authenticator&lt;/a&gt; app on my Android phone so that my Google logins can use MFA.  As it turns out, Google Authenticator also works seamlessly with AWS Virtual MFA.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Google Authenticator shows the codes as soon as it is run with a little timer showing me when they will change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google Authenticator lets me easily edit the displayed name so that I know at a glance which code is for my personal AWS account and which one is for my company AWS account.  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This also means that I only have to run one app to get access to my devices for Google accounts and for AWS accounts.  Amazon may improve their Android app over time, but by using open standards users can pick whatever works best for them at the time.&lt;/p&gt;

&lt;p&gt;I love the fact that Amazon now supports Virtual MFA.  I&amp;#8217;ve already thrown away my hardware token and my pocket feels less full.&lt;/p&gt;

&lt;p&gt;I love the fact that Amazon implemented this as a service based on existing standards so that I can use Google&amp;#8217;s Android app to access my account.&lt;/p&gt;

&lt;p&gt;I love open standards.&lt;/p&gt;

&lt;p&gt;Update:  I just found this great starting page which even links to Google Authenticator as a client for Android and iPhone:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://aws.amazon.com/mfa/"&gt;http://aws.amazon.com/mfa/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/11/aws-virtual-mfa"&gt;http://alestic.com/2011/11/aws-virtual-mfa&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/JxyT0wpRQXA" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/11/aws-virtual-mfa</feedburner:origLink></entry>

<entry>
    <title>Updated EBS boot AMIs for Ubuntu 8.04 Hardy on Amazon EC2 (2011-10-06)</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/EsmOG7yhAMA/ec2-hardy-ebs" />
    <id>tag:alestic.com,2011://1.130</id>

    <published>2011-10-08T03:45:00Z</published>
    <updated>2011-10-07T10:24:47Z</updated>

    <summary>Canonical has released updated instance-store AMIs for Ubuntu 8.04 LTS Hardy on Amazon EC2. Read Ben Howard’s announcement on the ec2ubuntu Google group. I have released corresponding EBS boot AMIs for Ubuntu 8.04 LTS Hardy using the exact same image...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="804" label="8.04" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ami" label="AMI" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebsboot" label="EBS boot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hardy" label="Hardy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="images" label="images" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instancestore" label="instance-store" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;Canonical has released updated instance-store AMIs for Ubuntu 8.04 LTS Hardy on Amazon EC2. Read &lt;a href="http://groups.google.com/group/ec2ubuntu/browse_thread/thread/f564626478aa117"&gt;Ben Howard&amp;#8217;s announcement&lt;/a&gt; on the ec2ubuntu Google group.&lt;/p&gt;

&lt;p&gt;I have released corresponding EBS boot AMIs for Ubuntu 8.04 LTS Hardy using the exact same image Canonical used to build the instance-store AMIs.&lt;/p&gt;

&lt;p&gt;You can find the AMI ids for Canonical&amp;#8217;s AMIs and for the AMIs I just built in the table at the top of &lt;a href="http://alestic.com"&gt;Alestic.com&lt;/a&gt;. Just click on the region you are using to see the ids.&lt;/p&gt;

&lt;p&gt;The updated code I used to build the EBS boot AMIs by downloading Canonical&amp;#8217;s images is &lt;a href="https://github.com/alestic/alestic-hardy-ebs"&gt;available on github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re not already using the venerable Ubuntu Hardy, please start with a more modern release, like Ubuntu 10.04 LTS Lucid or Ubuntu 11.04 Natty.&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/10/ec2-hardy-ebs"&gt;http://alestic.com/2011/10/ec2-hardy-ebs&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/EsmOG7yhAMA" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/10/ec2-hardy-ebs</feedburner:origLink></entry>

<entry>
    <title>New Release of Alestic Git Server</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/qyKZkglvvz4/ec2-git-server-release" />
    <id>tag:alestic.com,2011://1.129</id>

    <published>2011-10-05T01:13:36Z</published>
    <updated>2011-10-05T01:44:44Z</updated>

    <summary>New AMIs have been released for the Alestic Git Server. Major upgrade points include: Base operating system upgraded to Ubuntu 11.04 Natty Git upgraded to version 1.7.4.1 gitolite upgraded to version 2.1 (master branch) You can find the latest Alestic...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="alesticgitserver" label="Alestic Git Server" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="git" label="Git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gitolite" label="gitolite" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;New AMIs have been released for the &lt;a href="http://alestic.com/alestic-git/"&gt;Alestic Git Server&lt;/a&gt;.  Major upgrade points include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Base operating system upgraded to Ubuntu 11.04 Natty&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Git upgraded to version 1.7.4.1&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;gitolite upgraded to version 2.1 (master branch)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find the latest Alestic Git Server AMI ids and documentation at:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/alestic-git/"&gt;http://alestic.com/alestic-git/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Questions and comments are welcomed on the &lt;a href="http://groups.google.com/group/alestic-git"&gt;Alestic Git group&lt;/a&gt;.&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/10/ec2-git-server-release"&gt;http://alestic.com/2011/10/ec2-git-server-release&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/qyKZkglvvz4" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/10/ec2-git-server-release</feedburner:origLink></entry>

<entry>
    <title>Using ServerFault.com for Amazon EC2 Q&amp;A</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/QN6pCxZ5_bw/ec2-serverfault" />
    <id>tag:alestic.com,2011://1.127</id>

    <published>2011-09-26T20:45:00Z</published>
    <updated>2011-10-03T21:06:50Z</updated>

    <summary>The Amazon EC2 Forum has been around since the beginning of EC2 and has always been a place where you can get your EC2 questions in front of an audience of experts and Amazon employees. Though I’m still listed as...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="serverfault" label="ServerFault" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stackexchange" label="StackExchange" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="support" label="support" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;The &lt;a href="https://forums.aws.amazon.com/forum.jspa?forumID=30&amp;amp;start=0"&gt;Amazon EC2 Forum&lt;/a&gt; has been around since the beginning of EC2 and has always been a place where you can get your EC2 questions in front of an audience of experts and Amazon employees.  &lt;/p&gt;

&lt;p&gt;Though I&amp;#8217;m still listed as one of the top posters (scored by questioners marking my answers as helpful) I&amp;#8217;ve slowed down my activity on that forum due to the sheer volume of support requests, many of which are commonly asked questions or things that only Amazon can help with.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve started answering Amazon EC2 related questions on Stack Exchange sites like Server Fault, a place where system administrators can get questions answered by experts.  Here&amp;#8217;s my profile on serverfault which linkes to answers I&amp;#8217;ve posted. Click &amp;#8220;newest&amp;#8221; to see the most recent.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://serverfault.com/users/30542/eric-hammond"&gt;http://serverfault.com/users/30542/eric-hammond&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you use an RSS reader, you can follow a feed for all questions tagged amazon-ec2:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;[RSS] &lt;a href="http://serverfault.com/feeds/tag/amazon-ec2"&gt;http://serverfault.com/feeds/tag/amazon-ec2&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can even follow all new answers posted by an individual like, say, that Eric Hammond fellow:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;[RSS] &lt;a href="http://serverfault.com/feeds/user/30542"&gt;http://serverfault.com/feeds/user/30542&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/09/ec2-serverfault"&gt;http://alestic.com/2011/09/ec2-serverfault&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/QN6pCxZ5_bw" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/09/ec2-serverfault</feedburner:origLink></entry>

<entry>
    <title>Rebooting vs. Stop/Start of Amazon EC2 Instance</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/MOdE8w9rsVc/ec2-reboot-stop-start" />
    <id>tag:alestic.com,2011://1.126</id>

    <published>2011-09-24T14:00:00Z</published>
    <updated>2011-11-22T01:32:59Z</updated>

    <summary>When you reboot a physical computer at your desk it is very similar to shutting down the system, and booting it back up. With Amazon EC2, rebooting an instance is much the same as with a local physical computer, but...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ebsboot" label="EBS boot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instances" label="instances" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="reboot" label="reboot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="start" label="start" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stop" label="stop" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="terminate" label="terminate" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;When you reboot a physical computer at your desk it is very similar to shutting down the system, and booting it back up.  With Amazon EC2, rebooting an instance is much the same as with a local physical computer, but a stop/start differs in a few keys ways that may cause some problems and definitely have some benefits.&lt;/p&gt;

&lt;p&gt;When you stop an EBS boot instance you are giving up the physical hardware that the server was running on and EC2 is free to start somebody else&amp;#8217;s instance there.&lt;/p&gt;

&lt;p&gt;Your EBS boot volume (and other attached EBS volumes) are still preserved, though they aren&amp;#8217;t really tied to a physical or virtual server. They are just associated with an instance id that isn&amp;#8217;t running anywhere.&lt;/p&gt;

&lt;p&gt;When you start the instance again, EC2 picks some hardware to run it on, ties in the EBS volume(s) and boots it up again.&lt;/p&gt;

&lt;p&gt;Things that change when you stop/start include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;New internal IP address (though could randomly be the same).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New external IP address (though could randomly be the same).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If an Elastic IP address was associated with the instance before it was stopped, then you&amp;#8217;ll need to re-associate it after the start. (Behavior may differ with VPC instances.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any contents on the instance&amp;#8217;s former ephemeral storage were wiped and you are given fresh ephemeral storage (often mounted as /mnt).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can leave an instance stopped for as long as you like and not get charged for run time (though you do get charged at a much lower rate for the EBS volume storage).  See the next point.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A fresh billing hour is started for the instance when you start it again. E.g., if you start a new instance and then stop/start it 3 times within the first 60 minutes, you&amp;#8217;ll get charged for 4 hours instead of 1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is a small chance that EC2 will not have available slots of the correct instance type to run your instance when you want to start it again. I&amp;#8217;ve had this happen and temporarily switched to a different, available instance type to get it running again.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you reboot, it&amp;#8217;s a simple reboot at the OS level and the instance stays running on the same hardware, with the same private and public IP addresses, keeps the same Elastic IP address (if associated), and keeps the same ephemeral storage without getting wiped. No new billing hour is started on a reboot and you do not give up the instance hardware.&lt;/p&gt;

&lt;p&gt;While an instance is stopped, you can do some cool things before starting it again. Here&amp;#8217;s an article I wrote on changing the instance type of an instance while it&amp;#8217;s stopped:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2011/02/ec2-change-type"&gt;Moving an EC2 Instance to a Larger Size&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here&amp;#8217;s an article I wrote on how to change the size of an EBS boot disk of an instance while it&amp;#8217;s stopped:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2010/02/ec2-resize-running-ebs-root"&gt;Resizing the Root Disk on a Running EBS Boot EC2 Instance&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here&amp;#8217;s an article I wrote on how to examine the root disk of an instance (while it&amp;#8217;s stopped) when you can&amp;#8217;t connect to it while it&amp;#8217;s runnning:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2011/02/ec2-fix-ebs-root"&gt;Fixing Files on the Root EBS Volume of an EC2 Instance&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since the stop/start cycle has a good chance of moving your instance to new hardware, it&amp;#8217;s an easy way to replace your instance hardware if you suspect that the current platform might be going bad and causing problems. Here&amp;#8217;s an article I wrote about that:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2011/02/ec2-move-hardware"&gt;A Simpler Way To Replace Instance Hardware on EC2&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Warning: &amp;#8220;Stopping&amp;#8221; an instance is completely different from &amp;#8220;terminating&amp;#8221; an instance!  When you terminate an EC2 instance, by default it deletes the EBS boot volume and other volumes that were created at run time.  Make sure you understand the difference before you start doing one or the other.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;[I originally posted this article as an answer to a serverfault question, but liked it enough to archive it on this blog.]&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/09/ec2-reboot-stop-start"&gt;http://alestic.com/2011/09/ec2-reboot-stop-start&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/MOdE8w9rsVc" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/09/ec2-reboot-stop-start</feedburner:origLink></entry>

<entry>
    <title>Upper Limits on Number of Amazon EC2 Instances by Region</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/kA-tidkNgRI/ec2-max-instances" />
    <id>tag:alestic.com,2011://1.125</id>

    <published>2011-08-15T14:00:00Z</published>
    <updated>2011-12-27T23:26:35Z</updated>

    <summary>[Update: As predicted, these numbers are already out of date and Amazon has added more public IP address ranges for use by EC2 in various regions.] Each standard Amazon EC2 instance has a public IP address. This is true for...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="amazon" label="Amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="aws" label="AWS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instances" label="instances" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ipaddresses" label="IP addresses" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="research" label="research" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;&lt;font color="red"&gt;[Update: As predicted, these numbers are already out of date and Amazon has added more public IP address ranges for use by EC2 in various regions.]&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Each standard Amazon EC2 instance has a public IP address.  This is true for normal instances when they are first brought up and for instances which have had elastic IP addresses assigned to them.  Your EC2 instance still has a public IP address even if you have configured the security group so that it cannot be contacted from the Internet, which happens to be the default setting for security groups.&lt;/p&gt;

&lt;p&gt;Amazon has made public the &lt;a href="https://forums.aws.amazon.com/ann.jspa?annID=1252"&gt;EC2 IP address ranges&lt;/a&gt; that may be in use for each region.&lt;/p&gt;

&lt;p&gt;From this information, we can calculate the absolute upper limit for the number of concurrently running standard EC2 instances that could possibly be supported in each region.  At the time of this writing I calculate the hard upper limits to be:&lt;/p&gt;

&lt;table class="amis"&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;EC2 Region&lt;/th&gt;&lt;th&gt;Max Instances*&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;us-east-1&lt;/td&gt;&lt;td&gt;585,704&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;us-west-1&lt;/td&gt;&lt;td&gt;98,298&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;eu-west-1&lt;/td&gt;&lt;td&gt;135,156&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ap-southeast-1&lt;/td&gt;&lt;td&gt;43,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ap-northeast-1&lt;/td&gt;&lt;td&gt;34,808&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th colspan="2"&gt;&lt;/th&gt;&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;*Caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An upper limit based on the IP address ranges does not tell you what the real number of possible instances is in a given EC2 region.  It&amp;#8217;s just an upper limit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon is sure to keep requesting, reserving, and announcing more IP addresses than is actively needed by EC2 at any point in time.  Only they know the growth buffer percentage that they like to maintain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon may need to use different ranges of IP addresses for different groups of instances in different parts of their network, even in the same data center or availability zone, so they may publish and start using new ranges of IP addresses even before they are even near using up the capacity of previous ranges.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon is free to add new IP address blocks to the list at any time as they keep growing, and they do.  The specific numbers above could be out of date by the time you read this.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are probably some IP addresses in each range that are reserved for various networking devices and protocols.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This calculation is for concurrently running EC2 instances.  Many instances run for just a few minutes or hours and another instance, perhaps for another customer, can start up and use that same IP address moments later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EC2 instances running inside &lt;a href="http://aws.amazon.com/vpc/"&gt;Amazon VPC&lt;/a&gt; don&amp;#8217;t necessarily use up an external IP address in Amazon&amp;#8217;s EC2 public IP address ranges, so they are not included in the upper limits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I am not a networking expert.  I only play one at my startup.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anything else I&amp;#8217;m missing?&lt;/p&gt;

&lt;p&gt;[Update 2012-12-27: Correct URL for Amazon&amp;#8217;s latest IP address list.]&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/08/ec2-max-instances"&gt;http://alestic.com/2011/08/ec2-max-instances&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/kA-tidkNgRI" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/08/ec2-max-instances</feedburner:origLink></entry>

<entry>
    <title>Unavailable Availability Zones on Amazon EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/LbJpt_bV--4/ec2-unavailabiilty-zones" />
    <id>tag:alestic.com,2011://1.124</id>

    <published>2011-08-06T18:30:33Z</published>
    <updated>2011-08-15T09:01:33Z</updated>

    <summary>I’m taking a class about using Chef with EC2 by Florian Drescher today and Florian mentioned that he noticed one of the four availability zones in us-east-1 is not currently available for starting new instances. I’ve confirmed this in my...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="availabilityzones" label="availability zones" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="aws" label="AWS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;I&amp;#8217;m taking a &lt;a href="http://cloudtraining.eventbrite.com/"&gt;class about using Chef with EC2 by Florian Drescher&lt;/a&gt; today and Florian mentioned that he noticed one of the four availability zones in &lt;code&gt;us-east-1&lt;/code&gt; is not currently available for starting new instances.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve confirmed this in my own AWS accounts and found that one of the three availability zones in &lt;code&gt;us-west-1&lt;/code&gt; is also unavailable in addition to one of the four availability zones in &lt;code&gt;us-east-1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the error I get when I try to start an instance in the availability zone using an old AWS account:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Client.Unsupported: The requested Availability Zone is no longer supported. Please retry your request by not specifying an Availability Zone or choosing us-east-1d, us-east-1a, us-east-1b.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When I use an AWS account I created two days ago, I don&amp;#8217;t even see the fourth availability zone at all:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ec2-describe-availability-zones --region us-east-1
AVAILABILITYZONE    us-east-1b  available   us-east-1   
AVAILABILITYZONE    us-east-1c  available   us-east-1   
AVAILABILITYZONE    us-east-1d  available   us-east-1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The exact name of the unavailable availability zones will vary between EC2 accounts.  You can read more about that here:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2009/07/ec2-availability-zones"&gt;Matching EC2 Availability Zones Across AWS Accounts&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The availability zones that are unavailable in my AWS accounts map to the following identifiers using the method described in the above article:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;us-east-1x ceb6a579-757c-474b-b09b-52c84b605767
us-west-1x e5a2ff3b-79b4-4217-8c93-ebf1d633dd6e
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If my guess is correct based on old accounts I have, I believe these may be the oldest (original) availability zones in their respective regions.&lt;/p&gt;

&lt;p&gt;Has there been any communication from Amazon about unsupported availability zones?  Is this temporary or permanent?  When I searched Google for the above error, I got back one result in Japanese and it appears to be somebody asking what the error is.&lt;/p&gt;

&lt;p&gt;No longer supporting an availability zone in EC2 is something that Amazon is allowed to do under the &lt;a href="http://aws.amazon.com/ec2-sla/"&gt;EC2 SLA&lt;/a&gt;, especially with the way that they seem to phase them out.  The SLA does not kick in until two availability zones are completely unavailable and &amp;#8220;unavailable&amp;#8221; includes your existing instances having no external connectivity.  This is one reason we try to architect services with the ability to quickly move resources from one availability zone to another.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;d love to hear if other people are able to start instances in these availability zones.  Please also mention if you already have instances running in those zones.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update 2011-08-06: According to a &lt;a href="https://forums.aws.amazon.com/thread.jspa?threadID=67778"&gt;post in May&lt;/a&gt; from Amazon this seems to be a normal part of how AWS grows in an orderly manner, and if you already have instances running in a zone, you should be able to continue running instances in that zone. It isn&amp;#8217;t clear to me how quickly you might lose a zone after your last remaining instance is stopped or terminated, but according to &lt;a href="http://matthew.mceachen.us/blog/howto-deal-with-amazons-the-requested-availability-zone-is-no-longer-supported-error-1193.html"&gt;one user&lt;/a&gt; it sounds like it might be nearly immediate.&lt;/em&gt;&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/08/ec2-unavailabiilty-zones"&gt;http://alestic.com/2011/08/ec2-unavailabiilty-zones&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/LbJpt_bV--4" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/08/ec2-unavailabiilty-zones</feedburner:origLink></entry>

<entry>
    <title>Desktop AMI login security with NX</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/7GiR8M4ueAQ/ec2-desktop-ami-security" />
    <id>tag:alestic.com,2011://1.123</id>

    <published>2011-08-03T12:25:42Z</published>
    <updated>2011-08-05T04:37:40Z</updated>

    <summary>Update 2011-08-04: Amazon Security did more research and investigated the desktop AMIs. They have confirmed that their software incorrectly flagged the AMIs (false positive) and they caught it in time to stop the warning emails from going out to users....</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="aws" label="AWS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nx" label="NX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="security" label="security" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;&lt;em&gt;Update 2011-08-04: Amazon Security did more research and investigated the desktop AMIs.  They have confirmed that their software incorrectly flagged the AMIs (false positive) and they caught it in time to stop the warning emails from going out to users.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;These AMIs include the NX software for remote desktop operation and the way that NX implement login authentication with ssh is convoluted, but secure.  I can easily understand why it might have looked like there were potential problems with the AMIs, and I&amp;#8217;m glad things turned out well.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;As always, hats off to the hard working folks at AWS and thank for all the great products and services.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Original message:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If Amazon AWS/EC2 contacts you with a warning that one of my AMIs you are running contains a back door security hole with ssh keys or user passwords, please don&amp;#8217;t be alarmed.&lt;/p&gt;

&lt;p&gt;They just sent me a notice that all of my old Ubuntu and Debian desktop AMIs from 2008-2010 need to be taken down, but it was a misunderstanding of how the NoMachine NX software implements login security and I&amp;#8217;m sure those AMIs just got caught up in their automated sweeps.&lt;/p&gt;

&lt;p&gt;I sent an email to help Amazon to help explain why a fixed public ssh key in the AMI with a publicly known &amp;#8220;private&amp;#8221; ssh key is not a security risk in this instance (see command=&amp;#8221;/usr/NX/bin/nxserver &amp;#8212;login&amp;#8221; in the authorized_keys2 file) but they might be sending out notices to users of these AMIs before they get my response.&lt;/p&gt;

&lt;p&gt;You can read up on how NX authentication works securely here:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://www.nomachine.com/ar/view.php?ar_id=AR02C00150"&gt;http://www.nomachine.com/ar/view.php?ar_id=AR02C00150&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It&amp;#8217;s the middle of the night for me, so I&amp;#8217;ll publish more later, but I wanted to get the world out just in case there is alarm.&lt;/p&gt;

&lt;p&gt;Note: There may be other reasons you should not run some of those AMIs, e.g., if they are of a release that is past end of life, but they don&amp;#8217;t have open back doors that let me access them.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve written about &lt;a href="http://alestic.com/2011/06/ec2-ami-security"&gt;building AMIs securely&lt;/a&gt; recently and have been preaching this kind of stuff with EC2 for years. &lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/08/ec2-desktop-ami-security"&gt;http://alestic.com/2011/08/ec2-desktop-ami-security&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/7GiR8M4ueAQ" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/08/ec2-desktop-ami-security</feedburner:origLink></entry>

<entry>
    <title>Updated EBS boot AMIs for Ubuntu 8.04 Hardy on Amazon EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/O2o4BDTPbLo/ec2-hardy-ebs" />
    <id>tag:alestic.com,2011://1.121</id>

    <published>2011-06-24T13:00:00Z</published>
    <updated>2011-06-25T21:09:06Z</updated>

    <summary>For folks still using the old, reliable Ubuntu 8.04 LTS Hardy from 2008, Canonical has released updated AMIs for use on Amazon EC2. Read Scott Moser’s announcement on the ec2ubuntu Google group. Though Canonical publishes both EBS boot and instance-store...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="804" label="8.04" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ami" label="AMI" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebsboot" label="EBS boot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hardy" label="Hardy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="images" label="images" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="instancestore" label="instance-store" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;For folks still using the old, reliable Ubuntu 8.04 LTS Hardy from 2008, Canonical has released updated AMIs for use on Amazon EC2.  Read &lt;a href="http://groups.google.com/group/ec2ubuntu/browse_thread/thread/58e378bc0ea2a8a7"&gt;Scott Moser&amp;#8217;s announcement&lt;/a&gt; on the ec2ubuntu Google group.&lt;/p&gt;

&lt;p&gt;Though Canonical publishes both EBS boot and instance-store for recent Ubuntu releases, they only publish instance-store AMIs for the older Ubuntu 8.04, so&amp;#8230;&lt;/p&gt;

&lt;p&gt;I have published EBS boot AMIs for Ubuntu 8.04 Hardy using the exact image Canonical uses for the instance-store AMIs.&lt;/p&gt;

&lt;p&gt;I also used the same ext3 file system with the same file system label and the same AKI and the same ephemeral disk mounts, so these should be pretty much identical except that the root disk is based on EBS instead of instance-store. The default root disk size is 8GB instead of 10GB to follow the Amazon and Ubuntu standards for EBS boot instances.&lt;/p&gt;

&lt;p&gt;The code used to build the EBS boot AMIs using Canonical&amp;#8217;s downloadable Hardy images is &lt;a href="https://github.com/alestic/alestic-hardy-ebs"&gt;available in github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re not already using Hardy and you are just getting started with Ubuntu on EC2, I would recommend jumping straight to the most recent Ubuntu release.  At the time of this writing it is Ubuntu 11.04 Natty.&lt;/p&gt;

&lt;p&gt;You can find the AMI ids for both EBS boot and instance store for all active releases of Ubuntu (almost all published by Canonical) in the table at the top of &lt;a href="http://alestic.com"&gt;Alestic.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;[Update 2011-06-25: Corrected github link]&lt;/em&gt;&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/06/ec2-hardy-ebs"&gt;http://alestic.com/2011/06/ec2-hardy-ebs&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/O2o4BDTPbLo" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/06/ec2-hardy-ebs</feedburner:origLink></entry>

<entry>
    <title>Creating Public AMIs Securely for EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/_f12LUwVKIU/ec2-ami-security" />
    <id>tag:alestic.com,2011://1.120</id>

    <published>2011-06-17T14:20:00Z</published>
    <updated>2011-06-17T22:46:15Z</updated>

    <summary>Amazon published a tutorial about best practices in creating public AMIs for use on EC2 last week: How To Share and Use Public AMIs in A Secure Manner Though the general principles put forth in the tutorial are good, some...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="amazon" label="Amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="building" label="building" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebs" label="EBS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="privacy" label="privacy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="public" label="public" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="security" label="security" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="snapshots" label="snapshots" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;Amazon published a tutorial about best practices in creating public AMIs for use on EC2 last week:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://aws.amazon.com/articles/0155828273219400"&gt;How To Share and Use Public AMIs in A Secure Manner&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Though the general principles put forth in the tutorial are good, some of the specifics are flawed in how to accomplish those principles.  (Comments here relate to the article update from June 7, 2011 3:45 AM GMT.)&lt;/p&gt;

&lt;p&gt;The primary message of the article is that you should not publish private information on a public AMI.  Excellent advice!&lt;/p&gt;

&lt;p&gt;Unfortunately, the article seems to recommend or at least to assume that you are building the public AMI by taking a snapshot of a running instance.  Though this method seems an easy way to build an AMI and is fine for private AMIs, it is is a dangerous approach for public AMIs because of how difficult it is to identify private information and to clear that private information from a running system in such a way that it does not leak into the public AMI.&lt;/p&gt;

&lt;p&gt;The article recommends the use of the &lt;code&gt;rm&lt;/code&gt; command to remove files containing confidential files.  This is inadequate if you are building an EBS boot AMI for public use by taking a snapshot of the volume, as the deleted files are likely to remain in the EBS block device and are copied into the snapshot and public AMI.&lt;/p&gt;

&lt;h2&gt;Deleted files&lt;/h2&gt;

&lt;p&gt;In September, 2009, I published an article that describes this danger with an example of an EBS snapshot containing deleted files.  (An EBS boot AMI is simply an EBS snapshot that has been registered).&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://alestic.com/2009/09/ec2-public-ebs-danger"&gt;Hidden Dangers in Creating Public EBS Snapshots on EC2&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Almost immediately after I published that article with a sample public EBS snapshot, a reader found and restored the deleted file and redeemed the $100 Amazon gift certificate I had hidden in it.  Now, imagine that the deleted file contained your AWS credentials with power over your entire infrastructure on EC2, power to charge tens of thousands of dollars to your credit card with a single API call, and that person finding them does not have the best of intentions.  Ouch.&lt;/p&gt;

&lt;p&gt;If you are generating a public AMI by creating an EBS snapshot of a running instance, then the use of &lt;code&gt;rm&lt;/code&gt; is not sufficient to clear and protect secret information.  As much as I love &lt;code&gt;wipe&lt;/code&gt;, &lt;code&gt;shred&lt;/code&gt;, and &lt;code&gt;srm&lt;/code&gt;, even attempting to overwrite blocks may not be sufficient with modern journaling file systems.&lt;/p&gt;

&lt;h2&gt;History files&lt;/h2&gt;

&lt;p&gt;Amazon recommends &amp;#8220;Always delete the shell history before creating your AMI&amp;#8221; with an example of an &lt;code&gt;rm&lt;/code&gt; of dot history files.  Unfortunately, depending on exactly when this is run and what you do between that command and the creation of the AMI, a history file might be silently re-created and included on your AMI including commands that you typed before removing the history file.  This is true even disregarding the fact that a file removed with &lt;code&gt;rm&lt;/code&gt; isn&amp;#8217;t really removed if you are creating an EBS boot AMI with a snapshot.&lt;/p&gt;

&lt;p&gt;For example, simply exiting a shell will cause &lt;code&gt;bash&lt;/code&gt; to re-create &lt;code&gt;.bash_history&lt;/code&gt; with all the commands entered into that shell, perhaps including the ones where you  had passed AWS credentials to commands.&lt;/p&gt;

&lt;p&gt;You can test this with a sequence like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ssh to your server&lt;/li&gt;
&lt;li&gt;&lt;code&gt;echo "my secret"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rm .bash_history&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;exit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;ssh to your server again&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cat .bash_history&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It looks like you removed your secret, but there it is!&lt;/p&gt;

&lt;p&gt;There are ways of configuring &lt;code&gt;bash&lt;/code&gt; to not create history files, but &lt;code&gt;bash&lt;/code&gt; is not the only program that creates history files, and you may have multiple users to worry about, and some information gets stored in system log files, and&amp;#8230;  It just gets messy.  With security, you don&amp;#8217;t want to say &amp;#8220;I probably got everything&amp;#8221;.  You want to &lt;em&gt;know&lt;/em&gt; that you are not at risk.&lt;/p&gt;

&lt;h2&gt;authorized_keys&lt;/h2&gt;

&lt;p&gt;Amazon recommends removing all &lt;code&gt;authorized_keys&lt;/code&gt; files from your disk before creating the AMI. This is a great recommendation because you don&amp;#8217;t want to release public AMIs with back doors letting you access your user&amp;#8217;s servers.  It&amp;#8217;s bad form and makes you look suspicious and untrustworthy once discovered.&lt;/p&gt;

&lt;p&gt;Unfortunately, this makes it difficult to reconnect to your running instance, so you need to make sure you keep some ssh connections alive.  You would need to restore the &lt;code&gt;authorized_keys&lt;/code&gt; to copy files or create new ssh connections to the instance, and then hope you remember to remove them again before taking the next snapshot.&lt;/p&gt;

&lt;p&gt;This becomes error prone if you are in the test/development loop trying to perfect an AMI.&lt;/p&gt;

&lt;p&gt;The article recommends you remove any unrecognized &lt;code&gt;authorized_keys&lt;/code&gt; files and user login accounts when you run a public AMI.  I would go further.  If you run a public AMI that includes back doors like this, you should question what other security problems might exist with that AMI and get off of it as soon as possible. In fact, Amazon &lt;a href="https://forums.aws.amazon.com/thread.jspa?threadID=67299"&gt;sends out alerts and turns off access when they find AMIs with pre-existing &lt;code&gt;authorized_keys&lt;/code&gt;&lt;/a&gt; so it&amp;#8217;s a bit odd this article seems to take such a security hole casually.&lt;/p&gt;

&lt;p&gt;So now you&amp;#8217;re sufficiently worried and are wondering how to create public AMIs without including your secret information or accidentally releasing AMIs with embarrassing back doors.&lt;/p&gt;

&lt;h2&gt;Recommendation 1&lt;/h2&gt;

&lt;p&gt;The cleanest and safest approach is to build the file system for the new image separate from the file system you are using with the running system.  This means that you are creating a chroot environment with a complete operating system in a directory structure that is not the same root directory where you are logging in and running commands.&lt;/p&gt;

&lt;p&gt;The great thing about this approach is that you know exactly what files you are putting on the new image; you only run the exact commands you want to in the chroot environment; no history or log files show up there that you don&amp;#8217;t control; your &lt;code&gt;authorized_keys&lt;/code&gt; files are never seen in that file system; and any files you delete are not leaked when you copy that file system onto a new EBS volume to snapshot and register the public AMI.&lt;/p&gt;

&lt;p&gt;This is a reasonably advanced Linux concept and sometimes requires some special tools and knowledge, but the tools and knowledge are publicly available and folks in the community are standing by to help guide you when you run into problems.&lt;/p&gt;

&lt;p&gt;I think this approach is made easiest with Ubuntu, as Canonical has provided downloadable file system images that are configured correctly for the EC2 environment and that can be easily customized to add software and configuration for making AMIs to your own specification.&lt;/p&gt;

&lt;p&gt;I published a tutorial on how to &lt;a href="http://alestic.com/2010/01/ec2-ebs-boot-ubuntu"&gt;build AMIs with Canonical&amp;#8217;s downloadable images&lt;/a&gt; back in 2009 with Ubuntu Karmic (now past end of life).  It is similar with modern versions of Ubuntu, and if there is interest I can publish a new article with the updated steps.&lt;/p&gt;

&lt;p&gt;The code I use to build the &lt;a href="http://alestic.com/alestic-git/"&gt;Alestic Git Server&lt;/a&gt; AMIs uses this approach with Ubuntu 10.04 Natty and is available as a resource to study:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="https://github.com/alestic/alestic-git/blob/master/bin/alestic-git-build-ami"&gt;alestic-git-build-ami&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Recommendation 2&lt;/h2&gt;

&lt;p&gt;If you aren&amp;#8217;t building an Ubuntu AMI and your Linux distro does not provide clean, downloadable file systems for EC2 images, and you really believe you can identify which files on your running system contain private information, and you really want to create a public AMI from a running system, then here is how you can avoid releasing an AMI with recoverable deleted files.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Start with a fresh instance of a clean public AMI to install and configure your software.  If your instance has been running for a while, you really don&amp;#8217;t know what has leaked into the file system in visible and deleted files&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Put as little private information on the running system as possible.  If you need to have AWS credentials on the running system, drop them in a mounted ephemeral store disk (/mnt on some distros).  Don&amp;#8217;t type private information like keys or passwords into command lines where they might get dropped into history files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete all sensitive files and all &lt;code&gt;authorized_keys&lt;/code&gt;. (This is still risky as you might miss files, and history files can sometimes reappear as described above.)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do not snapshot the live EBS volume as it still contains the deleted files and you don&amp;#8217;t want to make them public in the new AMI. Instead,&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new EBS volume, attach, and mount it on the running instance, say under &lt;code&gt;/image&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the root file system over to the new EBS volume.  This only copies the current view of the undeleted files and does not copy the blocks containing the deleted files or any other modified file information.  The command might look something like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rsync -axvSHAX / /image/
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;umount and detach the new EBS volume.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create an EBS snapshot of the new EBS volume.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register the EBS snapshot as a new AMI.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Test by running an instance of the new AMI and verifying it works and contains no private information before you change its attributes so the public can run it.  You can then terminate instances and delete the extra EBS volume.  Only the EBS snapshot is required to be kept for the new AMI.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Warning: Even though these instructions are under a section titled &amp;#8220;Recommendation 2&amp;#8221; I would not build public AMIs this way myself.  It just seems too risky that something sensitive might slip into the public AMI.  It&amp;#8217;s better than snapshotting a running system directly because it removes the possibility deleted files leak out, but &amp;#8220;Recommendation 1&amp;#8221; is a safer path.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Wrapping up&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m a bit surprised that the above article&amp;#8217;s &lt;code&gt;rm&lt;/code&gt;/snapshot and &lt;code&gt;auhorized_keys&lt;/code&gt; instructions came from Amazon as I&amp;#8217;ve seen their security folks and documentation warn against these very practices in the past.  Amazon knows better as an organization and I hope that this misinformation is corrected soon so that people building AMIs don&amp;#8217;t follow the guidance and leave secret information or back doors on public AMIs.&lt;/p&gt;

&lt;p&gt;This is a complicated topic, as security related issues tend to be.  I welcome comments, clarifications, and questions on the &lt;a href="http://alestic.com/2011/06/ec2-ami-security/"&gt;original post&lt;/a&gt;.  Articles from &lt;a href="http://alestic.com"&gt;Alestic.com&lt;/a&gt; are republished on a couple specific sites with explicit permission, but I only read 
and respond to comments on my primary blog.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;[Update 2011-06-17: Corrected comments about &lt;code&gt;authorized_keys&lt;/code&gt;.  Amazon does recommend removing all of these files before publishing a new public AMI and recommends removing &amp;#8220;unrecognized&amp;#8221; &lt;code&gt;authorized_keys&lt;/code&gt; files when running public AMIs.]&lt;/em&gt;&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/06/ec2-ami-security"&gt;http://alestic.com/2011/06/ec2-ami-security&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/_f12LUwVKIU" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/06/ec2-ami-security</feedburner:origLink></entry>

<entry>
    <title>Canonical Releases Ubuntu 11.04 Natty for Amazon EC2</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/w9nVLilw60k/ec2-ubuntu-natty" />
    <id>tag:alestic.com,2011://1.119</id>

    <published>2011-04-28T16:35:35Z</published>
    <updated>2011-04-28T15:36:00Z</updated>

    <summary>As steady as clockwork, Ubuntu 11.04 Natty is released on the day scheduled at least eleven months ago; and thanks to Canonical, tested AMIs for Natty are already published for use on Amazon EC2. The Ubuntu AMI table at the...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ami" label="AMI" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amis" label="AMIs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="images" label="images" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="natty" label="Natty" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="release" label="release" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;As steady as clockwork, Ubuntu 11.04 Natty is released on the day scheduled at least &lt;a href="https://wiki.ubuntu.com/NattyReleaseSchedule?action=recall&amp;amp;rev=1"&gt;eleven months ago&lt;/a&gt;; and thanks to Canonical, tested AMIs for Natty are already published for use on Amazon EC2.&lt;/p&gt;

&lt;p&gt;The Ubuntu AMI table at the top of &lt;a href="http://alestic.com/"&gt;Alestic.com&lt;/a&gt; always reflects the latest official Ubuntu AMIs from Canonical and now includes Ubuntu 11.04 Natty.&lt;/p&gt;

&lt;p&gt;Click on the EC2 region tab (e.g., us-west-1) to see the list of AMI ids.  AMIs are listed for both 32-bit and 64-bit architectures (depending on what instance type you want to run) and for both EBS boot and instance-store.  I strongly recommend EBS boot unless you have a specific situation that requires instance-store and you really know what you&amp;#8217;re doing.  EBS boot has many advantages over instance-store that you may not be aware of until after you need them.&lt;/p&gt;

&lt;p&gt;As part of this release, I have added launch buttons to the right of each AMI id on &lt;a href="http://alestic.com/"&gt;Alestic.com&lt;/a&gt;.  If you click on one of these buttons you will be taken to the AWS console and dropped directly into the process of launching an EC2 instance of that AMI.  Thanks to Scott Moser for pointing out that AWS had implemented support for this cool feature&amp;#8212;and for building the Ubuntu AMIs themselves :-)&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve been running Ubuntu Natty on my laptop for a couple weeks with good success and look forward to trying out this latest release of Ubuntu on EC2 as well.&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/04/ec2-ubuntu-natty"&gt;http://alestic.com/2011/04/ec2-ubuntu-natty&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/w9nVLilw60k" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/04/ec2-ubuntu-natty</feedburner:origLink></entry>

<entry>
    <title>EC2 Reserved Instance Offering IDs Change Over Time</title>
    <link rel="alternate" type="text/html" href="http://feeds.alestic.com/~r/alestic/~3/pA2OkeReWkY/ec2-offering-ids" />
    <id>tag:alestic.com,2011://1.118</id>

    <published>2011-04-26T01:14:59Z</published>
    <updated>2011-04-26T01:55:17Z</updated>

    <summary>This article is a followup to Matching EC2 Availability Zones Across AWS Accounts written back in 2009. Please read that article first in order to understand any of what I write here. Since I wrote that article, Amazon has apparently...</summary>
    <author>
        <name>Eric Hammond</name>
        <uri>https://plus.google.com/111045584683584396225/about</uri>
    </author>
    
        <category term="EC2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PlanetUbuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ubuntu" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="UbuntuCloud" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="availabilityzones" label="availability zones" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="aws" label="AWS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ec2" label="EC2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ids" label="ids" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="reservedinstances" label="reserved instances" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://alestic.com/">
        &lt;p&gt;&lt;em&gt;This article is a followup to &lt;a href="http://alestic.com/2009/07/ec2-availability-zones"&gt;Matching EC2 Availability Zones Across AWS Accounts&lt;/a&gt; written back in 2009.  Please read that article first in order to understand any of what I write here.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since I wrote that article, Amazon has apparently changed the reserved instance offering ids at least once.  I haven&amp;#8217;t been tracking this, so I don&amp;#8217;t know if this was a one time thing or if the offering ids change on a regular basis.&lt;/p&gt;

&lt;p&gt;Interestingly, the offering ids still seem to match across accounts and still map to different availability zones, so perhaps they can still be used to map the true, underlying availability zones as the original article proposes.&lt;/p&gt;

&lt;p&gt;To document for posterity and comparison, here are my 2009 availability zone offering ids as calculated by the procedure in the above mentioned article:&lt;/p&gt;

&lt;p&gt;&amp;#8220;Blue&amp;#8221; Account (2009):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;eu-west-1a 649fd0c8-75d4-4e16-88c7-1ddb83f66062
eu-west-1b 438012d3-0440-480a-9f5c-eb7e55dd5a37
us-east-1a 4b2293b4-1e6c-4eb3-ab74-4493c0e57987
us-east-1b 60dcfab3-a56c-4092-8c90-3677e9da02b7
us-east-1c c48ab04c-c057-457e-a4d8-a0f172f4db2d
us-east-1d c48ab04c-7e96-4ea8-9579-d62194490546
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8220;Red&amp;#8221; Account (2009):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;eu-west-1a 438012d3-0440-480a-9f5c-eb7e55dd5a37
eu-west-1b 649fd0c8-75d4-4e16-88c7-1ddb83f66062
us-east-1a c48ab04c-c057-457e-a4d8-a0f172f4db2d
us-east-1b 4b2293b4-1e6c-4eb3-ab74-4493c0e57987
us-east-1c 60dcfab3-a56c-4092-8c90-3677e9da02b7
us-east-1d c48ab04c-7e96-4ea8-9579-d62194490546
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And here are the new, 2011-05-25 availability zone offering ids.&lt;/p&gt;

&lt;p&gt;&amp;#8220;Blue&amp;#8221; Account (2011):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;eu-west-1a c48ab04c-0bd0-4be9-8db5-a4bad61c6c58
eu-west-1b d586503b-7025-44e8-8487-09907b6b0e7e
us-east-1a 438012d3-80c7-42c6-9396-a209c58607f9
us-east-1b 60dcfab3-06bb-4b68-9503-53bf89823b5e
us-east-1c ceb6a579-757c-474b-b09b-52c84b605767
us-east-1d 649fd0c8-5d76-4881-a522-fe5224c10fcc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#8220;Red&amp;#8221; Account (2011):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;eu-west-1a d586503b-7025-44e8-8487-09907b6b0e7e
eu-west-1b c48ab04c-0bd0-4be9-8db5-a4bad61c6c58
us-east-1a ceb6a579-757c-474b-b09b-52c84b605767
us-east-1b 438012d3-80c7-42c6-9396-a209c58607f9
us-east-1c 60dcfab3-06bb-4b68-9503-53bf89823b5e
us-east-1d 649fd0c8-5d76-4881-a522-fe5224c10fcc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;Note: I have excluded the regions and availability zones that Amazon has added since 2009 (quite a few).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Though all of the offering ids have changed since 2009, it appears that the availability zone mappings between these two accounts has remained the same across the years.  This is a small sampling and I still think that Amazon could change this, especially for zones where no resources are being used (instances running, EBS volumes created), so don&amp;#8217;t depend on it remaining so.&lt;/p&gt;

&lt;p&gt;Please let me know if you do any further experimentation or future tracking of these ids.  There&amp;#8217;s not a ton of practical application, but I still find this interesting.&lt;/p&gt;

        

&lt;p&gt;
Original article: 
&lt;a href="http://alestic.com/2011/04/ec2-offering-ids"&gt;http://alestic.com/2011/04/ec2-offering-ids&lt;/a&gt;
&lt;/p&gt;
    &lt;img src="http://feeds.feedburner.com/~r/alestic/~4/pA2OkeReWkY" height="1" width="1"/&gt;</content>
<feedburner:origLink>http://alestic.com/2011/04/ec2-offering-ids</feedburner:origLink></entry>

</feed>

