12

If I stop an EC2 instance, rather than terminate, will this image be saved in my account and be available to be used at a later stage? ..as I noticed terminated instances eventually dissappear, would a stopped instance be available to boot up and start when ever?

Also regarding charging, I assume the cost for having a stopped instance would be charged per GB similar to a custom AMI?

Also another possibly simple question, if I shutdown a machine over SSH or via a script, does this initiate a termination or just a stop an instance (I assume it terminates the instance).

Thanks

easyjo
  • 734
  • 6
  • 16

2 Answers2

9

If you terminate the EBS backed instance, it will remove it from the list of running instance, including it's allocated EBS volume. Unless you set the instance attribute not to delete the volume.

If you only stop, it will changed to stopped status and you can start it again later.

If you shutdown a machine, it default's to stop.
A good read to protect your instance see: http://alestic.com/2010/01/ec2-instance-locking

Rodney Quillo
  • 3,312
  • 1
  • 18
  • 9
  • that means the things I installed in the instance will not remove if I stop it? – red23jordan Jun 01 '12 at 02:57
  • As much as possible place on on EBS root device or an EBS attached volume. Don't place your data/app codes to /mnt which is known as ephemeral drive by default. – Rodney Quillo Jun 01 '12 at 05:15
  • I'm not sure this answers the question, if I have an EC2 instance based on an ami, if I stop the instance will my filesystem be wiped? – Harry Moreno Jun 19 '18 at 03:50
3

If you stop an instance based on EBS, then the instance will terminate automatically but you'll be charged for EBS storage until you delete the EBS.

jschorr
  • 3,034
  • 1
  • 17
  • 20
  • when you say terminate though, if you 'terminate' an instance it gets removed from the list. I assume you mean the instance will just shut down, but remain in the list and remain bootable? – easyjo Jan 26 '11 at 12:27
  • When an instance is shutdown, the VM is terminated (that VM is lost forever). However, the EBS volume is saved and you would be continued to be charged for EBS usage. When the instance is started again, a new VM is attached to EBS volume with new IP etc. – Harshal Waghmare Dec 07 '12 at 07:25