Skip to content

Instantly share code, notes, and snippets.

@goneri
Created April 1, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goneri/55d3cafb5ce8acb9887a42b02ee23efc to your computer and use it in GitHub Desktop.
Save goneri/55d3cafb5ce8acb9887a42b02ee23efc to your computer and use it in GitHub Desktop.
purge_volumes.sh
#!/bin/bash
set -eux
function clean_up_volumes() {
openstack volume list -f value -c ID -c Status|awk '/available/ {print $1}'|xargs -r openstack volume delete
}
OS_CLOUD=vexxhost OS_REGION_NAME=ca-ymq-1 clean_up_volumes
OS_CLOUD=vexxhost OS_REGION_NAME=sjc1 clean_up_volumes
OS_CLOUD=limestone OS_REGION_NAME=us-slc clean_up_volumes
OS_CLOUD=limestone OS_REGION_NAME=us-dfw-1 clean_up_volumes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment