Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.

Bug 1861298

Summary: ovn-controller is not releasing a logical port if the ovs interface ofport is -1
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Numan Siddique <nusiddiq>
Component: ovn2.13Assignee: Numan Siddique <nusiddiq>
Status: CLOSED ERRATA QA Contact: Jianlin Shi <jishi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: RHEL 8.0CC: ctrautma, jishi, ralongi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-18 11:23:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Numan Siddique 2020-07-28 09:05:10 UTC
Description of problem:

ovn-nbctl ls-add sw0

ovn-nbctl lsp-add sw0 sw0-p1
ovn-nbctl lsp-set-addresses sw0-p1 "50:54:00:00:00:03 10.0.0.3"
ovn-nbctl lsp-set-port-security sw0-p1 "50:54:00:00:00:03 10.0.0.3"

ovs-vsctl add-port br-int p1 -- \
    set Interface p1 external_ids:iface-id=sw0-p1 -- \
    set Interface p1 type=internal

# the port should be up
ovn-nbctl lsp-get-up sw0-port1

ovn-sbctl show

ovs-vsctl set interface p1 type=\"\"

# the ofport of p1 interface will be -1.
ovs-vsctl get interface p1 ofport

# The logical port should be down. But its not
ovn-nbctl lsp-get-up sw0-port1

ovn-sbctl show


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Jianlin Shi 2020-07-29 03:24:13 UTC
reproduced with following script on ovn2.13.0-20.06.1-4:

systemctl start openvswitch                                                                           
systemctl start ovn-northd
ovn-nbctl set-connection ptcp:6641
ovn-sbctl set-connection ptcp:6642
ovs-vsctl set open . external_ids:system-id=hv1 external_ids:ovn-remote=tcp:20.0.50.26:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=20.0.50.26
systemctl restart ovn-controller

ovn-nbctl ls-add sw0

ovn-nbctl lsp-add sw0 sw0-p1
ovn-nbctl lsp-set-addresses sw0-p1 "50:54:00:00:00:03 10.0.0.3"
ovn-nbctl lsp-set-port-security sw0-p1 "50:54:00:00:00:03 10.0.0.3"

ovs-vsctl add-port br-int p1 -- \
    set Interface p1 external_ids:iface-id=sw0-p1 -- \
    set Interface p1 type=internal

while ! ovn-sbctl show | grep sw0-p1
do
    sleep 1
done

# the port should be up
ovn-nbctl lsp-get-up sw0-p1

ovn-sbctl show

ovs-vsctl set interface p1 type=\"\"

# the ofport of p1 interface will be -1.
ovs-vsctl get interface p1 ofport
sleep 5

# The logical port should be down. But its not
ovn-nbctl lsp-get-up sw0-p1

ovn-sbctl show

result:

+ ovn-sbctl show                       
+ grep sw0-p1                                        
+ sleep 1                      
+ ovn-sbctl show                    
+ grep sw0-p1                              
    Port_Binding sw0-p1    
+ ovn-nbctl lsp-get-up sw0-p1
up                                
+ ovn-sbctl show                  
Chassis hv1                                                                                                                                                                                                
    hostname: hp-dl380pg8-13.rhts.eng.pek2.redhat.com
    Encap geneve
        ip: "20.0.50.26"
        options: {csum="true"}
    Port_Binding sw0-p1     
+ ovs-vsctl set interface p1 'type=""'                         
+ ovs-vsctl get interface p1 ofport                                
-1
+ sleep 5                        
+ ovn-nbctl lsp-get-up sw0-p1                         
up    

<=== still up
                            
+ ovn-sbctl show
Chassis hv1                         
    hostname: hp-dl380pg8-13.rhts.eng.pek2.redhat.com
    Encap geneve
        ip: "20.0.50.26"
        options: {csum="true"}
    Port_Binding sw0-p1
[root@hp-dl380pg8-13 bz1861298]# rpm -qa | grep -E "openvswitch|ovn"
openvswitch2.13-2.13.0-39.el7fdp.x86_64
ovn2.13-central-20.06.1-4.el7fdp.x86_64
openvswitch-selinux-extra-policy-1.0-15.el7fdp.noarch
ovn2.13-20.06.1-4.el7fdp.x86_64     
ovn2.13-host-20.06.1-4.el7fdp.x86_64

Verified on ovn2.13.0-20.06-6:

+ ovn-sbctl show
+ grep sw0-p1
+ sleep 1
+ ovn-sbctl show
+ grep sw0-p1
    Port_Binding sw0-p1
+ ovn-nbctl lsp-get-up sw0-p1
up
+ ovn-sbctl show
Chassis hv1
    hostname: hp-dl380pg8-13.rhts.eng.pek2.redhat.com
    Encap geneve
        ip: "20.0.50.26"
        options: {csum="true"}
    Port_Binding sw0-p1
+ ovs-vsctl set interface p1 'type=""'
+ ovs-vsctl get interface p1 ofport
-1
+ sleep 5
+ ovn-nbctl lsp-get-up sw0-p1
down

<=== status is down

+ ovn-sbctl show
Chassis hv1
    hostname: hp-dl380pg8-13.rhts.eng.pek2.redhat.com
    Encap geneve
        ip: "20.0.50.26"
        options: {csum="true"}
[root@hp-dl380pg8-13 bz1861298]# rpm -qa | grep -E "openvswitch|ovn"
openvswitch2.13-2.13.0-39.el7fdp.x86_64
ovn2.13-host-20.06.1-6.el7fdp.x86_64
openvswitch-selinux-extra-policy-1.0-15.el7fdp.noarch
ovn2.13-central-20.06.1-6.el7fdp.x86_64
ovn2.13-20.06.1-6.el7fdp.x86_64

Comment 4 Jianlin Shi 2020-07-30 01:20:55 UTC
Verified on rhel8 version:

+ ovs-vsctl add-port br-int p1 -- set Interface p1 external_ids:iface-id=sw0-p1 -- set Interface p1 type=internal
+ ovn-sbctl show                                                                                      
+ grep sw0-p1                                                                                         
+ sleep 1                                                                                             
+ ovn-sbctl show                                                                                      
+ grep sw0-p1                                                                                         
    Port_Binding sw0-p1                                                                               
+ ovn-nbctl lsp-get-up sw0-p1                                                                         
up                                                                                                    
+ ovn-sbctl show                                                                                      
Chassis hv1                                                                                           
    hostname: dell-per740-42.rhts.eng.pek2.redhat.com
    Encap geneve                                                                                      
        ip: "20.0.50.25"                                                                              
        options: {csum="true"}                                                                        
    Port_Binding sw0-p1                                                                               
+ ovs-vsctl set interface p1 'type=""'                                                                
+ ovs-vsctl get interface p1 ofport                                                                   
-1                                                                                                    
+ sleep 5                                                                                             
+ ovn-nbctl lsp-get-up sw0-p1                                                                         
down                                                                                                  
+ ovn-sbctl show                                                                                      
Chassis hv1                                                                                           
    hostname: dell-per740-42.rhts.eng.pek2.redhat.com
    Encap geneve                                                                                      
        ip: "20.0.50.25"                                                                              
        options: {csum="true"}                                                                        
[root@dell-per740-42 bz1861298]# rpm -qa | grep -E "openvswitch|ovn"
openvswitch-selinux-extra-policy-1.0-23.el8fdp.noarch
ovn2.13-host-20.06.1-6.el8fdp.x86_64
openvswitch2.13-2.13.0-48.el8fdp.x86_64
ovn2.13-central-20.06.1-6.el8fdp.x86_64
ovn2.13-20.06.1-6.el8fdp.x86_64

Comment 6 errata-xmlrpc 2020-08-18 11:23:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ovn2.13 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3488