nish
nish

Reputation: 7280

Stopping an EC2 instance safely

I realise that similar posts exist but I'm really confused because each of them says different things.

I have created a m1.small EC2 instance. I don't need it to be up and running 24 hours. So, I want to stop it when not in use to avoid unnecessary charges. I understand that the code on ephemeral storage would be lost on stooping the instance.

I read on how to do that safely. Some posts talk about creating EBS and AMI. While others say that you can stop an instance without having EBS or AMI and restart it without losing anything. While some other say that EC2 instance are EBS backed by default. I am really confused.

So, my question is. What is ephemeral storage and how can I find if my code is on ephemeral storage? And do I need to create an EBS or AMI before stopping the instance?

Thanks a lot

Upvotes: 1

Views: 703

Answers (2)

Jeevan Dongre
Jeevan Dongre

Reputation: 4649

Just to make clear. AWS has got two different types of storage. Instance store and EBS. EBS are basically persistent storage system, which holds the data even if you stop the instance or either reboot. Its a best practice to have EBS backed instances. Nothing to worry your instance is already EBS backed. You can stop the instance and start it when when ever you want. No data will be lost. Even I stop and start instances to cut cost. You can also automate this using aws cli or boto. So even if you forget to shut down or stop the instance it will be stopped automatically.

Upvotes: 1

mat_vee
mat_vee

Reputation: 85

  1. you can look at the block device mapping it gives you the path to access ephemeral storage. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html At abstract level,it is just kind of storage.
  2. Amazon charges per instance hour so one solution is use EC2 instance with EBS and create snapshot.And then you can stop your instance to avoid extra cost.Also using snapshot you can restart from the last stored snapshot.

Upvotes: 0

Related Questions