Amazon Spot Instances
Well I finally got my spot instances up and running, almost purely automated too.
Tools that I used
AMI: http://alestic.com/ ID: ami-9a873ff3 OS: Ubuntu 12.04 LTS Precise
Boto: https://github.com/boto/boto - Python's wrapper for the AWS API
Github: To pull down my dot files
Bash: some little bash script that just installs git and apache2
The whole process takes about 5 minutes on a spot instance to get a web server up and running because there's a little bit of a delay between when you request the spot instance and amazon actually sets it up.
Cost
Currently I'm running a small instance which costs $0.007/hr or $5/month. Not too shabby. If I was using a standard on demand small instance it would be around $46/month, so a spot instance costs around 10%.
Looking at the spot instance price history for my region (east) it looks like that price of $0.007 is pretty stable. I was actually hoping it would be a bit more so that I would have my server going down a lot and get some real testing it on how quickly I can recover it.
For now though I'm just going to work on my deployment system. Ideally I'd like a python script that will be able to create a new spot instance and do the initial setup on it. Right now that's basically a little boto to request the spot instance then a little Fabric ( http://docs.fabfile.org/en/1.5/) to push a bash script and run it to do the final setup. It will be cool to see how long that whole process takes.
Future thoughts
I think it'd be cool to have some basic monitoring setup. Ideally using zabbix as that's what I have already. Basically have a background worker that is constantly checking AWS to see what spot instances I currently have and then adding those IPs to the zabbix monitoring system and then I can keep track of all my instances in one place (as I'm already monitoring my dedicated servers and VPS's in zabbix).
P.S.
Contest going on right now for AWS spot instances: http://aws.amazon.com/ec2/spotathon/
Think I'll be missing this one as I'm a huge newbie on EC2 and am just poking around, but for you pros out there you might be able to get some nerd cred.










