Last active
August 29, 2015 14:14
-
-
Save ajayhn/85abc60ed24ff1c5218d to your computer and use it in GitHub Desktop.
delete nets/ports/routers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
nova list | grep scalevm | awk '{ print $2 }' | xargs nova delete | |
for p in $(neutron port-list | grep scalemgmtport | awk '{ print $2 }'); do neutron port-delete $p; done | |
for p in $(neutron port-list | grep scaleport | awk '{ print $2 }'); do neutron port-delete $p; done | |
for r in $(neutron router-list | grep scalertr | awk '{ print $2 }'); do for x in $(neutron router-port-list $r | grep subnet_id | awk '{ prin | |
t $9 }' | sed -e 's/"//g' -e 's/,//'); do neutron router-interface-delete $r $x; done; done | |
for x in $(neutron net-list | grep scalenet | awk '{ print $2 }'); do neutron net-delete $x; done | |
for x in $(neutron router-list | grep scalertr | awk '{ print $2 }'); do neutron router-delete $x; done | |
neutron net-delete mgmtnet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment