Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand openstack's GC to volumes #3996

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

gursewak1997
Copy link
Member

Expand OpenStack's GC to volumes and get all the relevant packages

@dustymabe
Copy link
Member

// Skip volumes that are in use or not in an "available" state
if volume.Status != "available" || volume.CreatedAt.After(threshold) {
	continue
}

I think this is the tricky part. There are two things here:

  1. It would be really really nice if those volumes somehow had some metadata we could check (like the createdby:mantle checks we do elsewhere) so we're not just blasting all volumes in an account. Do you know if any metadata like that exists?
  2. We might have to expand our volume.Status over time to include more as IIRC some of the volumes aren't available but in some other state like error or provisioning and they just get stuck there. Not sure if there is anything we can actually do for those states or not, though.

@gursewak1997
Copy link
Member Author

  1. It would be really really nice if those volumes somehow had some metadata we could check (like the createdby:mantle checks we do elsewhere) so we're not just blasting all volumes in an account. Do you know if any metadata like that exists?

We have 'image_name': 'kola-*' that we can use.
if strings.HasPrefix(volume.Name, "kola-") {

  1. We might have to expand our volume.Status over time to include more as IIRC some of the volumes aren't available but in some other state like error or provisioning and they just get stuck there. Not sure if there is anything we can actually do for those states or not, though.

We can extend it to additionally delete all volumes in status starting with 'error*'; possible options are error, error_deleting, error_restoring, error_extending, error_managing, error_migrating, error_attaching, error_detaching, error_replicating

@dustymabe
Copy link
Member

Sounds good to me

@gursewak1997 gursewak1997 force-pushed the expand-gc-volumes-openstack branch from fb05928 to 5ece0c5 Compare December 19, 2024 16:30
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Get all the imports using:
go get github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes
go mod tidy && go mod vendor
@gursewak1997 gursewak1997 force-pushed the expand-gc-volumes-openstack branch from 5ece0c5 to b2326a9 Compare December 19, 2024 19:46
@dustymabe dustymabe enabled auto-merge (rebase) December 19, 2024 20:34
@dustymabe dustymabe merged commit 7a9b9a8 into coreos:main Dec 19, 2024
5 checks passed
@gursewak1997 gursewak1997 deleted the expand-gc-volumes-openstack branch December 20, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants