111

When I reboot an EC2 instance, do I get the initial image again, or is the state of the hard disk before the reboot kept?

And what happens with billing, does the hour start again, or do I continue with the fraction of the hour I was in when I rebooted?

Jonik
  • 80,077
  • 70
  • 264
  • 372
flybywire
  • 261,858
  • 191
  • 397
  • 503

5 Answers5

94

Rebooting an instance is like rebooting a PC. The hard disk isn't affected. You don't return to the image's original state, but the contents of the hard disks are those before the reboot.

Rebooting isn't associated with billing. Billing starts when you instantiate an image and stops when you terminate it. Rebooting in between hasn't any effect.

kgiannakakis
  • 103,016
  • 27
  • 158
  • 194
24

Rebooting keeps the disks intact.

If you shut down the instance and power up a new one, the disks will be reset to their initial states.

This doesn't apply to the EBS disks, which persist even across shutdowns.

Barry Brown
  • 20,233
  • 15
  • 69
  • 105
  • 1
    > if you shut down the instance and power up a new one, the disks will be reset to their initial states. this answer directly contradicts the top answer – swyx Feb 09 '20 at 21:52
19

As per AWS Documentation:

An instance reboot is equivalent to an operating system reboot. In most cases, it takes only a few minutes to reboot your instance. When you reboot an instance, it remains on the same physical host, so your instance keeps its public DNS name (IPv4), private IPv4 address, IPv6 address (if applicable), and any data on its instance store volumes.

Rebooting an instance doesn't start a new instance billing hour, unlike stopping and restarting your instance.

Further, they recommend:

We recommend that you use Amazon EC2 to reboot your instance instead of running the operating system reboot command from your instance. If you use Amazon EC2 to reboot your instance, we perform a hard reboot if the instance does not cleanly shut down within four minutes.

captainblack
  • 4,107
  • 5
  • 50
  • 60
  • The latest docs say "within a few minutes" I want a hard reboot to reboot *now*. I also don't want to wait 10s for it to decide to boot. Grr. – timkay Aug 05 '22 at 17:37
1

When you rebooting an instance, it will keep remains same hypervisor and restart the VM just like normal Linux reboot.

If you created a VM with ephemeral block store, then you would not lose the ephemeral storage when you restart the instance.

As mentioned above, rebooting will not affect the billing

ashokhein
  • 1,048
  • 12
  • 38
0

go to instance and reboot. I just did and all my states and the data were intact. Wait for a few minutes before everything comes back to normal.

jacai
  • 11
  • 2