Skip to content

Instantly share code, notes, and snippets.

@cloudnull
Last active February 5, 2021 21:59
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 cloudnull/6f4a076abb1891a1703fddf54981d128 to your computer and use it in GitHub Desktop.
Save cloudnull/6f4a076abb1891a1703fddf54981d128 to your computer and use it in GitHub Desktop.
TripleO Manual heat delete
export PW=$(sudo podman exec -ti $(sudo podman ps | awk '/heat_api$/ {print $1}') grep '^connection=mysql' /etc/heat/heat.conf | awk -F':' '{print $3}' | awk -F'@' '{print $1}')
export STACK=${STACK:-overcloud}
sudo podman exec -ti mysql bash -c "mysql -u heat -p${PW} heat -e \"delete from resource_data where resource_id in (select id from resource where stack_id in (select id from stack where name = '$STACK'));\""
sudo podman exec -ti mysql bash -c "mysql -u heat -p${PW} heat -e \"delete from resource where stack_id in (select id from stack where name = '$STACK);\""
sudo podman exec -ti mysql bash -c "mysql -u heat -p${PW} heat -e \"delete from event where stack_id in (select id from stack where name = '$STACK');\""
sudo podman exec -ti mysql bash -c "mysql -u heat -p${PW} heat -e \"delete from stack where name = '$STACK';\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment