From: Zane Bitter Date: Fri, 18 May 2012 12:02:39 +0000 (+0200) Subject: Delete networks when erasing OpenStack X-Git-Tag: 2014.1~1815 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8550a36f48e151a1618bf2cc9631f1788a8d7264;p=openstack-build%2Fheat-build.git Delete networks when erasing OpenStack This is required to remove any network interfaces created using nova. If these are left behind they prevent a new installation of OpenStack re-adding them. Signed-off-by: Zane Bitter --- diff --git a/tools/openstack b/tools/openstack index e205b6b7..8b7110f5 100755 --- a/tools/openstack +++ b/tools/openstack @@ -63,11 +63,22 @@ function os_stop() { } function os_erase() { + for net in `sudo nova-manage network list | + awk '/^[[:digit:]]/ { print $9 }'` + do + sudo nova-manage network delete --uuid $net + done + os_stop sleep 1 + + # Kill dnsmasq processes + if find /var/lib/nova/networks -name '*.pid'; then + sudo kill `cat /var/lib/nova/networks/*.pid` + fi + sudo rm -f /var/lib/libvirt/qemu/save/instance-000* sudo rm -f /var/lib/libvirt/qemu/instance-000* - for iii in /usr/lib/systemd/system/openstack-*.service; do sudo systemctl stop $(basename $iii); done sudo yum erase -y python-glance python-nova* python-keystone* openstack-swift* openstack-dashboard sudo systemctl start mysqld.service