-
Notifications
You must be signed in to change notification settings - Fork 71
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
node.clone plugin - simplify repetitive topologies by cloning nodes #1616
Conversation
Ready for review |
45e78fe
to
bb9ec1f
Compare
Apologies for the additional notifications |
Could this be applied to link groups for simplifying etherchannels and redundancy? I.e. -group: etherchannel |
Just a suggestion on the name change (as "repeater" can mean anything -- see https://en.wikipedia.org/wiki/Repeater_(disambiguation) ):
If I read the code right, the original node is retained, which I would find confusing -- I would get "h, h-01, h-02, ... h-31" for a total of 32 nodes. I think the first node should be "h-01" (or "h-00" -- this is where "clone.start" would come handy) and the count (however it is called) should specify the total number of nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few suggestions (if nothing else, I would strongly recommend using "_" in node names). Also, the plugins needs documentation.
It could, but the
is simpler (and less characters) than:
|
Ready for review
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly suggestions, the only truly annoying part is the "vlans" link name in VRF links.
* Copy any interface attributes from the original node too
* Add clone.count, clone.start and clone.step parameters * Replace cloned node by first clone (implies LAG links now generate an error, cannot leave them in place) * Keep link names * Simplify link cloning logic * Update documentation TODO: Generate errors when unsupported constructs are used in topology
Note: link groups could in theory be supported transparently if the transformation got applied before the plugin gets invoked. Similarly, it would be easier if link interfaces were normalized before plugins get invoked
* Use '-' in node name template
* implement separate 'process_links' * don't treat clone 1 different * use proper name prefix for cloned links * rename 'clone_interfaces'
6c3bdad
to
01e30dd
Compare
* Check for overlapping clone name
Hit an issue with |
Note to @jbemmel: it makes no sense to have two transformation tests testing the same (LAG) functionality. Try to keep tests focused, throwing extra features in just for the fun of it makes it harder to figure out what went wrong. Also: the changed results have an empty 'lag' dictionary (see diff for more details)
A plugin to clone nodes and any links/interfaces they are attached to, to simplify provisioning of large clusters of identical devices (like servers in a rack)
Context: #1570
Now includes support for lag links