os_net_config.utils._is_active_nic gives wrong result for linux bond

Bug #1537330 reported by xin wu on 2016-01-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-net-config
Undecided
Unassigned

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": "169.254.169.254/32", "next_hop": "192.0.2.1"}, {"default": true, "next_hop": "192.0.2.1"}], "use_dhcp": false, "type": "interface", "name": "nic2", "addresses": [{"ip_netmask": "192.0.2.22/24"}]}, {"dns_servers": ["8.8.8.8", "8.8.4.4"], "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": "172.17.0.15/24"}], "vlan_id": 101}, {"device": "bond1", "type": "vlan", "addresses": [{"ip_netmask": "172.18.0.15/24"}], "vlan_id": 102}, {"device": "bond1", "type": "vlan", "addresses": [{"ip_netmask": "172.17.1.13/24"}], "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
 PHYAD: 0
 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
3

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