Closed genevieve closed 4 years ago
In terraforming-openstack, we create the openstack image with a name that contains the environment
: https://github.com/pivotal-cf/terraforming-openstack/blob/master/ops-manager.tf#L2
In bosh-openstack-cpi-release, we create the openstack image with the name of the stemcell and it's version but nothing else useful: https://github.com/cloudfoundry/bosh-openstack-cpi-release/blob/c8dadbfe952140ce817546b435d7c261c7edae51/src/bosh_openstack_cpi/lib/cloud/openstack/stemcell_creator.rb#L75
In order to clean up orphaned bosh stemcells on openstack, we can only check that the image is available.
In order to clean up orphaned ops manager images on openstack, we can check that the image name contains the environment
.
This issue came up for the Ops Manager team recently; one of their bot users was mistakenly given admin rights, and that user was running leftovers, presumably only for its environment. Admin rights on OpenStack give visibility to every resource on the entire cluster, so without a filter it went and deleted every single image on the cluster.
@nmahoney-pivotal @zachgersh are y’all still unable to prioritize fixing this bug? If not, I would prefer to remove this functionality so we aren’t causing users this issue.
@genevieve yeah I don't know when we would have the bandwidth to address this :/
Done.
Leftovers for openstack does not support a filter. It tries to delete all images/instances/volumes.
It is failing in CI because there are images in our openstack environment from other users and those images are "in use" by their respective vms.
Potential workarounds:
Failure: