Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1643749

Summary: [RFE] Supporting ovn-nbctl lsp-set-addresses port_name "dynamic unknown"
Product: Red Hat Enterprise Linux 7 Reporter: Yuval Lifshitz <ylifshit>
Component: openvswitchAssignee: lorenzo bianconi <lorenzo.bianconi>
Status: CLOSED ERRATA QA Contact: haidong li <haili>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.5CC: alkaplan, atragler, ctrautma, lorenzo.bianconi, mmichels, pvauter, qding, tredaelli, ylifshit, ysegev
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openvswitch-2.9.0-90.el7fdn Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1662905 (view as bug list) Environment:
Last Closed: 2019-03-06 10:56:36 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:
Bug Depends On:    
Bug Blocks: 1662905    

Description Yuval Lifshitz 2018-10-28 10:42:41 UTC
Currently OVN allows for dynamic allocation of either an IP address or a combination of MAC+IP for a logical port.

In the case that I use a localnet port, I want OVN to allocate a MAC address to the port, but not the IP (since this is connected to an L2 network which takes care of IP allocations).

If I set "unknown" to the logical port, I get no MAC either.

Comment 14 Yossi Segev 2018-12-11 12:20:29 UTC
Bug still occurs.
I have used the new rpm's Lorenzo supplied in https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19438217. The rpm's here are the same as those in https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19244845, which is what Lorenzo provided in the previous comment.

Reproduction scenario:
1. Removed the previously installed openvswitch and openvswitch-ovn packages. These were of version 2.10.0 (2.10.0-34 to be precise).
 $ yum  remove openvswitch2.10*
2. Installed the new packages taken from the brew link (using "yum install").
3. Verified the new packages were installed:
 [root@ysegev-rhel7 ~]# rpm -qa | grep openvswitch
 openvswitch-ovn-common-2.9.0-85.el7fdn.x86_64
 openvswitch-ovn-vtep-2.9.0-85.el7fdn.x86_64
 openvswitch-selinux-extra-policy-1.0-9.el7fdp.noarch
 openvswitch-test-2.9.0-85.el7fdn.noarch
 openvswitch-devel-2.9.0-85.el7fdn.x86_64
 openvswitch-2.9.0-85.el7fdn.x86_64
 openvswitch-ovn-host-2.9.0-85.el7fdn.x86_64
 openvswitch-debuginfo-2.9.0-85.el7fdn.x86_64
 openvswitch-ovn-central-2.9.0-85.el7fdn.x86_64
 python-openvswitch-2.9.0-85.el7fdn.x86_64
4. $ /usr/share/openvswitch/scripts/ovn-ctl start_northd
5. $ /usr/share/openvswitch/scripts/ovn-ctl start_controller
6. $ ovn-nbctl list logical_switch_port port_with_no_subnet
7. $ ovn-nbctl ls-add test_switch
8. $ ovn-nbctl lsp-add test_switch port_with_no_subnet
9. $ ovn-nbctl lsp-set-addresses port_with_no_subnet "dynamic"


Expected result:
Dynamic MAC address should occur.


Actual result:
 _uuid               : 071121dd-cb5b-41bc-b330-715aaa9bd2c9
 addresses           : [dynamic]
 dhcpv4_options      : []
 dhcpv6_options      : []
 dynamic_addresses   : []
 enabled             : []
 external_ids        : {}
 name                : port_with_no_subnet
 options             : {}
 parent_name         : []
 port_security       : []
 tag                 : []
 tag_request         : []
 type                : ""
 up                  : false

dynamic_addresses field remains blank.


What I find strange here is that the new version number (2.9.0) is higher than the old version (2.10.0).
Could it be that the version in the brew link is old, and doesn't include the fix?

Comment 15 lorenzo bianconi 2018-12-11 13:24:42 UTC
(In reply to Yossi Segev from comment #14)
> Bug still occurs.
> I have used the new rpm's Lorenzo supplied in
> https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19438217. The
> rpm's here are the same as those in
> https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19244845, which
> is what Lorenzo provided in the previous comment.
> 
> Reproduction scenario:
> 1. Removed the previously installed openvswitch and openvswitch-ovn
> packages. These were of version 2.10.0 (2.10.0-34 to be precise).
>  $ yum  remove openvswitch2.10*
> 2. Installed the new packages taken from the brew link (using "yum install").
> 3. Verified the new packages were installed:
>  [root@ysegev-rhel7 ~]# rpm -qa | grep openvswitch
>  openvswitch-ovn-common-2.9.0-85.el7fdn.x86_64
>  openvswitch-ovn-vtep-2.9.0-85.el7fdn.x86_64
>  openvswitch-selinux-extra-policy-1.0-9.el7fdp.noarch
>  openvswitch-test-2.9.0-85.el7fdn.noarch
>  openvswitch-devel-2.9.0-85.el7fdn.x86_64
>  openvswitch-2.9.0-85.el7fdn.x86_64
>  openvswitch-ovn-host-2.9.0-85.el7fdn.x86_64
>  openvswitch-debuginfo-2.9.0-85.el7fdn.x86_64
>  openvswitch-ovn-central-2.9.0-85.el7fdn.x86_64
>  python-openvswitch-2.9.0-85.el7fdn.x86_64
> 4. $ /usr/share/openvswitch/scripts/ovn-ctl start_northd
> 5. $ /usr/share/openvswitch/scripts/ovn-ctl start_controller
> 6. $ ovn-nbctl list logical_switch_port port_with_no_subnet
> 7. $ ovn-nbctl ls-add test_switch
> 8. $ ovn-nbctl lsp-add test_switch port_with_no_subnet
> 9. $ ovn-nbctl lsp-set-addresses port_with_no_subnet "dynamic"
> 
> 
> Expected result:
> Dynamic MAC address should occur.
> 
> 
> Actual result:
>  _uuid               : 071121dd-cb5b-41bc-b330-715aaa9bd2c9
>  addresses           : [dynamic]
>  dhcpv4_options      : []
>  dhcpv6_options      : []
>  dynamic_addresses   : []
>  enabled             : []
>  external_ids        : {}
>  name                : port_with_no_subnet
>  options             : {}
>  parent_name         : []
>  port_security       : []
>  tag                 : []
>  tag_request         : []
>  type                : ""
>  up                  : false
> 
> dynamic_addresses field remains blank.

Hi Yossi,

you need to set mac_only to true in logical_switch table

$ovn-nbctl --wait=sb set Logical-Switch test_switch other_config:mac_only=true


> 
> 
> What I find strange here is that the new version number (2.9.0) is higher
> than the old version (2.10.0).
> Could it be that the version in the brew link is old, and doesn't include
> the fix?

Since the RFE is for openvswitch 2.9, I backported the new feature just on it for the moment

Comment 16 Yossi Segev 2018-12-11 13:56:58 UTC
After configuring mac_only=true as Lorenzo suggested - dynamic MAC address appears:

[root@ysegev-rhel7 ~]# ovn-nbctl list logical_switch_port port_with_no_subnet
_uuid               : 071121dd-cb5b-41bc-b330-715aaa9bd2c9
addresses           : [dynamic]
dhcpv4_options      : []
dhcpv6_options      : []
dynamic_addresses   : "0a:00:00:00:00:01"
enabled             : []
external_ids        : {}
name                : port_with_no_subnet
options             : {}
parent_name         : []
port_security       : []
tag                 : []
tag_request         : []
type                : ""
up                  : false

Comment 17 lorenzo bianconi 2018-12-11 14:12:14 UTC
(In reply to Yossi Segev from comment #16)
> After configuring mac_only=true as Lorenzo suggested - dynamic MAC address
> appears:
> 
> [root@ysegev-rhel7 ~]# ovn-nbctl list logical_switch_port port_with_no_subnet
> _uuid               : 071121dd-cb5b-41bc-b330-715aaa9bd2c9
> addresses           : [dynamic]
> dhcpv4_options      : []
> dhcpv6_options      : []
> dynamic_addresses   : "0a:00:00:00:00:01"
> enabled             : []
> external_ids        : {}
> name                : port_with_no_subnet
> options             : {}
> parent_name         : []
> port_security       : []
> tag                 : []
> tag_request         : []
> type                : ""
> up                  : false

Does that feature fix your use case? If so I will post the patch upstream

Comment 18 Alona Kaplan 2018-12-11 14:16:17 UTC
(In reply to lorenzo bianconi from comment #17)
> (In reply to Yossi Segev from comment #16)
> > After configuring mac_only=true as Lorenzo suggested - dynamic MAC address
> > appears:
> > 
> > [root@ysegev-rhel7 ~]# ovn-nbctl list logical_switch_port port_with_no_subnet
> > _uuid               : 071121dd-cb5b-41bc-b330-715aaa9bd2c9
> > addresses           : [dynamic]
> > dhcpv4_options      : []
> > dhcpv6_options      : []
> > dynamic_addresses   : "0a:00:00:00:00:01"
> > enabled             : []
> > external_ids        : {}
> > name                : port_with_no_subnet
> > options             : {}
> > parent_name         : []
> > port_security       : []
> > tag                 : []
> > tag_request         : []
> > type                : ""
> > up                  : false
> 
> Does that feature fix your use case? If so I will post the patch upstream

Yes, thanks.

Comment 20 haidong li 2019-02-15 08:41:04 UTC
I have tested this and have a question about the "mac_only=true" configuration.
If I have set the "other_config:subnet" and "other_config:ipv6_prefix",will ovn still assign ip for port with the option "mac_only=true" set? The test shows ovn will also assign dynamic ip for port:

[root@dell-per730-19 ~]# ovn-nbctl get Logical-Switch s1 other_config
{"ipv6_prefix"="3000::0", mac_only="true", subnet="172.16.0.0/24"}
[root@dell-per730-19 ~]#  ovn-nbctl get Logical-Switch-Port lsp2 dynamic_addresses
"00:11:22:10:00:03 172.16.0.2 3000::211:22ff:fe10:3"
[root@dell-per730-19 ~]#

Comment 21 lorenzo bianconi 2019-02-18 13:32:27 UTC
(In reply to haidong li from comment #20)
> I have tested this and have a question about the "mac_only=true"
> configuration.
> If I have set the "other_config:subnet" and "other_config:ipv6_prefix",will
> ovn still assign ip for port with the option "mac_only=true" set? The test
> shows ovn will also assign dynamic ip for port:
> 
> [root@dell-per730-19 ~]# ovn-nbctl get Logical-Switch s1 other_config
> {"ipv6_prefix"="3000::0", mac_only="true", subnet="172.16.0.0/24"}
> [root@dell-per730-19 ~]#  ovn-nbctl get Logical-Switch-Port lsp2
> dynamic_addresses
> "00:11:22:10:00:03 172.16.0.2 3000::211:22ff:fe10:3"
> [root@dell-per730-19 ~]#

Hi haidong,

correct, mac_only will be overwritten by subnet/ipv6_prefix options

Comment 22 haidong li 2019-02-19 02:49:15 UTC
This bug is verified on the latest version:
[root@dell-per730-57 ~]# systemctl restart openvswitch
[root@dell-per730-57 ~]# systemctl start ovn-controller
[root@dell-per730-57 ~]# rpm -qa | grep openvswitch
openvswitch-ovn-host-2.9.0-95.el7fdp.x86_64
openvswitch-2.9.0-95.el7fdp.x86_64
openvswitch-ovn-central-2.9.0-95.el7fdp.x86_64
openvswitch-selinux-extra-policy-1.0-10.el7fdp.noarch
openvswitch-ovn-common-2.9.0-95.el7fdp.x86_64
[root@dell-per730-57 ~]# uname -a
Linux dell-per730-57.rhts.eng.pek2.redhat.com 3.10.0-957.el7.x86_64 #1 SMP Thu Oct 4 20:48:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@dell-per730-57 ~]# systemctl start ovn-northd
[root@dell-per730-57 ~]# ovn-nbctl ls-add s2
[root@dell-per730-57 ~]# ovn-nbctl lsp-add s2 lsp1
[root@dell-per730-57 ~]# ovn-nbctl lsp-set-addresses lsp1 dynamic
[root@dell-per730-57 ~]# ovn-nbctl get Logical-Switch-Port lsp1 dynamic_addresses
[]
[root@dell-per730-57 ~]# ovn-nbctl get Logical-Switch-Port lsp1 addresses
[dynamic]
[root@dell-per730-57 ~]# ovn-nbctl set Logical-Switch s2 other_config:mac_only=true
[root@dell-per730-57 ~]# ovn-nbctl get Logical-Switch-Port lsp1 addresses
[dynamic]
[root@dell-per730-57 ~]# ovn-nbctl get Logical-Switch-Port lsp1 dynamic_addresses
"0a:00:00:00:00:01"
[root@dell-per730-57 ~]# ovn-nbctl  set NB_Global . options:mac_prefix=00:00:22:33:44:55
[root@dell-per730-57 ~]# ovn-nbctl get Logical-Switch-Port lsp1 dynamic_addresses
"00:00:22:00:00:01"
[root@dell-per730-57 ~]#

Comment 24 errata-xmlrpc 2019-03-06 10:56:36 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, 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-2019:0466