Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRF module does not catch 'Failed' messages in the DATA field of the response from NDFC. #324

Open
gnakh opened this issue Sep 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gnakh
Copy link

gnakh commented Sep 4, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Ansible Version and collection version

ansible [core 2.17.2]
dcnm collection ver 3.4.3

DCNM version

  • 12.2.2.238

Affected module(s)

  • dcnm_vrf

Ansible Playbook

    - name: Create and attach VRFs to switches in {{ defaults.msd.fabric_name }} fabric
      cisco.dcnm.dcnm_vrf:
        fabric: '{{ defaults.msd.fabric_name }}'
        state: '{{ state | default("merged") }}'
        config: '{{ extra_vrfs }}'
      tags: vrfs

This is a sample VRF. Border leaves are 154.16 and 154.17

extra_vrfs:
  - vrf_name: iot
    vrf_id: 51200
    max_bgp_paths: 4
    vrf_template: '{{ defaults.vrf_template }}'
    vrf_extension_template: '{{ defaults.extension_vrf_template }}'
    vlan_id: 3200
    vrf_int_mtu: 9000
    #source: 123
    #service_vrf_template: null
    attach:
    - ip_address: 198.18.167.9
      deploy: true
    - ip_address: 198.18.167.8
      deploy: true
    - ip_address: 198.18.165.133 
      deploy: true           
    - ip_address: 198.18.167.25 
      deploy: true
    - ip_address: 198.18.167.19 
      deploy: true
    - ip_address: 198.18.154.16 
      vrf_lite:
        - peer_vrf: iot
          ipv4_addr: 172.16.12.2/30
          neighbor_ipv4: 172.16.12.1
          interface: Ethernet1/24
          dot1q: 200
          #extension_subint_mtu: 9000
        - peer_vrf: iot
          ipv4_addr: 172.16.12.10/30
          neighbor_ipv4: 172.16.12.9
          interface: Ethernet1/25
          dot1q: 200
          #extension_subint_mtu: 9000      
        - peer_vrf: iot
          ipv4_addr: 172.16.12.18/30
          neighbor_ipv4: 172.16.12.17
          interface: Ethernet1/26
          dot1q: 200
          #extension_subint_mtu: 9000
        - peer_vrf: iot
          ipv4_addr: 172.16.12.26/30
          neighbor_ipv4: 172.16.12.25
          interface: Ethernet1/27
          dot1q: 200
          #extension_subint_mtu: 9000          
      deploy: true
    - ip_address: 198.18.154.17 
      vrf_lite:
        - peer_vrf: iot
          ipv4_addr: 172.16.12.6/30
          neighbor_ipv4: 172.16.12.5
          interface: Ethernet1/24
          dot1q: 200
          #extension_subint_mtu: 9000
        - peer_vrf: iot
          ipv4_addr: 172.16.12.14/30
          neighbor_ipv4: 172.16.12.13
          interface: Ethernet1/25
          dot1q: 200
          #extension_subint_mtu: 9000      
        - peer_vrf: iot
          ipv4_addr: 172.16.12.22/30
          neighbor_ipv4: 172.16.12.21
          interface: Ethernet1/26
          dot1q: 200
          #extension_subint_mtu: 9000
        - peer_vrf: iot
          ipv4_addr: 172.16.12.30/30
          neighbor_ipv4: 172.16.12.29
          interface: Ethernet1/27
          dot1q: 200
          #extension_subint_mtu: 9000
      deploy: true

The playbook as such is more or less irrelevant. Anything that creates a VRF would work.

Debug Output

TASK [Create and attach VRFs to switches in xxxxxx_MSD fabric] *************************************************************************************************************************************************
task path: /Users/xxxxxx/Documents/WR/Projects/_2024/xxxxxx/240806_XXXX_PoC/NDFC_Ansible/8_add_more_vrfs.yaml:22
changed: [cpoc-xxxxxx] => {
    "changed": true,
    "diff": [
        {
            "adv_default_routes": true,
            "adv_host_routes": false,
            "attach": [
                {
                    "deploy": true,
                    "ip_address": "198.18.154.16",
                    "vlan_id": 3200
                }
            ],
            "bgp_passwd_encrypt": 3,
            "bgp_password": "",
            "disable_rt_auto": false,
            "export_evpn_rt": "",
            "export_mvpn_rt": "",
            "export_vpn_rt": "",
            "import_evpn_rt": "",
            "import_mvpn_rt": "",
            "import_vpn_rt": "",
            "ipv6_linklocal_enable": true,
            "loopback_route_tag": 12345,
            "max_bgp_paths": 4,
            "max_ibgp_paths": 2,
            "netflow_enable": false,
            "nf_monitor": "",
            "no_rp": false,
            "overlay_mcast_group": "",
            "redist_direct_rmap": "FABRIC-RMAP-REDIST-SUBNET",
            "rp_address": "",
            "rp_external": false,
            "rp_loopback_id": "",
            "service_vrf_template": null,
            "source": null,
            "static_default_route": true,
            "trm_bgw_msite": false,
            "trm_enable": false,
            "underlay_mcast_ip": "",
            "vrf_description": "",
            "vrf_extension_template": "Default_VRF_Extension_Universal",
            "vrf_id": 51200,
            "vrf_int_mtu": 9000,
            "vrf_intf_desc": "",
            "vrf_name": "iot",
            "vrf_template": "Default_VRF_Universal",
            "vrf_vlan_name": ""
        },
        {
            "adv_default_routes": true,
            "adv_host_routes": false,
            "attach": [
                {
                    "deploy": true,
                    "ip_address": "198.18.154.16",
                    "vlan_id": 3300
                }
            ],
            "bgp_passwd_encrypt": 3,
            "bgp_password": "",
            "disable_rt_auto": false,
            "export_evpn_rt": "",
            "export_mvpn_rt": "",
            "export_vpn_rt": "",
            "import_evpn_rt": "",
            "import_mvpn_rt": "",
            "import_vpn_rt": "",
            "ipv6_linklocal_enable": true,
            "loopback_route_tag": 12345,
            "max_bgp_paths": 4,
            "max_ibgp_paths": 2,
            "netflow_enable": false,
            "nf_monitor": "",
            "no_rp": false,
            "overlay_mcast_group": "",
            "redist_direct_rmap": "FABRIC-RMAP-REDIST-SUBNET",
            "rp_address": "",
            "rp_external": false,
            "rp_loopback_id": "",
            "service_vrf_template": null,
            "source": null,
            "static_default_route": true,
            "trm_bgw_msite": false,
            "trm_enable": false,
            "underlay_mcast_ip": "",
            "vrf_description": "",
            "vrf_extension_template": "Default_VRF_Extension_Universal",
            "vrf_id": 51300,
            "vrf_int_mtu": 9000,
            "vrf_intf_desc": "",
            "vrf_name": "guest",
            "vrf_template": "Default_VRF_Universal",
            "vrf_vlan_name": ""
        }
    ],
    "invocation": {
        "module_args": {
            "config": [
                {
                    "attach": [
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.9"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.8"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.165.133"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.25"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.19"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.154.16",
                            "vrf_lite": [
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/24",
                                    "ipv4_addr": "172.16.12.2/30",
                                    "neighbor_ipv4": "172.16.12.1",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/25",
                                    "ipv4_addr": "172.16.12.10/30",
                                    "neighbor_ipv4": "172.16.12.9",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/26",
                                    "ipv4_addr": "172.16.12.18/30",
                                    "neighbor_ipv4": "172.16.12.17",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/27",
                                    "ipv4_addr": "172.16.12.26/30",
                                    "neighbor_ipv4": "172.16.12.25",
                                    "peer_vrf": "iot"
                                }
                            ]
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.154.17",
                            "vrf_lite": [
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/24",
                                    "ipv4_addr": "172.16.12.6/30",
                                    "neighbor_ipv4": "172.16.12.5",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/25",
                                    "ipv4_addr": "172.16.12.14/30",
                                    "neighbor_ipv4": "172.16.12.13",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/26",
                                    "ipv4_addr": "172.16.12.22/30",
                                    "neighbor_ipv4": "172.16.12.21",
                                    "peer_vrf": "iot"
                                },
                                {
                                    "dot1q": 200,
                                    "interface": "Ethernet1/27",
                                    "ipv4_addr": "172.16.12.30/30",
                                    "neighbor_ipv4": "172.16.12.29",
                                    "peer_vrf": "iot"
                                }
                            ]
                        }
                    ],
                    "max_bgp_paths": 4,
                    "vlan_id": 3200,
                    "vrf_extension_template": "Default_VRF_Extension_Universal",
                    "vrf_id": 51200,
                    "vrf_int_mtu": 9000,
                    "vrf_name": "iot",
                    "vrf_template": "Default_VRF_Universal"
                },
                {
                    "attach": [
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.9"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.8"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.165.133"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.25"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.167.19"
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.154.16",
                            "vrf_lite": [
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/24",
                                    "ipv4_addr": "172.16.12.2/30",
                                    "neighbor_ipv4": "172.16.12.1",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/25",
                                    "ipv4_addr": "172.16.12.10/30",
                                    "neighbor_ipv4": "172.16.12.9",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/26",
                                    "ipv4_addr": "172.16.12.18/30",
                                    "neighbor_ipv4": "172.16.12.17",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/27",
                                    "ipv4_addr": "172.16.12.26/30",
                                    "neighbor_ipv4": "172.16.12.25",
                                    "peer_vrf": "guest"
                                }
                            ]
                        },
                        {
                            "deploy": true,
                            "ip_address": "198.18.154.17",
                            "vrf_lite": [
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/24",
                                    "ipv4_addr": "172.16.12.6/30",
                                    "neighbor_ipv4": "172.16.12.5",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/25",
                                    "ipv4_addr": "172.16.12.14/30",
                                    "neighbor_ipv4": "172.16.12.13",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/26",
                                    "ipv4_addr": "172.16.12.22/30",
                                    "neighbor_ipv4": "172.16.12.21",
                                    "peer_vrf": "guest"
                                },
                                {
                                    "dot1q": 300,
                                    "interface": "Ethernet1/27",
                                    "ipv4_addr": "172.16.12.30/30",
                                    "neighbor_ipv4": "172.16.12.29",
                                    "peer_vrf": "guest"
                                }
                            ]
                        }
                    ],
                    "max_bgp_paths": 4,
                    "vlan_id": 3300,
                    "vrf_extension_template": "Default_VRF_Extension_Universal",
                    "vrf_id": 51300,
                    "vrf_int_mtu": 9000,
                    "vrf_name": "guest",
                    "vrf_template": "Default_VRF_Universal"
                }
            ],
            "fabric": "xxxxxx_MSD",
            "state": "merged"
        }
    },
    "response": [
        {
            "DATA": {},
            "MESSAGE": "OK",
            "METHOD": "PUT",
            "REQUEST_PATH": "https://198.18.131.10:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/xxxxxx_MSD/vrfs/iot",
            "RETURN_CODE": 200
        },
        {
            "DATA": {},
            "MESSAGE": "OK",
            "METHOD": "PUT",
            "REQUEST_PATH": "https://198.18.131.10:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/xxxxxx_MSD/vrfs/guest",
            "RETURN_CODE": 200
        },
        {
            "DATA": {
                "guest-[FDO22282VHK/BSLEAF101]-[FDO222834CA/BSLEAF102]": "Attach Response : Failed : VPC details not found for Peer Serial no: FDO222834CA",
                "iot-[FDO22282VHK/BSLEAF101]-[FDO222834CA/BSLEAF102]": "Attach Response : Failed : VPC details not found for Peer Serial no: FDO222834CA"
            },
            "MESSAGE": "OK",
            "METHOD": "POST",
            "REQUEST_PATH": "https://198.18.131.10:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/xxxxxx_MSD/vrfs/attachments",
            "RETURN_CODE": 200
        },
        {
            "DATA": {
                "status": "Deployment of VRF(s) has been initiated successfully"
            },
            "MESSAGE": "OK",
            "METHOD": "POST",
            "REQUEST_PATH": "https://198.18.131.10:443/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/xxxxxx_MSD/vrfs/deployments",
            "RETURN_CODE": 200
        }
    ]
}
Read vars_file './exec_vars/defaults.yaml'
Read vars_file './exec_vars/vrfs.yaml'
The task is still successful:
PLAY RECAP *****************************************************************************************************************************************************************************************************
cpoc-xxxxxx                : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

CSCwh23123 describes what that "Failed" message actually means. The configuration between the two peers is inconsistent.

Same Failed message then using the state deleted.

Expected Behavior

Changes to the VRF are added to the NDFC DB and finally pushed to the switches

Actual Behavior

VRF is configured in the NDFC DB but not attached to the border leaf that renders the error. Because it is not attached, configuration is consistent between the switch and NDFC DB and it will never be pushed to the leaf.

Steps to Reproduce

Ran into this issue while trying to create a new attachment for the VRF.

Create a VRF and delete it. Run the task while the VRF is in Delete Holddown state in the border leaf.

BSLEAF101# show vrf
VRF-Name                           VRF-ID State   Reason
default                                 1 Up      --
egress-loadbalance-resolution-          3 Up      --
guest                                  17 Down    Delete Holddown
infra                                  12 Up      --
iot                                    18 Down    Delete Holddown
management                              2 Up      --

References

@mikewiebe mikewiebe added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants