adding vxlan interface to bridge raises error when already added

  • 1
  • Problem
  • Updated 3 months ago
When I add an vxlan interface to a bridge and the interface is already added the net command raises an error.
cumulus@nw-rc0-tor01:~$ net add vxlan vxlan104001 bridge access 4001
ERROR: vxlan104001's configuration already has 'bridge-access 4001'
cumulus@nw-rc0-tor01:~$ 

On the command line this is no issue but when doing it with ansible and the nclu module it breaks the playbook when run for the second time

TASK [cumulus_tor : create l3 vni per vrf] ******************************************************************************************************************************
failed: [10.3.30.12] (item={u'vlan': 4001, u'name': u'in_data'}) => {"changed": false, "failed": true, "item": {"name": "in_data", "vlan": 4001}, "msg": "Failed on line add vxlan vxlan104001 bridge access 4001"}

many other nclu commands just work fine (although some return changed without changing anything)

Eelco
Photo of Eelco Nieuwstad

Eelco Nieuwstad

  • 220 Points 100 badge 2x thumb

Posted 3 months ago

  • 1
Photo of Eric Pulvino

Eric Pulvino, Official Rep

  • 3,930 Points 3k badge 2x thumb
Eelco,
This is due to CM-19343 (affects 3.5.0 and 3.5.1) it will be fixed in the next version of Cumulus Linux. It's a one line change that I can provide if you're interested in a patch. I'm on mobile now but can dig it up when I sit down at my computer.
Photo of Eelco Nieuwstad

Eelco Nieuwstad

  • 220 Points 100 badge 2x thumb
Eric,

thanks for the very fast response. If you can provide me with the one liner I should be able to fix it myself for now.

Eelco
Photo of Eric Pulvino

Eric Pulvino, Official Rep

  • 3,930 Points 3k badge 2x thumb
Line 1391 of /usr/lib/python2.7/dist-packages/nclu/iface.py
Currently looks like -->    print "ERROR: {0}'s configuration already has '{1}'".format(self, new_cmd.strip())
Should look like    -->    print "{0}'s configuration already has '{1}'".format(self, new_cmd.strip())

After making the change above, restart netd:
sudo systemctl restart netd.service
I've tested it on my 3.5.1 VX node and the change seems to produce the desired effect:
cumulus@leaf04:~$ net add interface swp1 bridge access 10
ERROR: swp1's configuration already has 'bridge-access 10'
cumulus@leaf04:~$ net abort

cumulus@leaf04:~$ sudo vi /usr/lib/python2.7/dist-packages/nclu/iface.py

cumulus@leaf04:~$ sudo systemctl restart netd
cumulus@leaf04:~$ net add interface swp1 bridge  access 10

cumulus@leaf04:~$ net add interface swp1 bridge  access 10
swp1's configuration already has 'bridge-access 10' 
Photo of Eelco Nieuwstad

Eelco Nieuwstad

  • 220 Points 100 badge 2x thumb
Eric,

I changed that line (1388 on 3.5) and it resolved the issue. I noticed there are also some BGP commands which are reported as changed by Ansible when in fact nothing has changed. Just a cosmetich thing but I like my Ansible playbooks to stay clean

Eelco
Photo of Eelco Nieuwstad

Eelco Nieuwstad

  • 220 Points 100 badge 2x thumb
Eric,

this task is reported changed every time it is executed
- name: add bgp for backbone
  nclu:
    commands:
#      - "add interface {{ item[0] }}.{{ item[1].id }} vrf {{ item[1].vrf }}"
      - "add bgp vrf {{ item[1].vrf }} neighbor {{ item[0] }}.{{ item[1].id }} remote-as external"
    commit: true
  with_nested:
      - "{{ uplinks }}"
      - "{{ vlans }}"

In this task i create a bgp neighbors for a number of unnumberd interfaces in a vrf

This is the anisble log
changed: [10.3.8.27] => (item=[u'swp1', {u'id': 107, u'vrf': u'mgmt_drac'}]) => {
    "changed": true,
    "failed": false,
    "invocation": {
        "module_args": {
            "abort": false,
            "atomic": false,
            "commands": [
                "add bgp vrf mgmt_drac neighbor swp1.107 remote-as external"
            ],
            "commit": true,
            "description": "Ansible-originated commit",
            "template": null
        }
    },
    "item": [
        "swp1",
        {
            "id": 107,
            "vrf": "mgmt_drac"
        }
    ],
    "msg": "\n"
}