[FOLIO-3360] Clean up EBS Snapshots Created: 08/Dec/21 Updated: 10/Jan/22 Resolved: 10/Jan/22 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | TBD |
| Reporter: | Peter Murray | Assignee: | Peter Murray |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Sprint: | DevOps Sprint 130, DevOps Sprint 131, DevOps Sprint 129 |
| Development Team: | FOLIO DevOps |
| Description |
|
There are 6172 orphaned EBS volume snapshots in us-east-1, some dating back to 2019. |
| Comments |
| Comment by Peter Murray [ 08/Dec/21 ] |
|
Finding the orphaned snapshots (via How to Identify Orphaned EBS Snapshots to Optimize AWS Costs): comm -23 <(aws --profile folio-org ec2 describe-snapshots --owner-ids 732722833398 --query 'Snapshots[*].SnapshotId' --output text | tr '\t' '\n' | sort) <(aws --profile folio-org ec2 describe-volumes --query 'Volumes[*].SnapshotId' --output text | tr '\t' '\n' | sort | uniq) > orphaned-folio-ebs-snapshots.txt Getting details about the orphaned snapshots:
cat orphaned-folio-ebs-snapshots.txt | xargs -n 20 aws --profile folio-org ec2 describe-snapshots --query 'Snapshots[*].[SnapshotId,StartTime,Description]' --output text --snapshot-ids >
Deleting snapshots (note the ghead -n -40 gets all by the last 40):
grep {identifying-string} orphaned-folio-ebs-snapshots-description.txt| sort -k 2 | ghead -n -40 | cut -f 1 | xargs -n 1 aws --profile folio-org ec2 delete-snapshot --snapshot-id
|
| Comment by Peter Murray [ 08/Dec/21 ] |
|
Deleted all but the last 40 snapshots for:
Deleted all snapshots for:
Ask John Malconian about deleting all but the last 40 of these:
|
| Comment by Peter Murray [ 10/Jan/22 ] |
|
Old snapshots removed. |