Skip to content

Uninstall leaking snapshot that backs the AMI #1342

Closed

Description

@joelddiaz

Version

$ openshift-install version
./bin/openshift-install unreleased-master-457-g9596c7ffa001989c5453d8aff334f464b05c7a4d

Platform (aws|libvirt|openstack):

aws

What happened?

After uninstalling/destroying a cluster, the snapshot that backs the AMI that gets created during installation is left hanging around.

What you expected to happen?

Clean up the snapshot that backs the AMI as part of deleting the AMI.

How to reproduce it (as minimally and precisely as possible)?

# install a cluster

# get the snapshot backing the newly created AMI
$ aws ec2 describe-images --filters "Name=tag:kubernetes.io/cluster/jdiaz-master-2nqdz,Values=owned" --region us-east-1 | jq -r .Images[].BlockDeviceMappings[].Ebs.SnapshotId
snap-0e75eb72357f405d9

$ ./openshift-install destroy cluster

# the snapshot is still around after destroy is complete
$ aws ec2 describe-snapshots --snapshot-ids snap-0e75eb72357f405d9 --region us-east-1  | jq -r .Snapshots[].SnapshotId
snap-0e75eb72357f405d9

Anything else we need to know?

The snapshot isn't tagged (which probably explains why it isn't getting cleaned up).

$ aws ec2 describe-tags --filters "Name=resource-id,Values=snap-0e75eb72357f405d9" --region us-east-1
{
    "Tags": []
}

References

Activity

  1. staebler commented on Feb 28, 2019

    @staebler
    Contributor

    I delete my initial comments where I misunderstood the issue. I can reproduce this as well.

  2. wking commented on Mar 1, 2019

    @wking
    Member
    $ aws ec2 describe-snapshots --snapshot-ids snap-0e75eb72357f405d9 --region us-east-1  | jq -r .Snapshots[].SnapshotId
    snap-0e75eb72357f405d9
    

    How long does it persist for? It's possible that it's been deregistered, but Amazon hasn't gotten around to reaping it yet (and will shortly, now that we've also removed the consuming instances). Checking in CI:

    $ AWS_PROFILE=ci aws ec2 describe-images --owners self --query 'join(`\n`, Images[].Description)' --output text | sort | uniq -c | sort -n
          1 This was provisioned 2018-02-16T19:49:58Z
          2 Red Hat CoreOS "maipo" (OpenShift) 400.7.20190227.0
         63 Red Hat CoreOS "maipo" (OpenShift) 47.334

    63 is more than I'd expect, but it seems like most of the time we're cleaning up. Here's a recent deregister in CI:

    $ curl -s https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_installer/1344/pull-ci-openshift-installer-master-e2e-aws/4307/artifacts/e2e-aws/installer/.openshift_install.log | grep ami- | tail -n1
    time="2019-03-01T00:27:55Z" level=info msg=Deleted arn="arn:aws:ec2:us-east-1:460538899914:image/ami-00717fbdf9b20f869" id=ami-00717fbdf9b20f869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions