os_net_config.utils._is_active_nic gives wrong result for linux bond

Bug #1537330 reported by xin wu on 2016-01-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

My understanding of the os_net_config.utils._is_active_nic is to check if a physical nic is up. One of the condition is that addr_assign_type needs to be 0. However, this is not true for a physical interface that belongs to a linux bond. Following is an example, in which physical nic p1p1 belongs to linux bond bond1, however, its addr_assign_type is 3.

[root@overcloud-compute-0 heat-admin]# cat /etc/os-net-config/config.json
{"network_config": [{"routes": [{"ip_netmask": "", "next_hop": ""}, {"default": true, "next_hop": ""}], "use_dhcp": false, "type": "interface", "name": "nic2", "addresses": [{"ip_netmask": ""}]}, {"dns_servers": ["", ""], "type": "ovs_bridge", "name": "br-ex", "members": [{"type": "linux_bond", "name": "bond1", "members": [{"type": "interface", "name": "nic3"}, {"type": "interface", "name": "nic4"}], "bonding_options": "mode=4 lacp_rate=1 miimon=50 updelay=15000 xmit_hash_policy=1"}, {"device": "bond1", "type": "vlan", "addresses": [{"ip_netmask": ""}], "vlan_id": 101}, {"device": "bond1", "type": "vlan", "addresses": [{"ip_netmask": ""}], "vlan_id": 102}, {"device": "bond1", "type": "vlan", "addresses": [{"ip_netmask": ""}], "vlan_id": 50}]}]}

[root@overcloud-compute-0 heat-admin]# ovs-vsctl show
    Bridge br-ex
        Port br-ex
            Interface br-ex
                type: internal
        Port "bond1"
            Interface "bond1"
    ovs_version: "2.4.0"

[root@overcloud-compute-0 heat-admin]# ethtool p1p1
Settings for p1p1:
 Supported ports: [ FIBRE ]
 Supported link modes: 10000baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: No
 Advertised link modes: 10000baseT/Full
 Advertised pause frame use: No
 Advertised auto-negotiation: No
 Speed: 10000Mb/s
 Duplex: Full
 Port: Direct Attach Copper
 Transceiver: external
 Auto-negotiation: off
 Supports Wake-on: d
 Wake-on: d
 Current message level: 0x00000007 (7)
          drv probe link
 Link detected: yes

[root@overcloud-compute-0 heat-admin]# cat /sys/class/net/p1p1/addr_assign_type

xin wu (xin-wu) wrote :

Initial fix is proposed at https://review.openstack.org/#/c/279842/

Dan Sneddon (dsneddon) on 2018-10-26
Changed in os-net-config:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers