How EBS Snapshots work in AWS
-
EBS snapshot is a point-in-time copy of your EBS volume, which is lazily copied into AWS S3.
-
EBS Snapshots are incremental copies of data.
-
Lets assume we have a EBS Volume & we have taken the snapshot of it
-
Now there were some changes done to EBS volume and if the snapshot is taken
-
Now there were some changes done to EBS volume and if the snapshot is taken
-
Now if we create volume from snapshot3 the volume with the data of snapshot3, snapshot2 and snapshot1 will be created
-
Now if we create volume from snapshot2 the volume with the data of snapshot2 and snapshot1 will be created
-
What will happen if i delete snapshot3. If i delete the latest snapshot the data changes that were done in the latest snapshot will be lost
-
What will happen if i delete snapshot2.
-
In AWS we loose data only if we delete latest snapshots not older ones.
-
AWS AMI (Amazon Machine Image) is a snapshot of disk(s) plus some additional metadata.
-
Non Backup Scenarios:
- I have an ebs volume in mumbai region in az (ap-south-1b) and i want to create another ebs volume with same data in different az (ap-south-1a)
- Create a snapshot of the ebs volume from az (ap-south-1b)
- From the snapshot create a ebs volume in ap-south-1a az
- I have an ebs volume in mumbai region in az (ap-south-1b) and i want to create another ebs with same data in different region oregon (us-west-2)
- Create a snapshot of ebs volume from az (ap-south-1b)
- Now copy the snapshot to oregon (us-west-2)
- From the copied snapshot create an ebs volume
- I have an ebs volume in mumbai region in az (ap-south-1b) and my friend wants to create the same ebs volume in his aws account.
- Create a snapshot of ebs volume from az (ap-south-1b) and
modify permissions to add your friends aws account id to your snapshot
- Create a snapshot of ebs volume from az (ap-south-1b) and
modify permissions to add your friends aws account id to your snapshot
- I have an ebs volume in mumbai region in az (ap-south-1b) and i want to create another ebs volume with same data in different az (ap-south-1a)
Pricing of EBS Snapshots
- EBS Snapshot will have a fixed price of approx $0.05 per GB-month
Automatic Snapshot creations
- It makes sense for us to automatically create snapshots. There are many ways of doing it
- Using AWS CLI, develop a shell/batch script to take a snapshot & run it as scheduled or cron job
- Using AWS SDK, develop a script/code to take automatic snapshots
- Configure Lifecycle manager
Next Class Prep
- Ensure you have aws cli configured as shown Here
