soug 发表于 2013-7-26 09:07:37

OpenStack Quantum清空网络、子网、路由和Floating IP的执行脚本


#clean floating ip
for i in `quantum floatingip-list| grep -v "\---"| grep -v "^| id" | awk '{print $2}' `; do quantum floatingip-delete $i ; done
#clean router gateway
for i in `quantum router-list| grep -v "\---"| grep -v "^| id" | awk '{print $2}' `; do quantum router-gateway-clear $i ; done\
#clean router interface
for i in `quantum router-list| grep -v "\---"| grep -v "^| id" | awk '{print $2}' `; do quantum router-interface-delete $i`quantum port-list -- --device_id$i| grep subnet_id | sed 's/.*subnet_id": "\([^"]*\).*/\1/g'` ; done
#delete router
for i in `quantum router-list| grep -v "\---"| grep -v "^| id" | awk '{print $2}' `; do quantum router-delete $i`quantum port-list -- --device_id$i| grep subnet_id | sed 's/.*subnet_id": "\([^"]*\).*/\1/g'` ; done
#delete port
for i in `quantum port-list| grep -v "\---"| grep -v "^| id" | awk '{print $2}' `;do quantum port-delete $i ; done
#delete subnet
for i in `quantumsubnet-list | grep -v "\---"| grep -v "^| id" | awk '{print $2}' `;doquantum subnet-delete $i ; done
#delete network
for i in `quantumnet-list | grep -v "\---"| grep -v "^| id" | awk '{print $2}' `;doquantum net-delete $i ; done
#delete all agent
for i in ` quantum agent-list | grep -v "\---"| grep -v "^\ id" | awk '{print $2}' `;do quantum agent-delete $i ; done

baiyunjn 发表于 2013-7-26 16:16:37

我是个凑数的。。。

mouse 发表于 2013-7-26 22:46:42

下雨了,别忘了打伞,湿身是小,淋病就麻烦啦*^_^*

remington_young 发表于 2013-7-27 08:05:10

勃起不是万能的,但不能勃起却是万万都不能的!

zhaolu 发表于 2013-7-27 17:31:30

找不到恐龙,就用蜥蜴顶

网络浪子 发表于 2013-7-27 22:48:52

生我之前谁是我,生我之后我是谁?

sqtsqt 发表于 2013-7-27 23:09:05

与时俱进,你我共赴高潮!

scree2000 发表于 2014-9-15 17:12:25

horizon删不掉,这个挺好用。
页: [1]
查看完整版本: OpenStack Quantum清空网络、子网、路由和Floating IP的执行脚本