Browse Source

[OVN Migration] Remove qr and dhcp ports from the nodes

After migration from ML2/OVS to ML2/OVN tap ports which were created
by the DHCP agents and router ports (like e.g. qr- or qg-) which were
created by the L3 agents aren't needed at all and should be deleted.
Previously those ports were set to be DOWN only. With this patch
all such ports will be simply deleted from the openvswitch.

Related-bug: #1946479
Change-Id: I74cd5820389c86819c6884d3d61c9b2f7907cc88
(cherry picked from commit 5092f3fb98b4c6bf8334de0e71548ddd073f6234)
(cherry picked from commit 0c5a5ef921ac8e8b6d207484f720b7ec40a32b33)
changes/89/815289/1
Slawek Kaplonski 9 months ago
parent
commit
2354ee86a8
  1. 14
      migration/tripleo_environment/playbooks/roles/migration/tasks/cleanup-dataplane.yml

14
migration/tripleo_environment/playbooks/roles/migration/tasks/cleanup-dataplane.yml

@ -1,21 +1,13 @@
---
- name: Quickly disable neutron router and dhcp interfaces
- name: Cleanup neutron router and dhcp interfaces
shell: |
for p in `ovs-vsctl show | egrep 'qr-|ha-|qg-|rfp-' | grep Interface | awk '{print $2}'`
do
# p will be having quotes. Eg. "hr-xxxx". So strip the quotes
p=`echo $p | sed -e 's/"//g'`
ovs-vsctl clear Interface $p external-ids
ovs-vsctl set Interface $p admin-state=down
done
ovs-vsctl list interface | awk '/name[ ]*: qr-|ha-|qg-|rfp-/ { print $3 }' | xargs -n1 ovs-vsctl del-port
# dhcp tap ports cannot be easily distinguished from ovsfw ports, so we
# list them from within the qdhcp namespaces
for netns in `ip netns | awk '{ print $1 }' | grep qdhcp-`; do
for dhcp_port in `ip netns exec $netns ip -o link show | awk -F': ' '{print $2}' | grep tap`; do
ovs-vsctl clear Interface $dhcp_port external-ids
ovs-vsctl set Interface $dhcp_port admin-state=down
ovs-vsctl del-port $dhcp_port
done
done

Loading…
Cancel
Save