opagenswitches(8)

πŸ’… opagenswitches β€” okay bestie, let's talk switches

So this is opagenswitches, a section 8 (admin-y, system-level, main character) command from the IFSFFCLIRG man page crew. And what does it do? It looks at the fabric that's live right now and spits out a list of Externally Managed switches β€” formatted exactly how the /etc/opa/switches file wants it. Like, it's literally doing your homework for you. πŸŽ€


✨ NAME ✨

opagenswitches β€” analyzes the present fabric and produces a list of Externally Managed switches in the required format for the /etc/opa/switches file.


🌸 SYNTAX 🌸

opagenswitches [-t portsfile] [-p ports] [-R] [-L switches_file]
[-o output_file] [-T topology_file] [-X snapshot_file] [-s] [-v level]
[-K]

πŸ¦‹ OPTIONS πŸ¦‹

  • --help β€” gives you the full help text, the whole thing, no skimping. πŸ‘‘
  • -t portsfile β€” tells it which file holds the list of local HFI ports it should use to reach the fabric(s) for analysis. Default is the /etc/opa/ports file.
  • -p ports β€” the list of local HFI ports used to access the fabrics for counter clear. Default is the first active port. Heads up: the first HFI in the system is 1, and the first port on an HFI is 1. It uses the format hfi:port, like so:
    • 0:0 β€” First active port in system.
    • 0:y β€” Port y within system.
    • x:0 β€” First active port on HFI x.
    • x:y β€” HFI x, port y.
  • -R β€” does not attempt to get routes for computation of distance. Skipping that step, periodt.
  • -s β€” updates/resolves switch names using topology XML data. ✨
  • -L switches_file β€” names a pre-existing switches_file to use as input alongside a topology file. When you pass it, that file gets used instead of switches data grabbed from the actual fabric. The updated switches data goes out to stdout (which, fyi, is common to all opagenswitches operations). Note: this does not generate switches data. And you must also use the -s option with it.
  • -o output_file β€” writes switches data to output_file. Default is stdout.
  • -T topology_file β€” specifies the topology_file to use. It may contain '%P'. You must also use -s.

Link data in the topology file gets compared to actual fabric link data (which comes from opareport -o links or opareport -X snapshot -o links). That data also gets matched to a list of switch node GUIDs, and from that the switch NodeDesc values are generated. Then the list is applied to the switches data to update the NodeDesc values. The comparison of topology link data against actual fabric link data starts with the host names. The host names in the actual fabric have to match the ones in the topology file or the comparison won't succeed. That said, the comparison logic does allow for some mismatches β€” which could be from swapped or missing cables, no cap. Switch NodeDesc values get matched to GUIDs based on which switch has the greater number of matching links. 🧚

  • -X snapshot_file β€” uses snapshot_file XML for fabric link information. May contain '%P'. You must also use -s.
  • -v level β€” sets the verbose level. Default is 0. The values are:
    • 0 β€” No output.
    • 1 β€” Progress output.
    • 2 β€” Reserved.
    • 4 β€” Time stamps.
    • 8 β€” Reserved.
  • -K β€” does not clean temporary files. Those temp files are CSV format and hold lists of links used while the script was running. Normally you don't need them after execution, but keeping them means you can inspect or process them later. πŸ™ˆ

πŸ’œ ENVIRONMENT VARIABLES πŸ’œ

These environment variables are also used by this command:

  • PORTS β€” list of ports, used when -t and -p aren't given.
  • PORTS_FILE β€” file containing the list of ports, used when -t and -p aren't given.
  • FF_TOPOLOGY_FILE β€” file containing topology XML data, used when -T isn't given.

🌈 EXAMPLES 🌈

opagenswitches
opagenswitches -p '1:1 2:1'
opagenswitches -o switches
opagenswitches -s -o switches
opagenswitches -L switches -s -o switches
opagenswitches -s -T topology.%P.xml
opagenswitches -L switches -s -T topology.%P.xml -X snapshot.%P.xml

And that's the whole vibe check, bestie 🫢 This little legend lives in the IFSFFCLIRG (Man Page) collection, and the copyright belongs to Copyright(C) 2015-2019 Intel Corporation. Slay, go generate those switches. πŸ’–βœ¨