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

Data model issues after upgrading to 5.0 #4686

Open
1 task done
duddis1 opened this issue Nov 5, 2024 · 8 comments
Open
1 task done

Data model issues after upgrading to 5.0 #4686

duddis1 opened this issue Nov 5, 2024 · 8 comments
Labels
type: enhancement New feature or request

Comments

@duddis1
Copy link

duddis1 commented Nov 5, 2024

Enhancement summary

We are trying to adopt arista AVD version v5.0.0, and finding below validation errors.

ERROR! [MBH-CAMP0S]: 'Validation Error: servers': Invalid type 'dict'. Expected a 'list'.
ERROR! [MBH-CAMP0S]: 'Validation Error: tenants': Invalid type 'dict'. Expected a 'list'.
ERROR! [MBH-CAMP0S]: 'Validation Error: l3_edge.p2p_links_ip_pools': Invalid type 'dict'. Expected a 'list'.
ERROR! [MBH-CAMP0S]: 'Validation Error: local_users': Invalid type 'dict'. Expected a 'list'.
ERROR! [MBH-CAMP0S]: 'Validation Error: node_type_keys': Primary key 'key' is not set on all items as required.
ERROR! [MBH-CAMP0S]: 'Validation Error: port_profiles[15].dot1x': Unexpected key(s) 'eapol' found in dict.

We can find from the release notes Data model changes from “dict-of-dicts” to “list-of-dicts” for only Ethernet interfaces, and you are using the key as "name" for the Ethernet interface name.

ethernet_interfaces:
-  Ethernet1:   # <-- User defined key
+  - name: Ethernet1 # <-- "name" here is called the "primary_key" which must have a unique value across all list elements
    <...>

but we can't find the key name for ip_address and ip_helper attributes, please let us know which key we have to use for ip_address and ip_helper values while converting them to list of lists.

Which component of AVD is impacted

eos_cli_config_gen

Use case example

We tried populating the config using below list of lists format for ip_helpers and ip_address for bgp_peers, but getting error saying ip_helper is not a valid key.

        ip_helpers:
        - ip_helper: 10.254.52.5
      bgp_peers:
      - local_as: 65106
        remote_as: 204260
        description: em-palo-3220-a
        ip_address: 192.168.100.158
        nodes:
        - MBH-BL1A

Describe the solution you would like

The config should access the key names ip_helper and ip_address as detailed below.

        ip_helpers:
        - ip_helper: 10.254.52.5
      bgp_peers:
      - local_as: 65106
        remote_as: 204260
        description: em-palo-3220-a
        ip_address: 192.168.100.158
        nodes:
        - MBH-BL1A

Describe alternatives you have considered

No response

Additional context

No response

Contributing Guide

  • I agree to follow this project's Code of Conduct
@duddis1 duddis1 added the type: enhancement New feature or request label Nov 5, 2024
@duddis1
Copy link
Author

duddis1 commented Nov 5, 2024

also, please advise how can we resolve the below two errors, if you have any idea?

ERROR! [MBH-CAMP0S]: 'Validation Error: node_type_keys': Primary key 'key' is not set on all items as required.
ERROR! [MBH-CAMP0S]: 'Validation Error: port_profiles[15].dot1x': Unexpected key(s) 'eapol' found in dict.

@ClausHolbechArista
Copy link
Contributor

The primary key is always the first key shown in the documentation for a given list of dicts.
You suggestion for ip_helper looks good to me, and we use the same in our test cases.

            ip_helpers:
              - ip_helper: 1.1.1.1

ERROR! [MBH-CAMP0S]: 'Validation Error: node_type_keys': Primary key 'key' is not set on all items as required.

Without seeing your inputs for node_type_keys I cannot say anything else than the error states. You are missing a key named key on one of the list elements.

ERROR! [MBH-CAMP0S]: 'Validation Error: port_profiles[15].dot1x': Unexpected key(s) 'eapol' found in dict.

The eapol key is not supported under the port-profiles according to the documentation and schema, but it actually works because the underlying code is "lazy". We will be adding support for all the dot1x knobs in AVD 5.1.

Until then you can move the dot1x key under structured_config and it will render correctly.

@ClausHolbechArista ClausHolbechArista changed the title Feature request Title Data model issues after upgrading to 5.0 Nov 6, 2024
@duddis1
Copy link
Author

duddis1 commented Nov 11, 2024

Thanks for providing the details!

if I move dot1x key under structured_config it is rendering correctly, but it is applied to all the switches. I have to see whether I can restrict this in populating for only campus switches.

also , I have amended the type for node_type_keys from spine to l2spine as mentioned in below link
(#4340), but still seeing below validation errors. Can you please advise on these errors?

ERROR! [MBH-SPINE1]: 'Validation Error: node_type_keys': Primary key 'key' is not set on all items as required.
ERROR! [MBH-SPINE1]: 'Validation Error: type': 'spine' is not one of ['bleaf', 'campus', 'ixleaf', 'l2leaf', 'l3leaf', 'overlay-controller', 'l2spine', 'super-spine']

@duddis1
Copy link
Author

duddis1 commented Nov 11, 2024

node_type_keys

I have attached the screenshot for the node_type_keys config, what is the Primary key 'key' in node_type_keys the config is expecting?

@ClausHolbechArista
Copy link
Contributor

You need to add key which refers to the key like l3leaf under which you set defaults, nodes etc. The value of type is the value that goes under the type: <type> which may or may not be the same.

@ClausHolbechArista
Copy link
Contributor

if I move dot1x key under structured_config it is rendering correctly, but it is applied to all the switches. I have to see whether I can restrict this in populating for only campus switches.

I meant add it under the structured_config key on the endpoint directly. Then it will only render for the ports pointing to this endpoint. If you need it on multiple ports, you can use port_profiles.

@duddis1
Copy link
Author

duddis1 commented Nov 20, 2024

The above-mentioned errors have been resolved. Currently, the following error is pending:
I have already set the bgp_as on the hosts, but I am still encountering the error below. Could you please advise if there has been any change in how this value should be set on the hosts?

TASK [arista.avd.eos_designs : Set eos_designs facts] ***************************************************************************************************************************************************************
task path: /home/avd/.ansible/collections/ansible_collections/arista/avd/roles/eos_designs/tasks/main.yml:28
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
redirecting (type: httpapi) ansible.builtin.eos to arista.eos.eos
The full traceback is:
Traceback (most recent call last):
File "/home/avd/.ansible/collections/ansible_collections/arista/avd/plugins/action/eos_designs_facts.py", line 196, in render_avd_switch_facts
rendered_facts[host] = {"switch": avd_switch_facts_instances[host]["switch"].render()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/avd/.local/share/virtualenvs/netbox_extract-zMJz_RXI/lib/python3.12/site-packages/pyavd/_eos_designs/avdfacts.py", line 64, in render
return {key: getattr(self, key) for key in self.keys() if getattr(self, key) is not None}
^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/functools.py", line 993, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/avd/.local/share/virtualenvs/netbox_extract-zMJz_RXI/lib/python3.12/site-packages/pyavd/_eos_designs/eos_designs_facts/init.py", line 121, in bgp_as
return self.shared_utils.bgp_as
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/functools.py", line 993, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/avd/.local/share/virtualenvs/netbox_extract-zMJz_RXI/lib/python3.12/site-packages/pyavd/_eos_designs/shared_utils/routing.py", line 99, in bgp_as
bgp_as_range_expanded = range_expand(str(get(self.switch_data_combined, "bgp_as", required=True)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/avd/.local/share/virtualenvs/netbox_extract-zMJz_RXI/lib/python3.12/site-packages/pyavd/_utils/get.py", line 60, in get
raise AristaAvdMissingVariableError(org_key)
pyavd._errors.AristaAvdMissingVariableError: 'bgp_as' is required but was not found.
fatal: [MBH-CAMP0S]: FAILED! => {
"changed": false,
"msg": "'bgp_as' is required but was not found for host 'MBH-OOB-SW01'."
}

@ClausHolbechArista
Copy link
Contributor

So AVD wants to configure BGP for the switch MBH-OOB-SW01 but it cannot find a BGP AS number defined for this switch. Without knowing more of your inventory, it can be hard to say much more.
Feel free to contact me on holbech@arista.com if you want to share some more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants