Automating the EBS snapshot lifecycle
Lets understand how can i use Amazon Data Lifecycle Manager to automate the creation, retention & deletion of the snapshots of EBS volumes
Amazon Data Life cycle Manager uses the resources tags to identify the EBS volumes to be backed up and Amazon Data Life cycle Manager applies the following tags to all snapshots created by policy
Using Amazon Data Life cycle Manager, we create a life cycle policy which consists of
- Resource Type: The type of AWS resource managed by policy. If we want to create individual volume snapshots use VOLUME or use INSTANCE to create multi-volume snapshots from the volume attached to ec2 instance.
- Target tags: The tags that must be associated with EBS volume or EC2 instance.
- Schedule: The start time & interval for creating snapshots
- Retention: You can retain snapshots on either total count of snapshots or age of snapshots
Lets create a Life cycle policy
Once the policy is created, the following actions can be performed
Cross Region Copy can also be specified while creating the policy
Exercise: Create an Lifecycle policy to have 3 previous snapshots for an ec2 instance (count = 3) (Waiting till 9:32 AM)
Fast snapshot restore
- Internally the EBS snapshots are stored in S3. So when we try to create a volume from snapshot, data should be copied from s3 (object storage) into disk storage, so it takes decent time.
- AWS has given an option called as EBS Fast Snapshot Restore which internally engages with more compute & memory to improve the time taken for copy process from S3 to EBS.
- AWS claims it can recover 1 TB per hour.
- FSR costs will be based on duration for which this feature is enabled & approximately it costs 0.75$ per hour in addition to EBS Snapshots Costs.
EBS Elastic Volumes
- With EBS Elastic Volumes, we can increase volume size, change the volume type or adjust the performance of EBS volumes without a need for stopping/detaching volumes from ec2 instances
- All the current generation instances support elastic volumes.
- The approach for expanding the disk size for linux & Windows Instances (Without downtime) will be done in next session.
Configure AWS CLI
- Please configure aws cli with iam credentials and try to execute
aws ec2 describe-volumes
- Now compare the results with UI
- Now since we get similar results, lets try to do what ever we have done on console (ui) from cli as well from our next session.