#!/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