[OVN] OVN mech driver does not map new segments

Bug #1949967 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Rodolfo Alonso

Bug Description

Related LP bug: https://bugs.launchpad.net/neutron/+bug/1865889
Related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2013820

This bug is related to OVN backend. "segments" service plugin must be enabled.

When a new segment is created (for example when a network is created), if this segment is associated to a physnet (flat and vlan type networks) and there is an L2 agent is running on a host with this physnet, a new "SegmentHostMappings" register is created. This segment links this new segment with the host. That means we link a segment with a host when (1) a physnet is mapped in a host and (2) a L2 agent is deployed in this host (and informs about it).

In OVN the physnet <-> host mapping is done using the OVS DB [1]:
$ ovs-vsctl set open . external-ids:ovn-bridge-mappings=provider:br-provider

When an OVS DB is updated, the corresponding OVN SB chassis register is updated. This event is captured in Neutron. Neutron retrieves the current segments associated to the configured physnets (in the example "provider") and filters by network type (flat and vlan only). If any of those segments has no "SegmentHostMappings", a new register is created.

However when a new segment is created, OVN mech driver does not correctly check if this segment is located in an agent [2]. Because OVN mech driver has no "agent_type", this method never maps the new created segment with a host.

As reported in the bugzilla #2013820, OVN can be deployed with DHCP agents (for baremetal servers with Ironic). When a new network (and the corresponding segment) is created and a new subnet is added to this network, the DHCP agent receives this update. But Neutron server [3] reports this subnet as "non_local_subnets" because there is no mapping between this segment and the DHCP host. Because of this, the DHCP deletes/do not create the DHCP namespace and the DHCP port.

[1]https://docs.openstack.org/networking-ovn/2.0.1/refarch/provider-networks.html
[2]https://github.com/openstack/neutron/blob/f97baa0b16687453735e46e7a0f73fe03d7d4db7/neutron/plugins/ml2/plugin.py#L2351-L2357
[3]https://github.com/openstack/neutron/blob/9241c76b04e6745cc648ee42037cfe6ddad3600a/neutron/api/rpc/handlers/dhcp_rpc.py#L210-L257

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
tags: added: ovn
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/816856

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/816856
Committed: https://opendev.org/openstack/neutron/commit/c8427c82dae38154df70400f7d2fe69f0d6c3354
Submitter: "Zuul (22348)"
Branch: master

commit c8427c82dae38154df70400f7d2fe69f0d6c3354
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/826102

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/826103

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/826104

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/826105

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/826271

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/826102
Committed: https://opendev.org/openstack/neutron/commit/30a7618e6febf8421e083be5f61e29cfa2b36f17
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 30a7618e6febf8421e083be5f61e29cfa2b36f17
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
    (cherry picked from commit c8427c82dae38154df70400f7d2fe69f0d6c3354)

tags: added: in-stable-xena
tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/826104
Committed: https://opendev.org/openstack/neutron/commit/b0080c4719f9d15fda4bf7eaf89d9ba5a11b9a05
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit b0080c4719f9d15fda4bf7eaf89d9ba5a11b9a05
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    Conflicts:
      neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
    (cherry picked from commit c8427c82dae38154df70400f7d2fe69f0d6c3354)
    (cherry picked from commit d53733c33a140d88b1ed9c7f59cf5963b18bd555)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/826105
Committed: https://opendev.org/openstack/neutron/commit/cd9dc0a81d5c8675e56d58ef1f4bb671c1aa3a7f
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit cd9dc0a81d5c8675e56d58ef1f4bb671c1aa3a7f
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    Conflicts:
        neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py
        neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
    (cherry picked from commit c8427c82dae38154df70400f7d2fe69f0d6c3354)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/826271
Committed: https://opendev.org/openstack/neutron/commit/e12580f602f81e911e1896f6cec2b26fe3d1fbf9
Submitter: "Zuul (22348)"
Branch: stable/train

commit e12580f602f81e911e1896f6cec2b26fe3d1fbf9
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    NOTE 2: stable/train does not have OVN ML2 driver in-tree. This driver
    can be used by installing networking-ovn. This patch in Neutron is
    needed to provide support for the referred feature. The corresponding
    code will land in the plugin repository too.

    Conflicts:
          neutron/common/ovn/constants.py
          neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py
          neutron/tests/unit/plugins/ml2/drivers/openvswitch/mech_driver/test_mech_openvswitch.py
          neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
    (cherry picked from commit c8427c82dae38154df70400f7d2fe69f0d6c3354)
    (cherry picked from commit d53733c33a140d88b1ed9c7f59cf5963b18bd555)
    (cherry picked from commit b0080c4719f9d15fda4bf7eaf89d9ba5a11b9a05)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/826103
Committed: https://opendev.org/openstack/neutron/commit/d53733c33a140d88b1ed9c7f59cf5963b18bd555
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit d53733c33a140d88b1ed9c7f59cf5963b18bd555
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Nov 5 14:56:15 2021 +0000

    [OVN] Check new added segments in OVN mech driver

    Check new segments added to OVN mechanism driver. This mechanism
    driver does not inherit from ``SimpleAgentMechanismDriverBase``
    because OVN has no agents (NOTE 1). However OVN mechanism driver
    requires an OVN controller service in each deployed chassis. This
    is how OVN driver knows the hosts using this backend.

    The segments, attached to an external network (connected to a
    physical network), can be mapped to a host if ther is a chassis (OVN
    controller agent) in this host.

    NOTE 1: OVN provides agent API compatibility, presenting the
    controller and the metadata services as agents. But OVN mechanism
    driver has no control or provides any information (via RPC) to
    those services.

    Conflicts:
      neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py

    Closes-Bug: #1949967
    Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
    (cherry picked from commit c8427c82dae38154df70400f7d2fe69f0d6c3354)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.0.0.0rc1

This issue was fixed in the openstack/neutron 20.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 17.4.0

This issue was fixed in the openstack/neutron 17.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.3.0

This issue was fixed in the openstack/neutron 18.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.2.0

This issue was fixed in the openstack/neutron 19.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn train-eol

This issue was fixed in the openstack/networking-ovn train-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron train-eol

This issue was fixed in the openstack/neutron train-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron ussuri-eol

This issue was fixed in the openstack/neutron ussuri-eol release.

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.