kolla-ansible/tools/cleanup-host
Mauricio Lima 7f2dd73dcc Add a step to clean all ceph references in fstab
After run cleanup-containers script, was necessary to
clear references to the ceph in fstab file manually

Change-Id: I264e6644d5d569a9b56115ea31b15589b093c3f9
Closes-Bug: #1562991
2016-04-01 16:00:17 -04:00

35 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.."
. tools/validate-docker-execute.sh
# Spawning the neutron agents containers leaves artifacts on the host.
# This script removes these artifacts.
ip netns list | while read -r line ; do
echo "Removing network namespace $line on the host"
ip netns delete $line
done
ip -o link show | awk -F': ' '/tap/{print $2}' | while read -r ifname ; do
echo "Removing tap interface $ifname on the host"
ip link delete $ifname type veth
done
ip -o link show | awk -F': ' '/brq/{print $2}' | while read -r ifname ; do
echo "Removing linux bridge $ifname on the host"
ip link delete $ifname type bridge
done
ip -o link show | awk -F': ' '/vxlan/{print $2}' | while read -r ifname ; do
echo "Removing vxlan interface $ifname on the host"
ip link delete $ifname type vxlan
done
echo "Creating a fstab backup..."
sudo cp /etc/fstab /etc/fstab_backup
echo "Removing ceph references from fstab..."
sudo sed -i '/\/var\/lib\/ceph\/osd\//d' /etc/fstab