Marc Hughes


Home
Blog
Twitter
LinkedIn
GitHub
about
I am a developer from a bit west of Boston.

A single command that costs $325 to run!

12 Mar 2009

I just ran what might be the scariest command line I ever have... here it is:

ec2-purchase-reserved-instances-offering --offering c48ab04c-c057-457e-a4d8-a0f172f4db2d --instance-count 1
That baby reserved an Amazon EC2 instance for me for one full year at a cost of $325.  No "Are you really sure you want to pay $325?" No receipt, no "type in your credit card". Just type that in, and BAMN $325 gone from your account and an instance-year of reserved time added. Screw up that --instance-count and type 10 instead of 1? $3250!

I ALMOST got it wrong and typed:

ec2-purchase-reserved-instances-offering --offering-id 438012d3-d93c-4fbd-a245-33b4bf0930ec --instance-count 1
That would have bought a 3-year offering!

Can YOU tell the difference? It's in that offering ID.

To find out what offerings are available you run this command:

ec2-describe-reserved-instances-offerings
Which spits out this output, note the line in bold. That's the one I used.
OFFERING    e5a2ff3b-f6eb-4b4e-83f8-b879d7060257    us-east-1a    c1.medium    3y     1000.0    0.06    Linux/UNIX
OFFERING    248e7b75-afbc-4724-82b2-d78353299433    us-east-1c    c1.medium    3y     1000.0    0.06    Linux/UNIX
OFFERING    60dcfab3-d5b8-4d3d-9f38-480b34d38239    us-east-1b    c1.medium    3y     1000.0    0.06    Linux/UNIX
OFFERING    c48ab04c-42bb-4e5b-8c1b-c015f9604dd5    us-east-1a    c1.medium    1y     650.0    0.06    Linux/UNIX
OFFERING    ceb6a579-b754-4a50-a53e-36efdb8eb28b    us-east-1c    c1.medium    1y     650.0    0.06    Linux/UNIX
OFFERING    3a98bf7d-b94b-412a-8de5-8c77dfcc4ffd    us-east-1b    c1.medium    1y     650.0    0.06    Linux/UNIX
OFFERING    248e7b75-ed4c-4ca7-b42b-d14ee74a3360    us-east-1c    c1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    ceb6a579-1420-4728-ace3-9cb73934afcf    us-east-1a    c1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    60dcfab3-97dd-421b-8f75-c126de7741ce    us-east-1b    c1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    ceb6a579-f9b0-4bff-994c-c62030080d27    us-east-1c    c1.xlarge    1y     2600.0    0.24    Linux/UNIX
OFFERING    4b2293b4-cb88-480b-999d-a17683faa92f    us-east-1a    c1.xlarge    1y     2600.0    0.24    Linux/UNIX
OFFERING    60dcfab3-fa53-4d32-97cc-2fd1a0a8c0ac    us-east-1b    c1.xlarge    1y     2600.0    0.24    Linux/UNIX
OFFERING    649fd0c8-8bd3-489e-904c-4c5dfcb131ea    us-east-1c    m1.large    3y     2000.0    0.12    Linux/UNIX
OFFERING    d586503b-6876-4d40-8f94-1b2dde6b0ead    us-east-1a    m1.large    3y     2000.0    0.12    Linux/UNIX
OFFERING    248e7b75-5324-48e5-9749-fd3b4de01829    us-east-1b    m1.large    3y     2000.0    0.12    Linux/UNIX
OFFERING    248e7b75-a817-462e-996a-8ea7b4810a0e    us-east-1c    m1.large    1y     1300.0    0.12    Linux/UNIX
OFFERING    649fd0c8-4af1-4f63-bbdb-1a05951886a4    us-east-1a    m1.large    1y     1300.0    0.12    Linux/UNIX
OFFERING    c48ab04c-280c-4879-8119-63ac87002498    us-east-1b    m1.large    1y     1300.0    0.12    Linux/UNIX
OFFERING    248e7b75-0799-4a55-a0cb-f8d28eb11921    us-east-1b    m1.small    3y     500.0    0.03    Linux/UNIX
OFFERING    3a98bf7d-96c3-4d2f-a263-123fa6b46d61    us-east-1c    m1.small    3y     500.0    0.03    Linux/UNIX
OFFERING    438012d3-d93c-4fbd-a245-33b4bf0930ec    us-east-1a    m1.small    3y     500.0    0.03    Linux/UNIX
OFFERING    4b2293b4-1e6c-4eb3-ab74-4493c0e57987    us-east-1b    m1.small    1y     325.0    0.03    Linux/UNIX
OFFERING    60dcfab3-a56c-4092-8c90-3677e9da02b7    us-east-1c    m1.small    1y     325.0    0.03    Linux/UNIX
OFFERING    c48ab04c-c057-457e-a4d8-a0f172f4db2d    us-east-1a    m1.small    1y     325.0    0.03    Linux/UNIX
OFFERING    d586503b-20ad-4beb-bc88-60a1333c2b98    us-east-1a    m1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    649fd0c8-4767-43a1-a530-b4a1f0c08c31    us-east-1b    m1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    c48ab04c-6769-4bc1-966e-f7b0326001dd    us-east-1c    m1.xlarge    3y     4000.0    0.24    Linux/UNIX
OFFERING    c48ab04c-119e-41f1-8b0f-b83c4fc4f869    us-east-1a    m1.xlarge    1y     2600.0    0.24    Linux/UNIX
OFFERING    c48ab04c-63ab-4cd6-b8f5-978a29eb9bcc    us-east-1b    m1.xlarge    1y     2600.0    0.24    Linux/UNIX
OFFERING    e5a2ff3b-8646-4f48-912a-aaeba5823c73    us-east-1c    m1.xlarge    1y     2600.0    0.24    Linux/UNIX
This is pretty close to the worst user interface in history :)

But more importantly, what does that DO?

Well, Amazon must need some quick cash or something because they're offering a new pricing plan for their EC2 service.  Essentially, you pay an upfront fee, and then you get a huge discount on the service for a set amount of time.

Decoding that offering-id line, it's for 1 year (1y) to run a particular type of virtual server (m1.small) in a certain "availablility zone" (us-east-1a) for a much reduced hourly rate (0.03). This reduced rate cost me an upfront cost (325.0)

Assuming I actually run the server for the entire year it will cost me 243650.03=$262.80, tack on the one time fee $325 + $262.80 and we get $587.80 for the year.

Now, if I hadn't done this, the normal hourly rate of $0.10 applies. 243650.10=$876 for a savings of $289 a year.

Since I always have at least one m1.small instance up and running, it was a no-brainer to reserve one.

So depending on how you look at this, I typed a single command and spent $325, or saved $289.