EC2 scheduled reboot - are my local instance files going to be deleted?

0

Hello everyone,

AWS sent me an email to warn me about a server scheduled reboot impacting my EC2 instance. The scheduled reboot is justified because of detected degradation on AWS side, that will modernize the physical infrastructure.

Amazon EC2 has detected degradation of the underlying hardware hosting your EC2 instance (instance-ID: i-xxxxxxxxxxxxxxxx) associated with your AWS account (AWS Account ID: xxxxxxxxxxxxxxxxxx) in the xxxx-xxxx-xxxx region. This instance is scheduled for maintenance and will be rebooted any time between 2023-12-04 00:00:00 UTC and 2023-12-04 02:00:00 UTC.

From what I understand with the following statement, any data on the instance (like /etc/config/nginx/site.conf) will be preserved.

During maintenance, the instance will be rebooted. The reboot generally takes a few minutes to complete. After the reboot, your instance retains its IP address, DNS name, and any data on local instance-store volumes.

But the follwing line is somehow contradictory, so I am not sure about it.

You can stop and start the instance at any time before the scheduled start time of the scheduled reboot event. This will migrate the instance to a new host and the instance will not have to undergo the scheduled maintenance. Please note that the data on any local instance-store volumes will not be preserved when you stop and start your instance. For more information about stopping and starting your instance see the EC2 User Guide https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html.

My app is on a mounted EBS volume, so it is fine. But what about the files that are directly in the local instance volume (like /etc/fail2ban/jail.d/*.conf etc...)?

Should I make a snapshot of the instance just in case? Or should I copy all these configuration files somewhere?

Anwar
asked 5 months ago308 views
3 Answers
1
Accepted Answer

Hello.

Data on instance store volumes remains even after restarting EC2.
However, data will be lost if you stop it.

If you want to move the EC2 physical host yourself, you will need to stop and start EC2, in which case your data will be lost.
If EC2 maintenance is a stop event that is notified to your AWS account, the data on the instance store volume will be lost, so you must make sure to copy files etc. somewhere.
https://aws.amazon.com/maintenance-help/?nc1=h_ls

  • Stop event - Stop events are scheduled events that stop the instance during the scheduled time window. When you start the instance again, it is moved to a new host. Alternately, you can stop-start the instance any time prior to the date/time specified in the scheduled event notification to avoid the event. If you use an instance with instance store volumes then you should backup the data prior to the scheduled stop event or before you stop the instance, as the data on the instance store volume is lost when the instance is stopped.
  • Reboot event - Reboot events are scheduled events that reboot the instance during the scheduled time window. Instance store data is preserved for a reboot event. You can stop-start the instance any time prior to the date/time specified in the scheduled event notification to avoid the event.
  • Network event - Network events are scheduled events where the network connectivity of the instance is lost for a brief period but is restored after the event. The instance continues to run throughout the period. You can stop-start the instance any time prior to the date/time specified in the scheduled event notification to avoid the event.
profile picture
EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago
  • Thak you, this is now less confusing.

1

Most likely your root volume is also on EBS and won't be affected by stopping and starting the instance. If you want to verify this is the case, you can check with df and lsblk commands the location of your root volume.

profile picture
EXPERT
Kallu
answered 5 months ago
  • Thank you, with your help it is less confusing.

1

Hello,

Data in the instance store volume will not be deleted when the instance is rebooted. Only during stop/start the instance store data will be lost.

In your case it is a scheduled reboot which is planned from AWS end and hence the instance store data will be preserved. However, as a precautionary measure it is recommended to take a backup of the data in instance store volume. For more details on how to backup the data in instance store volume to EBS please refer the following link.

Regarding the contradictory part, in order to avoid the scheduled reboot, you can perform a stop/start before the mentioned date during your convenient time, so that the instance will be migrated to another healthy host and there will not be a scheduled maintenance for the instance.

However, if you perform a stop/start, the data in instance store will be lost, but the scheduled maintenance reboot will not occur.

AWS
SUPPORT ENGINEER
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago
  • Perfectly clear, thank you. It means no matter when (before or after the scheduled maintenance), any EC2 instance that is stopped will see its local volume lost (which makes sense). I marked Riku answer as solving my issue, but both of you provided me enough information to be confident about the scheduled maintenance, thank you again!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions