Open jorgenspange opened 3 months ago
auto_generate_switch_pod_profiles - will auto generate all your switch profiles, switch selectors, interface profiles, interface selectors and pod profile auto_generate_pod_profiles - will auto generate pod profile The auto generated pod profile will have in this case "pod-1" name and "pod-1" selector name with type "range" and selector "1" taken from the pod policies configuration.
On a fresh fabric there is usually some pre-created pod profile, that should have no policy group applied. Please verify in your setup if there is no policy group applied there, if there is the same policy, you might see the first error you pasted.
Not sure what you pasted in fabric_policies, the code seems to be copy of pod_policies, but if you want to create manually the pod profile, you need to disable the auto generation
@juchowan thanks for your answer:
This is the entire file:
---
apic:
version: "5.2.8h"
auto_generate_switch_pod_profiles: true
auto_generate_pod_profiles: true
# auto_generate_fabric_leaf_switch_interface_profiles: true
# auto_generate_fabric_spine_switch_interface_profiles: true
# auto_generate_access_leaf_switch_interface_profiles: true
# auto_generate_access_spine_switch_interface_profiles: true
# new_interface_configuration: true
fabric_policies:
leaf_switch_profile_name: "leaf-\\g<id>"
leaf_interface_profile_name: "leaf-\\g<id>"
leaf_switch_selector_name: "leaf-\\g<id>"
spine_switch_profile_name: "spine-\\g<id>"
spine_interface_profile_name: "spine-\\g<id>"
spine_switch_selector_name: "spine-\\g<id>"
pod_profile_name: "pod-\\g<id>"
pod_profile_pod_selector_name: "pod-\\g<id>"
access_policies:
leaf_switch_profile_name: "leaf-\\g<id>"
leaf_interface_profile_name: "leaf-\\g<id>"
leaf_switch_selector_name: "leaf-\\g<id>"
leaf_interface_selector_name: "eth-\\g<mod>-\\g<port>"
leaf_interface_selector_sub_port_name: "eth-\\g<mod>-\\g<port>-\\g<sport>"
fex_profile_name: "leaf-\\g<id>-fex- \\g<fex>"
fex_interface_selector_name: "eth-\\g<mod>-\\g<port>"
spine_switch_profile_name: "spine-\\g<id>"
spine_interface_profile_name: "spine-\\g<id>"
spine_switch_selector_name: "spine-\\g<id>"
spine_interface_selector_name: "eth-\\g<mod>-\\g<port>"
vpc_group_name: "vpc-\\g<switch1_id>-\\g<switch2_id>"
I would like to auto generate things, but would also be nice to override some values, it seems like the selector being range or all.
Sorry realized now that i had pasted the wrong thing in my initial post, here is the correct one (also edited in the original post):
---
apic:
fabric_policies:
pod_profiles:
- name: default
selectors:
- name: default
type: all
pod_policies:
pods:
- id: 1
tep_pool: 10.4.96.0/19
policy: default
this will make it fail. is it not possible to have selector being type all when auto-generating the pod-policies?
If you want to configure range "all" under pod_profiles block manually, you need to disable auto-generation. For auto-generated pod profiles selector is always set to range, and will add each pod that you configure in pod policies. What's the use case that you need "all" to be added with auto generated profiles considering that each pod will get added there automatically?
@juchowan it fails when i try to define v-tep pool in the code, because: «Validation failed: there is POD selector of type ALL and one of type range»
So I guessee the best way was to define ALL, but if it’s possible to do it another way, I’m more than happy.
Can you share the code? The error you mention seems to be caused because you have one auto generated pod profile and another one either done manually from pod_profiles sections or manually in the fabric itself
--- apic: fabric_policies: pod_profiles: - name: default selectors: - name: default type: all pod_policies: pods: - id: 1 tep_pool: 10.4.96.0/19 policy: default
You need to remove the pod_profiles section. This is not needed when using auto generation.
You also need to use a different policy group name than default. If you are just using the default policy group, then the existing default pod profile will already be taking effect and you don't need to configure anything.
If that is your intention, also remove the policy line from the pod configuration. Then update your auto generation lines to look as follows:
# auto_generate_switch_pod_profiles: true
# auto_generate_pod_profiles: true
auto_generate_fabric_leaf_switch_interface_profiles: true
auto_generate_fabric_spine_switch_interface_profiles: true
auto_generate_access_leaf_switch_interface_profiles: true
auto_generate_access_spine_switch_interface_profiles: true
Does that answer your question?
While trying to apply pod policies it fails like this:
Here is my pod policy config:
If I try to add this to the fabric policies:
It fails like this:
I'm having this enabled:
Not quite sure about how the auto generation things work either so if someone could explain that aswell it would be awesome.