Posts Tagged ‘Amazon AWS’

Scheduling EC2 Backups with Skeddly (automated EBS snapshots)

Written by Perry Woodin on . Posted in Deployment

A recent topic of conversation in the office has been backups. Three of us have experienced catastrophic hardware failures on our local development machines (i.e. our laptops). Thankfully, we are all obsessive about backups so we all got back up and running in no time. If you aren’t backing up your local system, then you need to read Sean’s excellent post on Selecting Cloud Backup Software.

But what about your servers? And more specifically, what if you’re running an Amazon EC2 instance?

Like all things AWS, Amazon has many options for creating backups. If you setup your EC2 instance to use Elastic Block Storage (EBS), you can simply create a snapshot of your volume from the AWS Console. These EBS snapshots are incremental backups that persists on Amazon’s S3. Incremental means that only the blocks that have changed since your last snapshot are saved. This is all really slick, but manually creating snapshots from the AWS Console isn’t a good solution if your goal is to have daily, hourly, or whatever snaphots.

You could create your own service using command line tools. For example:

ec2-create-snapshot vol-id --description "Daily Backup"

Or, you could use Amazon’s API. For example:

https://ec2.amazonaws.com/
?Action=CreateSnapshot
&VolumeId=volume-id
&AUTHPARAMS

The above options are really useful, but it takes a bit of time and fiddling to get everything right. The easiest solution I have found for scheduling automated snapshots is a service called Skeddly http://www.skeddly.com/.  Skeddly can do more than automate snapshots, but that’s what we’re going to look at in this post.

Using Skeddly

Sign Up and Create a Skeddly Specific AWS User

As of writing this post, you can get a 30-Day Trial of Skeddly, so go there now and sign up.

Before you sign up I would suggest creating an access key specifically for Skeddly. You do this by creating a user from the AWS Console under Identity and Access Manager (IAM). I created a user called skeddly with the following policy:

{
"Statement": [
{
"Action": [
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot",
"ec2:CreateTags",
"ec2:DescribeInstances",
"ec2:DescribeSnapshots",
"ec2:DescribeTags"
],
"Effect": "Allow",
"Resource": "*"
}
]
}

If you need asstance creating a policy, you can use the AWS Policy Generator located at http://awspolicygen.s3.amazonaws.com/policygen.html

Add an Instance

After logging into Skeddly, select the Managed Instances tab and Add Instance. This is the easiest way to create your automated snapshots. You will need to know the following before you can fill out the form:

Instance ID: Get this from your AWS Console under EC2. You will see an instance column that displays your instance ids. Your instance id should look something like i-1a2b3c4d.

Elastic IP: If you want Skeddly to Stop/Start your instance to ensure the snapshot is complete you will need to supply the Elastic IP address associated with your instance. This is optional, but recommended.

Access Key: This is the IAM user I suggested creating above.

After supplying the necessary instance information you can jump down to Backup Instance and Delete Backups.

Create your schedule.

Note there are macros you can use to name your snapshot. I use something like

$(VOLUMENAME)$(DATE)

I keep a weeks worth of snapshots. And because my instance has three EBS volumes, I set the Minimum to Keep at 21. That’s 3 volumes x 7 days = 21.

Pricing

I think the pricing is incredibly reasonable. It costs $0.15 to create or delete a snapshot of each volume. That means I’m only spending $0.90/day to create three snapshots and delete three snapshots.

Scratching the Surface

Skeddly can do so much more. Once you get started, you may find yourself scheduling all sorts of tasks. Need to backup your RDS… Skeddly can do that. Create an AMI… let Skeddly handle it. Make a nice dinner… Skeddly can’t do that, but with all the time you’re saving why not put on your chef’s hat and prepare some grub.

My Love/Hate Relationship with WordPress

Written by Perry Woodin on . Posted in Misc Ramblings, Software

WordPress is really amazing. I can standup a WordPress site on Amazon’s EC2 in under 15 minutes. And we’ve got a developer here at Troy Web who is adept at writing plugins. So, I love WordPress because it can facilitate launching a basic website in under a day.

What I hate about WordPress is it is quite often the wrong tool for the job. That’s not really the fault of WordPress. People become enamored by its ease of use and try to shoehorn functionality that is probably better served by custom application development. At a certain point they feel locked into the platform. That’s never a good thing.

But what really prompted this post/vent is the ubiquity of WordPress plugins. I recently helped a friend move from WordPress.com to a self hosted install. We had to replace some widgets and it took me hours to find a suitable plugin. Not because the plugin didn’t exist but rather because there were hundreds of plugins that claimed to offer the same functionality. My new rule for plugins is only install if the number of downloads exceeds 250,000.

So, if you want a WordPress site, I’m happy to help, but lets talk about your site’s goals before you commit to the platform.

Need a cheap SMTP host? Try Amazon SES

Written by Perry Woodin on . Posted in App Dev

I recently stood up a couple of ColdFusion servers on Amazon’s EC2. One of the servers is a staging server and I used localhost to send out mail. Turns out Amazon limits the amount of outgoing mail over port 25.

Of course, Amazon offers a solution in the form of Amazon Simple Email Service (SES). http://aws.amazon.com/ses/ From the Amazon SES page:

Amazon Simple Email Service (Amazon SES) is a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers.

I signed up for SES, and within 24 hours was accepted with an initial outgoing limit of 10,000 emails per 24/hrs. Not bad. And as you prove your worthiness (i.e. no spamming), Amazon ups the limit.