[dvs][starting in victoria] Dhcp interface is created in vlan_mode trunk with trunks 4095

Bug #1992243 reported by alecorps
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vmware-nsx
In Progress
Undecided
alecorps

Bug Description

VMware DVS plugin
Starting on Neutron stable/victoria and newer versions.

Since Victoria release, "replace_port" function has been modified in ovs_lib (https://github.com/openstack/neutron/blob/stable/victoria/neutron/agent/common/ovs_lib.py#L359) and create, by default, the interface in vlan_mode trunk and trunks 4095 instead of vlan_mode access without trunks.
When you are using, Neutron VMware DVS plugin, the DHCP interface is created with this lib and should be reachable. For example, with a neutron node as a VM with a trunk portgroup, this modification cause an issue. With the vlan_mode trunk and trunks 4095, your dhcp interface is not reachable.

Actual result on openvswitch :

ovs-vsctl show

    Bridge br-dvs
        ...
        Port "tapxxx"
            tag: 210
            trunks: [4095]
            Interface "internal"

Expected result :

ovs-vsctl show

    Bridge br-dvs
        ...
        Port "tapxxx"
            tag: 210
            Interface "internal"

In https://opendev.org/x/vmware-nsx/src/branch/master/vmware_nsx/plugins/dvs/dhcp.py, we could replace the line 57 "br_dvs.set_db_attribute("Port", dvs_port_name, "tag", vlan_tag)"

by

ovsdb = br_dvs.ovsdb
with ovsdb.transaction() as txn:
    txn.add(ovsdb.db_set('Port', dvs_port_name, ('tag', vlan_tag)))
    txn.add(ovsdb.db_clear('Port', dvs_port_name, 'vlan_mode'))
    txn.add(ovsdb.db_clear('Port', dvs_port_name, 'trunks'))

I will try to push you a PR on that soon

Tags: dvs
alecorps (alecorps7)
description: updated
alecorps (alecorps7)
Changed in vmware-nsx:
assignee: nobody → alecorps (alecorps7)
status: New → In Progress
Revision history for this message
alecorps (alecorps7) wrote :
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.