- Newest
- Most votes
- Most comments
Take a look at this blog for how to automate backing up your EBS volumes: Automating Amazon EBS snapshot management using Data Lifecycle Manager.
You don't need to create the AMI and boot up a new instance unless your are trying to restore the volume (steps 2-6).
- You have to use the OS/Filesystem commands to determine usage, like 'df'.
- No, not by default. You can install the CloudWatch agent to monitor OS level resources and get alerts, see: Collect metrics and logs from Amazon EC2 instances and on-premises servers with the CloudWatch agent
- No, no need to stop
- S3 is used by the EBS service, you can't control this or see the bucket where your snapshots are stored.
Adding some information to question (3):
Do you need to stop your instance before doing a snapshot? No, you don't. However the snapshot process is not aware of the state that the filesystem on the disks is in. Nor is it aware of the state that any application data might be in.
For example, if the operating system is in the middle of writing a file but has not yet updated the file allocation table (or whatever the equivalent is for that particular operating system) and you take a snapshot right then the filesystem in the snapshot is in a state which isn't (for want of a better word) "stable". That means when you restore from snapshot the new volume will be in the same state. Most operating systems will recover from this gracefully but you might lose the contents of the file. Maybe. It depends.
If you're running a database on the instance and the database is in the middle of committing a transaction and you take a snapshot at that exact moment then the database will be in an unknown state in the snapshot. Same thing applies - the database engine might automatically fix that problem on the next startup (on the new volume); or it might not. And the data might be lost. Or not. Again, it depends.
So it is safer to stop your instance to do a snapshot? Yes. If the filesystem is relatively stable but you're running a database then you might want to stop write operations to the database while you're doing the snapshot - that could be done at an application level or within the database. That way you know that the database is fully written to disk before the snapshot is taken.
Relevant content
- Accepted Answerasked 7 months ago
- asked a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
Hi, Thank you for the quick response. I am a bit confused by "You don't need to create the AMI and boot up a new instance unless your are trying to restore the volume (steps 2-6).".
If I don't create an AMI from the snapshot, how do I backup my current instance? In snapshot action, we have
If I don't create an image(AMI) to backup, should I create a volume from that snapshot and attach it to the current instance? Or should I do the fast snapshot restore? (but I have heard that fast snapshot restore is expensive though...)
Thanks!
I got it, I created a volume from the snapshot and it worked out fine. Thanks!!