Trunk bridges aren't removed

Bug #1914886 reported by Slawek Kaplonski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Rodolfo Alonso
os-vif
Invalid
Medium
sean mooney

Bug Description

Recently I found out on the devstack that when I have VM with trunk port and some subports connected to it, trunk bridge isn't deleted when VM is migrated to the another host.
I think that the same thing will happen when instance will be simply deleted as vif object in case of trunk port (when ML2/ovs is used on Neutron's side) is objects.vif.VIFOpenVSwitch and _unplug method for this type of vif object don't tries to delete bridge at all.

Tags: trunk
Changed in os-vif:
assignee: nobody → sean mooney (sean-k-mooney)
status: New → Triaged
importance: Undecided → Medium
Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
tags: added: trunk
Changed in neutron:
status: New → Incomplete
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

As commented in IRC, Nova needs to know if a port belongs to a trunk (actually if this port is the trunk parent port). Neutron provides this info in the port GET result. From the result dictionary in the HTTP request: http://paste.openstack.org/show/807221/

"port.trunk_details" contains the trunk ID and the subports info.

Sean, do you need something else?

Regards.

Revision history for this message
Bence Romsics (bence-romsics) wrote :

Hi Slawek,

In my ml2/ovs based multihost devstack I could not reproduce this at first. What are we doing differently?

$ openstack network create net0
$ openstack network create net1
$ openstack network create net2

$ openstack subnet create --network net0 --subnet-range 10.0.4.0/24 subnet0
$ openstack subnet create --network net1 --subnet-range 10.0.5.0/24 subnet1
$ openstack subnet create --network net2 --subnet-range 10.0.6.0/24 subnet2

$ openstack port create --network net0 port0
$ parent_mac="$( openstack port show port0 -f value -c mac_address )"
$ openstack port create --network net1 --mac-address "$parent_mac" port1
$ openstack port create --network net2 --mac-address "$parent_mac" port2

$ openstack network trunk create --parent-port port0 trunk0
$ openstack network trunk set --subport port=port1,segmentation-type=vlan,segmentation-id=101 trunk0
$ openstack network trunk set --subport port=port2,segmentation-type=vlan,segmentation-id=102 trunk0

$ openstack server create --image cirros-0.5.2-x86_64-disk --flavor cirros256 --nic port-id=port0 --availability-zone :devstack0 vm0 --wait
$ sudo ovs-vsctl list-br | egrep tbr
tbr-801806cc-3 # on devstack0

$ openstack server show vm0 -f value -c OS-EXT-SRV-ATTR:hypervisor_hostname
devstack0
$ openstack server migrate vm0 --wait
$ openstack server resize confirm vm0
$ openstack server show vm0 -f value -c OS-EXT-SRV-ATTR:hypervisor_hostname
devstack0a # migration was successful

$ sudo ovs-vsctl list-br | egrep tbr
[no tbr left behind]

# cleanup
$ openstack server delete vm0 --wait
$ openstack network trunk delete trunk0
$ openstack port delete port2 port1 port0
$ openstack network list -f value -c ID -c Name | awk '/ net[012]$/ { print $1 }' | xargs -r openstack network delete

Also don't we delete trunk bridges on the neutron side instead of os-vif?

https://opendev.org/openstack/neutron/src/commit/2acb96c37468120ba79de7d8de48ffb942e78a2b/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py#L236

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

@Bence - I think that I was doing live migration but I will verify that and will update this LP.

Revision history for this message
Slawek Kaplonski (slaweq) wrote (last edit ):

@Bence: I just confirmed it. After live migration trunk bridge isn't removed from the src node.
When vm is deleted, bridge is deleted properly.
I'm not sure if it's os-vif or neutron issue but there is for sure something wrong there.

Revision history for this message
Slawek Kaplonski (slaweq) wrote :

Now I can't reproduce it and it seems that tbr bridge is deleted after short deplay. So I'm going to close this bug.

Changed in neutron:
status: Incomplete → Invalid
Changed in os-vif:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.