I have an Amazon EC2 instance that is using an instance-store as its root device. It has no EBS volumes attached to it. It has a database and a running web application on it. If I understand correctly this is a bad setup as I would lose all the data on the instance if it were to reboot. I would like to correct this mistake. I'd like to move all the data on the running instance to a new EBS volume and make that new volume the root device. How do I go about doing this?
Thanks!
Basically you just need to copy the running instance to am EBS volume. Before doing this stop any services which change things on the filesystem (mysql, etc...)
So create a volume, make sure it's in the same availability zone as your s3 backed instance, and attach it to that instance.
Copy everything over to the ebs volume and validate.
Then mount the drive
make sure /ebs/etc/fstab wont try and mount anything that's not there, then unmount the drive
You can then create a snapshot of that volume, then you can ec2-register it as an ami, you have to do this from the command line, I don't think you can register an ami from a snapshot using the web interface.
At a high level, you:
a) Create an EBS volume
b) Attach the EBS volume to the correct instance
c) Format and mount the volume so the operating system can use it.
The first two can be done easiest from the AWS Management Console. The last task depends on your OS but for linux here is one link that will help: http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html