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.
- 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.
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.
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.
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 3 years ago
- EXPERTpublished 2 months ago