Jake
Jake

Reputation: 1223

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?

Upvotes: 3

Views: 13431

Answers (2)

magigo
magigo

Reputation: 176

you can create a image of this instance, and then launch a new instance with this image, you are data in EBS will saved, but the data in instance storage will lose, because this storage is ephemeral storage, when the server is shut down your are date in ephemeral storage will lost. Generally we don't save data in my EC2 hard disk, alteratively we save useful data in s3, which is a unlimit hard disk. AWS's official advice is only save log file or temp file in instance storage.

Upvotes: 0

Eric Hammond
Eric Hammond

Reputation: 22407

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).

Upvotes: 6

Related Questions