Wednesday, May 19, 2010

Sometimes I have to learn from my own mistakes

by Roman Leinwather

I have been setting up the Amazon EC2 server for while before I launch quantify pre-launch page. I bought the reserved instance for three years which reduced the cost of running the instance quite a lot even if you had to pay some money upfront. I have tried couple of different image (packages of server software), they were all Linux, just different versions. I had to get it into the stage where I could lose both instance and elastic block (place where you app and database sits) without loosing almost any data. After couple of try_and_fails I got there. The maximum I can loose is one hour of database data but I can’t lose any server configuration. All sounds good, right?

You have read the title so you are asking where is the fail?

As I have mentioned in the beginning I bought the reserved instance. The trick is, if you by the reserved instance in zone C you need to build your instance and elastic block in the same zone in order to get the better rates otherwise you will be charged the standard rates. Now you know where I am going … ;) Yes, I have bought the reserved instance in zone C and I have build couple of instances in zone C before but the final version I have made was in the zone D. Why? Just because I wasn’t paying attention to it at a time. I have obviously find out when I got a bill from Amazon.

The good thing is…

As I have also mentioned I build the server the way so I can build any number of servers in matter of 5 minutes from my backups. So I have simple killed my instance in zone D and build another in the zone C from the image I have made before which consist the whole configuration of the server and I have also killed the elastic block but before I have created a new snapshot which consist of latest database and application data so when I build a new elastic block in zone C I have just simple load the snapshot data into it.

I have been up and running in 5 minutes and now I can finally enjoy the reduced costs of the reserved instance. It cost me additional 40 dollars but find out that I have made mistake but I could also test my environment at the same time ;)

Have you done a mistake which has cost you money?