Page MenuHomePhabricator

automatically sample from all FPCs on core routers
Open, LowPublic

Description

Right now we manually configure fpcs_to_sample in devices.yaml. Ideally we wouldn't have to configure this at all; either Homer would know to enable it on all valid FPCs, or we'd be able to express this via the wildcarding functionality* in Juniper configs

*: Although when I looked, I didn't think this would work, but I don't recall details right now.

Related Objects

StatusSubtypeAssignedTask
OpenNone

Event Timeline

CDanis removed CDanis as the assignee of this task.Jul 8 2020, 12:47 AM
CDanis triaged this task as Low priority.
CDanis created this task.
CDanis added a parent task: Restricted Task.
ayounsi added a comment.EditedAug 4 2020, 11:51 AM

or we'd be able to express this via the wildcarding functionality* in Juniper configs

Seems like the cleanest way.

Here is what it would looks like on cr1-eqiad (not committed):

[edit groups]
+  /* Configure a sampling instance to all the FPCs */
+  sampling {
+      chassis {
+          fpc <*> {
+              sampling-instance pmacct;
+          }
+      }
+  }
[edit chassis]
+  apply-groups sampling;
[edit chassis fpc 3]
-    sampling-instance pmacct;
[edit chassis fpc 4]
-    sampling-instance pmacct;

confirmed with:

# show chassis fpc 3 | display inheritance    
pic 3 {
    tunnel-services {
        bandwidth 10g;
    }
}
##
## 'pmacct' was inherited from group 'sampling'
##
sampling-instance pmacct;
inline-services {
    /* T248394 */
    flex-flow-sizing;
}

We can probably put flex-flow-sizing as well in the group. And to be pushed manually first to make sure it doesn't break anything.

Next step is to template it in Homer.

Change 622318 had a related patch set uploaded (by Ayounsi; owner: Ayounsi):
[operations/homer/public@master] Apply netflow group to existing fpc X statements

https://gerrit.wikimedia.org/r/622318

While working on that I noticed that the apply group only applies to existing fpc X statements, for example if they are configured with pic sub-section (either for tunnel-services or ports config, etc).
We're currently "lucky" enough that all the FPCs we need sampling on are in that case. But it doesn't help in the scope of that task (as we wanted it to be fully automatic).
An option is to make it a policy to always configure fpc X power on on the FPCs we actively use, which means replacing fpc_to_sample, with fpc_in_use and thus going back to square 1 (but does look "cleaner").

On the Homer front, it requires Homer code to expose the inventory to Jinja. Not difficult, but not sure if it's worth the hassle compared to the current solution.