-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Vary interface ordering depending on platform #284
Comments
When I create INT[1-3] and EXT[1-3] on a device, they are ordered as:
This is due to how interfaces are ordered by their manager, sorting on the trailing numeric ID before the alphabetic type. |
For the simple case of just one integer field might it be worth sorting on sub-section A then B? Modular order usually does not apply when there isnt a module number (because its just a single integer field) |
I'm having some issues as well: Cisco switch
Another Cisco switch
An HP Switch
Another HP Switch
Juniper Router
I would say for consistency sort alphabetically then numerically on the leading interface digit otherwise you end up with what I've got above |
can interfaces not be sorted wholly as a string? if they were, then all characters should sort as expected. that includes trailing numbers. this is a snippet of my virtual interfaces. they're not sorted this way in the menus (by last 4 digits), but, sorted alphabetically in a spreadsheet or other app, they end up as desired: V01-0199 edit: even better, sort by name in the select statement, let the DB do the sorting work. that should return everything sorted alphabetically based on what i've seen in the DB. |
This leads to chaos on some platforms. For instance, a Juniper switch might show
Hence the need to order on slot/number rather than by type. It doesn't seem like there exists a one-size-fits-all solution, unfortunately. Maybe we need to implement a few different ordering options (e.g. Cisco style, Juniper style, etc.) and make it an option on the device type. |
I'm actually OK with that Juniper example, all the ge interfaces come first followed by the xe interfaces Ideally I don't want ge and xe mixing as the actual conf has them sorted out as you indicate above Sorting of interfaces should be just as you'd see them on a switch config. |
I agree. Junos always sorts interfaces by slot and position, both in the configuration and in the output of Cisco IOS, conversely, lists interfaces first by media type and then by slot/position. I can't think of any practical way to consolidate both strategies in a single function. |
Maybe then as you stated we have different ones that can be tied to the devices' platform: -Cisco IOS ...and so forth. We'd have to ship with a few default platforms to match up with the associated sorting strategies. This could also can-of-worms where in people will want to define their own sorting strategies (is that accomplishable?) Just thinking the angles |
Per #373, it would be nice to add some capability to dynamically group interfaces by slot. |
I've added an |
After the 1.8.2 release I now get the otoin to toggle the Interface list using the tow options above, but this only works on the Device Type Page. The Actual device page doesn't take any notice of this and does not have an optoin to toggle the sort options. |
@jennec The device view inherits interface ordering from its parent device type. This can be observed by creating, for example, interfaces named |
@jeremystretch That doesn't match up wtih my expirience. I have a switch setup with 54 ports. Each labeled similarly to "04 - 10GBE (SFP+)". The Switch Device Type is set for Alphabetical sorting. When viewing the interfaces from the Device Type page the interfaces are sorted in reverse order (which is OK). But when viewed from the Device page they are in, what seems like, a random order. Perhaps it's related to the way I've named the interfaces, but that doesn;t make sense when it works on the Device Type Page but not the Device page. Is the sort order inherited, when changed, for existing Devices using that Device Type or will it only affect new Devices created using that Device Type? (see attached screen shots) |
You've appended the interface type to the name, which is evading the natural ordering logic. The interfaces should be named as they appear on the device; the interface form factor is maintained in a separate field. If you name the interfaces using only their numeric IDs (as they appear on the device), they will be sorted correctly. |
I can appreciate the logic in that. But its competing against the sorting working correctly in the Device Type page but not on the Device itself. Are there differences between the two pages? |
Since the ordering logic can't work with the names you've given the interfaces, the objects effectively aren't being ordered. This can result in non-deterministic behavior. |
#248 helped with device bays, but there are other instances:
Racks (e.g. B1.0.[1-12])
Interfaces (e.g. INT[1-14], EXT[1-11], which leads to something like this:
EXT1
INT1
INT2
EXT2
EXT3
INT3
...)
The text was updated successfully, but these errors were encountered: