[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:

  • wiki_data_SNAPSHOT
  • wiki_root_SNAPSHOT
  • issues_data_SNAPSHOT
  • issues_root_SNAPSHOT

Deleted all snapshots for:

  • discuss_root_SNAPSHOT

Ask John Malconian about deleting all but the last 40 of these:

  • jenkins_root_SNAPSHOT
  • jenkins_home_SNAPSHOT
  • jenkins_nexus_SNAPSHOT
  • registry_SNAPSHOT
Comment by Peter Murray [ 10/Jan/22 ]

Old snapshots removed.

Generated at Thu Feb 08 23:27:31 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.