Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Amazon EC2 Server change instance type without moving data file?

Currently, I am using Amazon EC2 C1-medium server to run my service. I heard that Amazon EC2 server made a new type server called, Amazon EC2 C3. Amazon EC2 C3 offers SSD hard disk.

I was wondering I can change Instance Type without moving my old data files, and I believe that they can do it because they are using normal hard disk. However, I found out that I can change the instance type even though I want to change my old server to SSD hard disk.

I didn't change the type yet because I worry about losing server data. I read documents but couldn't find the answer. How does it work and is it safe to do it?

like image 253
Jake Avatar asked Jan 27 '26 23:01

Jake


1 Answers

The standard way to change the type of a running instance is:

  1. Stop (do not terminate) the instance (stop-instances).

  2. Modify the type of the instance (modify-instance-attribute).

  3. Start the instance (start-instances).

There are a number of cautions that you should be aware of including:

  • This only works for EBS based instances.

  • The ephemeral storage (often mounted on /mnt) will be lost.

  • You may have to re-associate an Elastic IP address if the instance is not in a VPC.

This can be done through the console, command line, or API calls. Here's an old article I wrote about changing instance types using the command line tools: http://alestic.com/2011/02/ec2-change-type

I definitely recommend converting from c1.medium to c3.large as you are thinking. Here's an article I wrote about that: http://alestic.com/2013/12/ec2-instance-type-c3

Since you're interested in SSD, note that the SSD on the c3.large is ephemeral storage. Data stored there will be lost irretrievably when an instance is terminated, stopped, or fails. You'll want to only store files you can afford to lose there (e.g., ones that are replicated elsewhere, backed up regularly, or possible to regenerate).

like image 108
Eric Hammond Avatar answered Jan 30 '26 21:01

Eric Hammond