How To Create A New AWS Instance From A Snapshot

Published Date Author: , Posted August 16th, 2011 at 7:32:04pm

Be sure to create regular snapshots of your running instances. If you lose an instance, recover quickly with this procedure. I suggest that you use Elastic IP addresses to make the migration DNS-free.

STEP 1: First, setup your environment properly

STEP 2: Create an AMI linked to the snapshot

% ec2-register -n YOUR-AMI-NAME -d "Your Description Here" --root-device-name /dev/sda1 -b "/dev/sda1=snap-XXXXXXXX" -a x86_64 --kernel aki-427d952
(where XXXXXXXX is the ID of your snapshot…)

This command outputs the new AMI ID:

IMAGE ami-264b8a1c

STEP 3: Start the new instance using the just-created AMI

% ec2run ami-264b8a1c -b "/dev/sda1=snap-XXXXXXXX:10:true" -g Your-Security-Group -t t1.micro -k AWSKeyPair

Which outputs the new instance information…

RESERVATION r-91305ffe 510579120428 Inbound-Relay
INSTANCE i-b97a28d8 ami-264b8a1c pending AWSKeyPair 0 t1.micro 2011-08-16T23:05:37+0000 us-east-1b aki-427d952b monitoring-disabled ebs paravirtual xen

STEP 4: Move your Elastic IP to the new instance

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.