Rebooting while creating an image EC2

amazon ec2amazon-web-services

Basically, we had a server issue and wanted to backup the instance via image creation.

The root EBS backed up pretty quick however, the larger external attached image was taking a while (still going ~40%). Since the primary one was done, we thought it would be ok to reboot the ec2 instance so we clicked reboot and confired – however, nothing happend.

We then tried to do it again ~5 minutes later but again nothing happened.

Suddenly the server started working again (accepting connections etc.) so really don't want the server to be rebooted.

So I guess the question is:

After the snapshot is completed will the servers restart?

Best Answer

After the snapshot is completed will the servers restart?

No, they will not.

The reboot starts when you begin the AMI creation process -- immediately before the snapshots are started. That is the point of the reboot -- to ensure that EBS can get a clean snapshot.

So how does that work?

When you start an EBS snapshot (or when the AMI creator starts one for you), there's a logical split that occurs inside EBS at the moment the snapshot starts.

Your instance can change the contents of the volume after the snapshot starts, but the snapshot process will not see anything that happened after the snapshot process started. The snapshot process essentially has access to a frozen copy of the volume as it existed at the moment the snapshot started.

If you reboot and start a snapshot while the volumes are idle and unmounted (as they would be, during a reboot), the resulting snapshot -- no matter how long it takes to actually create -- captures a perfect image of what was on the volume during that reboot.