A port that is disabled and bound is still ACTIVE with ML2/OVN

Bug #2036705 reported by Gregory Thiemonge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Rodolfo Alonso

Bug Description

Issue originally reported to the Octavia project: https://bugs.launchpad.net/octavia/+bug/2033392
During the failover of a loadbalancer, Octavia disables a port and waits for its status to be DOWN, but it never happens, the port is still ACTIVE (it impacts the duration of the failover in Octavia, but also the availability of the loadbalancer).

When a bound port is disabled, its status is expected to be switched to DOWN.
But with ML2/OVN, the port remains ACTIVE.

$ openstack server create --image cirros-0.5.2-x86_64-disk --flavor m1.nano --network public server1
[..]
| id | 7e392799-7a25-4ec6-a0ff-e479b3c37cc6 |
[..]

$ openstack port list --device-id 7e392799-7a25-4ec6-a0ff-e479b3c37cc6
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| 208c473c-4161-4c3a-ab9e-8444d7bc375f | | fa:16:3e:85:bc:ac | ip_address='172.24.4.251', subnet_id='9441b590-d9d4-4f8f-b4aa-838736070222' | ACTIVE |
| | | | ip_address='2001:db8::322', subnet_id='813adce0-21de-44c9-958a-6967441b8623' | |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+

$ openstack port show -c admin_state_up -c status 208c473c-4161-4c3a-ab9e-8444d7bc375f
+----------------+--------+
| Field | Value |
+----------------+--------+
| admin_state_up | UP |
| status | ACTIVE |
+----------------+--------+

# Disabling the port
$ openstack port set --disable 208c473c-4161-4c3a-ab9e-8444d7bc375f

$ openstack port show -c admin_state_up -c status 208c473c-4161-4c3a-ab9e-8444d7bc375f
+----------------+--------+
| Field | Value |
+----------------+--------+
| admin_state_up | DOWN |
| status | ACTIVE |
+----------------+--------+

Folks on #openstack-neutron confirmed that with ML2/OVS, the status is DOWN when the port is disabled.

Tags: ovn
tags: added: ovn
Changed in neutron:
status: New → Confirmed
Revision history for this message
Lajos Katona (lajos-katona) wrote :

I read a little the code and checked the logs, and to tell the truth lost in the details :-)
If I understand well (of course I can't represent >10 years of API evolution and the ideas behind it) the status field of the port could represent that the backend wiring was successful.
If the admin sets admin_state_up=False I am not sure if setting status=DOWN is a good decision.

If we assume that OVS drivers behaviour is correct we have to make OVN driver behave the same way.
I would go and ask the drivers about it to be sure, but that's just my 2 cents.

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Brian Haley (brian-haley) wrote :

I think at this point we can say that OVS that is the "standard" and OVN should behave simlarly. Someone will have to work on this.

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

This is happening with any port in ML2/OVN. The "LSP.enabled" flag is correctly set depending on the "admin_state_up" Neutron port flag. The problem is that we are not capturing this event and we are not setting the "port.status" to DOWN. In any case, the bug is legit.

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
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/+/896939

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

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

commit aead4aa99df4769462ec47045c8d973ae1b0a0a0
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 28 18:43:36 2023 +0000

    [OVN] Set the Neutron port status based on "lsp.up" and "lsp.enabled"

    The Neutron "port.status" field ("ACTIVE", "DOWN") is set depending on
    the Logical Switch Port "up" and "enabled" flags. Before this patch,
    the "port.status" depended only on the "up" flag. However, the user
    can set the "port.admin_state_up" field that will modify the
    "lsp.enabled" flag. If the "port.admin_state_up" is DOWN, the port
    does not transmit and the status should be "DOWN".

    The OVN backend is correctly disabling the port transmission; what
    was incorrect in the Neutron API is only the "port.status" field.

    This is currently working in other mechanism drivers like LB or OVS.

    Closes-Bug: #2036705
    Change-Id: I5b7b55b0b365df7246a571cea97a392cdf89bdb6

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

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/903863

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

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

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

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

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/903864
Committed: https://opendev.org/openstack/neutron/commit/d084f2724d57eed4e49442787126c98d95b6bf7b
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit d084f2724d57eed4e49442787126c98d95b6bf7b
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 28 18:43:36 2023 +0000

    [OVN] Set the Neutron port status based on "lsp.up" and "lsp.enabled"

    The Neutron "port.status" field ("ACTIVE", "DOWN") is set depending on
    the Logical Switch Port "up" and "enabled" flags. Before this patch,
    the "port.status" depended only on the "up" flag. However, the user
    can set the "port.admin_state_up" field that will modify the
    "lsp.enabled" flag. If the "port.admin_state_up" is DOWN, the port
    does not transmit and the status should be "DOWN".

    The OVN backend is correctly disabling the port transmission; what
    was incorrect in the Neutron API is only the "port.status" field.

    This is currently working in other mechanism drivers like LB or OVS.

    NOTE: this backport also includes [1], that is updating the release
    note section to "fixes".

    [1]https://review.opendev.org/c/openstack/neutron/+/903863

    Closes-Bug: #2036705
    Change-Id: I5b7b55b0b365df7246a571cea97a392cdf89bdb6
    (cherry picked from commit aead4aa99df4769462ec47045c8d973ae1b0a0a0)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/903865
Committed: https://opendev.org/openstack/neutron/commit/1514fbe1f88f5df7d00c567edf957b45f8619752
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 1514fbe1f88f5df7d00c567edf957b45f8619752
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Sep 28 18:43:36 2023 +0000

    [OVN] Set the Neutron port status based on "lsp.up" and "lsp.enabled"

    The Neutron "port.status" field ("ACTIVE", "DOWN") is set depending on
    the Logical Switch Port "up" and "enabled" flags. Before this patch,
    the "port.status" depended only on the "up" flag. However, the user
    can set the "port.admin_state_up" field that will modify the
    "lsp.enabled" flag. If the "port.admin_state_up" is DOWN, the port
    does not transmit and the status should be "DOWN".

    The OVN backend is correctly disabling the port transmission; what
    was incorrect in the Neutron API is only the "port.status" field.

    This is currently working in other mechanism drivers like LB or OVS.

    NOTE: this backport also includes [1], that is updating the release
    note section to "fixes".

    [1]https://review.opendev.org/c/openstack/neutron/+/903863

    Closes-Bug: #2036705
    Change-Id: I5b7b55b0b365df7246a571cea97a392cdf89bdb6
    (cherry picked from commit aead4aa99df4769462ec47045c8d973ae1b0a0a0)
    (cherry picked from commit d084f2724d57eed4e49442787126c98d95b6bf7b)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

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

commit e897a62311af3b5860b393eb7fe0eb6da8c18599
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue Aug 22 14:50:32 2023 +0000

    [OVN] Update release note section to "fixes" for LP#2036705

    Related-Bug: #2036705
    Change-Id: I54e436cb0c5b594a1b0f60fd0943b231c78c21c7

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

This issue was fixed in the openstack/neutron 24.0.0.0b1 development milestone.

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.