码迷,mamicode.com
首页 > 其他好文 > 详细

openstack——删除网络

时间:2018-09-18 16:13:24      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:vim   nova list   bin   open   delete   interface   amp   router   Opens   

#!/bin/bash
#delete vm

for vim  in `nova list |awk '{if( NR > 2 ) {print $2}}'`;do
        nova delete $vim &
done

#Unbundling router
for port in `neutron port-list --all |awk '{if( NR > 2 ) {print $2}}'`;do
        for router in `neutron router-list --all | awk '{if( NR > 2 ) {print $2}}'`;do
                neutron router-interface-delete $router port=$port &
        done
done

sleep 60
# delete port
for port_d in `neutron port-list --all |awk '{if( NR > 2 ) {print $2}}'`;do
    neutron port-delete $port_d &
done

sleep 60
#delete subnet
for subnet in `neutron subnet-list --all|awk  '{if( NR > 2 ) {print $2}}'`;do
        neutron subnet-delete $subnet &
done

sleep 60
#delete net

for net in `neutron net-list --all |awk  '{if( NR > 2 ) {print $2}}'`;do
        neutron net-delete $net &
done

#delete route
for router_d in `neutron router-list --all|awk  '{print $2}'`;do
        neutron router-delete $router_d &
done

openstack——删除网络

标签:vim   nova list   bin   open   delete   interface   amp   router   Opens   

原文地址:https://www.cnblogs.com/mrwuzs/p/9668988.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!