Bringing up OpenSM
S2·E1Both ports are Active and nobody started a subnet manager · Dell lab, Round Rock, day one of a nine-day build
Builds on: Reading a host's IB state in 60 seconds
Before you read: what do you already know?
3 quick questions. Wrong answers are fine and expected; trying first makes the lesson stick.
After this lesson you can
- Start opensm bound to one port with the flags a customer bring-up actually needs and confirm SUBNET UP in both log files.
- Predict what OpenSM does with an out-of-range or missing option value using the documented defaults and the verify-config behaviour.
- Locate the cache and dump files OpenSM writes and say what each one proves about a restart.
- Prove how many subnet managers are running and which one is master before changing any parameter.
Episode 1 — Both ports are Active and nobody started a subnet manager
Day one of nine. The two-node staging rig in the Dell lab will become a 384-node fabric for an imaging co-op - four hospital research groups buying one cluster between them - and the Dell SE has already written “fabric up” in row 4 of the spreadsheet where he keeps every promise, next to a coffee that went cold an hour ago. ibstat shows both ports Active. The co-op’s network lead opens a grid-ruled notebook to a clean page and asks who started the subnet manager. Nobody in the lab did.
That is the reason a subnet manager exists at all. InfiniBand pushes addressing and forwarding out of the switch: a port has no LID until something assigns one, and a switch has no forwarding table until something computes and writes it, so a perfectly good cable leaves a port in Initializing until an SM sweeps.[6] OpenSM is that something - “an InfiniBand compliant Subnet Manager and Administration”, required at least once per subnet “in order to initialize the InfiniBand hardware”.[1]
So you go looking. sminfo answers, and the master is a host nobody has logged into all week: a package install started opensm at the default priority of 0, the lowest there is.[1][6] The night-shift operator prints a label reading DO NOT POWER OFF and waits to hear which box earns it.
Active ports are not evidence of health - they are evidence that some subnet manager, somewhere, already did the work.
Segment 1 starts where you do: one SM, bound to one port, on purpose.
1What OpenSM is responsible for, and where it says so
OpenSM is “an InfiniBand compliant Subnet Manager and Administration, and runs on top of OpenIB”, and at least one instance is required per InfiniBand subnet “in order to initialize the InfiniBand hardware”.[1] Nothing on an IB fabric addresses itself: until an SM sweeps, assigns LIDs and programs forwarding tables, a perfectly good cable gives you a port stuck in Initializing.[6]
Scope is narrower than people expect. OpenSM “attaches to a specific IB port on the local machine and configures only the fabric connected to it. (If the local machine has other IB ports, opensm will ignore the fabrics connected to those other ports).”[1] A dual-port ConnectX in a dual-rail cluster therefore needs two instances, and the man page’s own example of separating them in syslog uses --log_prefix with the names “mpi” and “storage”.[1]
Success has one marker. Logging goes by default to two files — /var/log/messages for general major events and /var/log/opensm.log for details of reported errors — and “Both log files should include the message SUBNET UP if opensm was able to setup the subnet correctly.”[1][4] The man page adds a line worth quoting to a customer: “All errors reported in this second file should be treated as indicators of IB fabric health issues.”[1] When a fatal, non-recoverable error occurs opensm exits, unless you passed -y/--stay_on_fatal.[1]
One more scoping fact for sizing conversations: “opensm defaults were designed to meet the common case usage on clusters with up to a few hundred nodes.”[1] That is not a hard limit, but it is the reason a 2,000-node customer ends up tuning timeouts and caches rather than running stock.
2The flags you will actually type
Bind explicitly. -g/--guid selects the local port GUID, and “OpenSM may be bound to 1 port at a time. If GUID given is 0, OpenSM displays a list of possible port GUIDs and waits for user input.”[1] On a two-port card, opensm -g 0 is the safe way to discover the choices interactively before you script it.
The defaults you must know cold, because every customer question is really “is this default or did someone change it”:[1]
| Flag | Default when omitted | What it controls |
|---|---|---|
-p, --priority |
0 (lowest); range 0–15 | Which SM wins handover, priority first then GUID |
-s, --sweep |
10 seconds; -s 0 disables |
Light sweep interval |
-t, --timeout |
200 milliseconds | Transaction timeout |
--retries |
3 | Transaction retries |
-l, --lmc |
0; valid range 0–7 | LIDs per port is 2^LMC |
-Z, --part_enforce |
both |
Switch-side partition enforcement |
-Q, --qos |
disabled | QoS setup |
Read that priority row twice. Zero is the lowest priority and it is the default, so an SM started with no -p loses every election to any SM that has one.[1] And these are upstream numbers: UFM ships sm_priority = 15 marked read-only and qos = TRUE, so “the default” depends entirely on who runs the SM.[2][1]
For a real bring-up you add daemon plumbing and a capture. -B/--daemon runs in the background and -J/--pidfile writes the PID, which is what gives you a clean stop.[1] -c/--create-config “will dump its configuration to the specified file and exit. This is a way to generate OpenSM configuration file template.”[1] -F/--config then selects a config file; MLNX_OFED documents the packaged path as /etc/opensm/opensm.conf and the options cache as /var/cache/opensm/opensm.opts.[4] On a large cluster add -A/--ucast_cache, which “prevents routing recalculation (which is a heavy task in a large cluster) when there was no topology change detected during the heavy sweep… A very common case that is handled by the unicast routing cache is host reboot.”[1]
There is a trap in the config file that produces silent, wrong behaviour. OpenSM’s own osm_subn_verify_config() clamps out-of-range values back to the built-in default and logs them, with source lines of the form if (p_opts->lmc > 7) and if (15 < p_opts->sm_priority) each calling log_report(" Invalid Cached Option Value:…: Using Default:%u\n", …).[3] So sm_priority 20 does not become 15 and does not fail to parse — it becomes 0, the lowest priority in the fabric, while the customer believes they pinned the master.
One host, 60 seconds: you need LID, SMLID, port state, link width active and physical state straight from the local IB driver — from a binary, not a shell script.
A customer sentence. Pick the one tool that answers it.
Answer, then the panel gives the man-page wording, a working invocation, and where the evidence lands. Nothing here is trivia: every prompt is a sentence a customer has actually said.
ib_write_latib_write_bwibpingibstatibdiagnetibnodesiblinkinfo3Reading state after the bring-up
Once SUBNET UP appears, four kinds of evidence exist and they answer different questions.
The cache lives in OSM_CACHE_DIR, default /var/cache/opensm: guid2lid holds the LID range assigned per GUID, guid2mkey the per-port M_Keys, and neighbors “a map of the GUIDs at either end of each link in the fabric”.[1] That is what makes a restart non-disruptive — without -r/--reassign_lids, “OpenSM attempts to preserve existing LID assignments”, and the man page warns that “Specifying -r on a running subnet may disrupt subnet traffic.”[1]
The dumps land in OSM_TMP_DIR, default /var/log: opensm-subnet.lst, opensm.fdbs (unicast forwarding tables) and opensm.mcfdbs (multicast).[1] --dump_files_dir, or dump_file_dir in the config file, takes precedence over the environment variable.[1]
The signals are your two live controls: SIGHUP “starts a new heavy sweep as if a trap was received or a topology change was found”, and SIGUSR1 reopens /var/log/opensm.log for logrotate.[1] A kill -HUP is how you force a re-discovery after re-cabling without restarting the daemon and re-running the election.
The fabric view comes from the diagnostics, not from the SM’s own logs. sminfo “Issues and dumps the output of an sminfo query in human readable format”, and ibdiagnet writes ibdiagnet2.sm, described as “Subnet Managers” — the file that proves how many SMs the fabric can see.[6][5] Note that opensm and ibutils2 are separate packages: the DOCA-Host installation page lists opensm, ibutils2, hcoll and sharp as proprietary packages requiring separate installation, so doca-all alone gives you a driver with no subnet manager and no ibdiagnet.[7]
4Proving there is exactly one master
Mastership is decided by priority first and GUID second: “Once an SM discovers another SM in the network, the one with the highest priority setting takes precedence. If two SMs have the same priority, the SM with the lower GUID takes over.”[10] That is two facts, and the second is the one people forget — a tie is broken by the lower GUID, which is not something you get to choose, so if you care which host is master you must set priority explicitly on both.
The election matters even in a lab, because a managed switch may already be running its own SM, and a customer’s monitoring host may have had opensm enabled by a package post-install months ago. Use the simulator below to run the cases before you meet them: two hosts at equal priority, one host against an enabled switch SM, and a master that disappears mid-run.
1. Discovery
All 2 enabled SMs start in discovery mode. Each sweeps the subnet with directed-route SMPs and finds the others through SM→SM SMINFO GET/SET — that exchange is the election traffic.
- switch
- host
- host
Case: a two-node Dell lab, ConnectX ports already in IB mode, cabled through one switch. No SM is running anywhere and both ports show Initializing.
- Confirm the physical layer before blaming the SM. On both hosts:
Expected:ibstatPhysical state: LinkUp,State: Initializing,Link layer: InfiniBand.LinkUpplusInitializingmeans the link trained and no SM has programmed the port — an SM problem, not a cable problem.[9][6] - Confirm nothing is already managing the subnet:
Expected: a failure or no master. If this returns a master, stop — you are about to create a second SM and the rest of this runbook is the wrong procedure.[6]sminfo - Read the port GUID you intend to bind, letting opensm enumerate rather than transcribing hex by hand:
Expected: a list of possible port GUIDs and a prompt for input;opensm -g 0Ctrl-Cout once you have the GUID.[1] - Capture the configuration you are about to run, before you run it:
Expected:opensm -c /tmp/opensm.conf grep -E '^(sweep_interval|transaction_timeout|transaction_retries|sm_priority|lmc|part_enforce|qos) ' /tmp/opensm.confsweep_interval 10,transaction_timeout 200,transaction_retries 3,sm_priority 0,lmc 0,part_enforce both,qos FALSE.[1] This file is also the artifact you ask a customer for instead of a screenshot. - Start it bound to one port, in daemon mode, with a pidfile:
sudo opensm -g 0x248a070300a28c4d -p 13 -B -J /var/run/opensm.pid-p 13is deliberate: leaving the default 0 means any other SM that appears later takes over silently.[1] - Prove it worked, in this order:
Expected: exactly onegrep -c "SUBNET UP" /var/log/opensm.log ibstat | grep -E "State:|Base lid" sminfoSUBNET UP; ports nowActivewith a non-zero base LID; one master reported bysminfo.[1][6] - Exercise the live control once, so you have seen it before you need it:
Expected: a new heavy sweep in the log and still exactly one master.[1]sudo kill -HUP $(cat /var/run/opensm.pid) tail -20 /var/log/opensm.log - Rollback for the whole exercise:
sudo kill $(cat /var/run/opensm.pid). Ports return toInitializing, which is the proof that the SM was doing the work.[1]
ibstaton both hosts.LinkUpplus____means the link is fine and no ____ has programmed the port.____to prove no SM is already master before you add one.opensm -g ____to have OpenSM list the candidate port GUIDs.opensm -____ /tmp/opensm.confto dump the effective configuration and exit; expectsweep_interval ____,transaction_timeout ____,transaction_retries ____,sm_priority ____.sudo opensm -g <guid> -p 13 -____ -J /var/run/opensm.pidto run it in the background with a pidfile. Priority 13 rather than the default because the default is ____ , the ____ priority there is.- Verify: one
____ ____in /var/log/opensm.log, portsActivewith a base LID, and one master from____. kill -____ $(cat /var/run/opensm.pid)forces a heavy sweep;kill -____is the logrotate signal instead.- Rollback:
kill $(cat ____).
A customer’s 40-node cluster has been stable for six months. After a maintenance window in which two compute nodes were reimaged, ibdiagnet reports two subnet managers and the fabric re-routes several times an hour. The customer’s runbook says opensm was configured with sm_priority 20 on the intended master, and the reimaged nodes got the distro’s default opensm service enabled by a package install.
Write the diagnosis and the fix. Acceptance criteria: (a) state what value the intended master is actually running at and cite the mechanism that produced it; (b) name the two commands that prove how many SMs exist and from where you would run each; (c) give the ordered remediation with the specific flag or config change on each of the three hosts; (d) name the one log signature you would use to confirm the fabric stopped re-initializing; (e) state which part of this you cannot verify from the customer’s screenshots alone and what file you would ask for instead.
One SM, on purpose
You bind deliberately: -g on a port GUID you read rather than transcribed, -p 13 so no stray default-priority SM inherits the fabric later, -B and -J for a clean stop, and opensm -c archived before anything changes.[1] Then the three-command proof: one SUBNET UP in /var/log/opensm.log, ports Active with a non-zero base LID, one master from sminfo.[1][6]
What you say to the network lead: “Your ports were Active because a package install started a subnet manager at priority zero. We run one now, on purpose, and we can prove which one in three commands.”
She writes it down, then turns the notebook around. The design review is in two days, and the SM on the architecture slide is not this host. It is inside a switch.
Lab
Goal: bring up a real subnet manager on the Dell lab and prove it. Step 3 starts a daemon that changes the state of every port in the subnet; its rollback is named.
- Pre-flight inventory, read-only. On every host with an IB-mode port:
Expected: port stateibstat | tee /tmp/ibstat-before-$(hostname).txt ibstat -p sminfo || echo "no SM answered" systemctl is-active opensm || true rpm -q opensm ibutils2 2>/dev/null || dpkg -l | grep -E 'opensm|ibutils2'InitializingwithPhysical state: LinkUpon a fabric with no SM; a port GUID list fromibstat -p;sminfofailing; theopensmservice inactive. Ifsminfoanswers, an SM is already running — do not start a second one; go to the next lesson and decide placement first.[6][1] - Capture the configuration before changing anything:
opensm -c /tmp/opensm-lab.confand archive it next to theibstatcapture.[1] - Mutating — start the SM bound to one port. Rollback:
sudo kill $(cat /var/run/opensm.pid), after which ports return toInitializing.
Expected: the process daemonizes and the pidfile exists.[1]sudo opensm -g <port_guid_from_step_1> -p 13 -B -J /var/run/opensm.pid - Verify in the documented order, read-only:
Expected: exactly onegrep -n "SUBNET UP" /var/log/opensm.log ibstat | grep -E "State:|Base lid|SM lid" sminfoSUBNET UP; every portActivewith a non-zero base LID;sminfonaming one master with the priority you set.[1][6] IfSUBNET UPrepeats every few minutes, stop and look for a flapping link or a second SM before tuning anything.[11] - Exercise the signals, read-only in effect:
Expected: a heavy sweep after HUP; the log file reopened after USR1 with no other change.[1]sudo kill -HUP $(cat /var/run/opensm.pid); tail -30 /var/log/opensm.log sudo kill -USR1 $(cat /var/run/opensm.pid) - Inspect the artifacts the SM just wrote, read-only:
ls -l /var/cache/opensm/andls -l /var/log/opensm-subnet.lst /var/log/opensm.fdbs /var/log/opensm.mcfdbs. Expected:guid2lid,guid2mkeyandneighborsin the cache directory and the three dumps in/var/log.[1] Openguid2lidand match one line to a GUID from step 1. - Restart-stability check, mutating but self-reverting. Stop the SM, restart it with the same command, and diff the LIDs:
Expected: identical LIDs, because withoutsudo kill $(cat /var/run/opensm.pid); sleep 5 sudo opensm -g <port_guid> -p 13 -B -J /var/run/opensm.pid; sleep 20 ibstat | grep "Base lid" | tee /tmp/lids-after.txt-rOpenSM preserves existing assignments usingguid2lid.[1] Do not add-ron anything but an idle lab: the man page warns it may disrupt subnet traffic.[1] - Rollback and confirm:
sudo kill $(cat /var/run/opensm.pid), thenibstatand diff against/tmp/ibstat-before-$(hostname).txtuntil only the expected fields differ. Optional, customer lab only: start a secondopensmon another host with--log_prefixand a different-p, then re-readsminfofrom a third node — that is lesson 2’s territory and should be done deliberately, not by accident.[1]
Goal: exercise the whole OpenSM configuration surface with no fabric at all. Everything here is read-only on your own machine; nothing touches hardware.
- Install the subnet manager in a container.
opensmis a separate upstream repository fromrdma-core, which is exactly why a host can haveinfiniband-diagsand no SM:
Expected: both packages install;docker run --rm -it ubuntu:24.04 bash apt-get update && apt-get install -y opensm infiniband-diagsopensm --versionprints a version. If not, the distro name differs — checkapt-cache search opensm. - Dump the effective configuration template and read it as a document:
Expected:opensm -c /tmp/opensm.conf wc -l /tmp/opensm.conf grep -E '^(sweep_interval|transaction_timeout|transaction_retries|sm_priority|lmc|part_enforce|qos|max_op_vls) ' /tmp/opensm.confsweep_interval 10,transaction_timeout 200,transaction_retries 3,sm_priority 0,lmc 0,part_enforce both,qos FALSE.[1] Write down every value that differs from the man page and explain the difference from the man page text before looking anything up. - Diff your template against the vendor reality. Open the UFM Subnet Manager default properties table and record the five values that disagree with what you just dumped:
sm_priority15 read-only,qosTRUE,max_op_vls2,scatter_ports8,routing_enginear_updn.[2] Expected outcome: a five-row table you could paste into a customer email under the heading “read your running config, not the man page”. - Break it deliberately and predict the result before you run it. Edit
/tmp/opensm.confto containlmc 9andsm_priority 20, write down your prediction, then:
Expected: the re-dumped file carries the built-in defaults, not 9 and 20, matchingopensm -F /tmp/opensm.conf -c /tmp/opensm-verified.conf diff /tmp/opensm.conf /tmp/opensm-verified.confosm_subn_verify_config().[3] If the run instead errors out, record that too — your build may differ, and the point of the drill is the comparison. - Rehearse the log reading with no fabric:
man opensmand locate, without searching the web, the SIGHUP paragraph, the two log-file names, theSUBNET UPsentence, and the cache-file list.[1] Expected: under two minutes for all four. This is the recall the exam and the bridge call both want. - Course caveat to record: whether NVIDIA Air’s free tier can simulate any InfiniBand or Quantum switch was not confirmed when this lesson was written — the Air supported-platforms page did not resolve. Treat every no-hardware step here as container-and-documentation work, and re-check Air before promising a customer a simulated IB lab.
Retrieval check
10 questions from memory. Answer before looking anything up; misses become flashcards.
Explain it to a Dell SE
A Dell platform engineer has just cabled an eight-node IB test rack and asks you what to run so the fabric comes up. Explain in five sentences what a subnet manager is for, what you will type, and how you will both know it worked.
Sources
Facts in this lesson were checked against opensm(8) man page (linux-rdma master) re-fetched 2026-09-07 (priority 0 default, sweep 10 s, timeout 200 ms, 3 retries, cache and dump file names, SIGHUP/SIGUSR1); UFM Subnet Manager Default Properties 6.24.1 re-fetched 2026-09-07 (sm_priority 15 RO, sweep_interval 10, qos TRUE, max_op_vls 2). Dates are when each page was fetched.
- opensm(8) man page source (linux-rdma/opensm master) · fetched 2026-09-07
- UFM Enterprise 6.24.1: UFM Subnet Manager Default Properties · fetched 2026-09-07
- opensm/osm_subnet.c - option defaults and osm_subn_verify_config() · fetched 2026-09-07
- OpenSM - MLNX_OFED Software User Manual 5.6-2.0.9.0 · fetched 2026-09-07
- ibdiagnet Dump Files - IBUtils2 Utility Documentation · fetched 2026-09-07
- InfiniBand Fabric Utilities - MLNX_OFED 23.07-0.5.1.2 · fetched 2026-09-07
- DOCA-Host Installation and Upgrade - DOCA 3.5.0 · fetched 2026-09-07
- QM97XX User Manual: Software Management · fetched 2026-09-07
- Networking Troubleshooting - NCCL user guide · fetched 2026-09-07
- Security in InfiniBand - NVIDIA InfiniBand Security Overview and Guidelines · fetched 2026-09-07
- Subnet Manager - NVIDIA MLNX-OS User Manual v3.12.6200 LTS · fetched 2026-09-07
The same idea elsewhere
Other lessons that cover this ground, sometimes from another course's angle.
- Reading a host's IB state in 60 secondsElsewhere in this course · Same ground: logs, opensm and triage
- Escalation bridge call: five InfiniBand ticketsElsewhere in this course · Same ground: Heavy sweep, triage and SUBNET UP
- Discovering a fabric: ibnetdiscover and iblinkinfoElsewhere in this course · Same ground: cache, files and flags