LNET_LEGACY2YAML(8)
π LNET_LEGACY2YAML β the LNET_LEGACY2YAML(8) glow-up π
okay bestie, so you know how your grandma's modprobe.conf is out here living in 2.10 energy and your lnetctl is out here demanding YAML? yeah. this little utility is the translator. it's giving β¨ linguist β¨. it's a member of the Lustre Configuration Utilities manual, section 8, and it is so ready to help you migrate.
πΈ NAME πΈ
lnet_legacy2yaml β turn legacy LNet module parameters into YAML, no cap
β¨ SYNOPSIS β¨
lnet_legacy2yaml [options] [inline-legacy-string]
lnet_legacy2yaml [-i ip2nets_file] [-r routes_file] [-n networks_file]
[-m modprobe_file] [-o output_file] [--default-hop
[HOP]] [inline-legacy-string]
π¦ DESCRIPTION π¦
So lnet_legacy2yaml parses those deprecated Lustre LNet module parameter syntaxes β we're talking ip2nets=, routes=, and networks= β and spits out an equivalent YAML document that lnetctl(8) can actually use, via:
lnetctl import < output.yaml
fr fr, here's the lore: kernel parsing of ip2nets was deprecated back in Lustre 2.10 (rip to a real one), and user space is the one resolving interface patterns now. so this tool exists to walk you from legacy module config files (like modprobe.conf / lustre.conf) into the YAML form that modern LNet configuration workflows eat for breakfast. migration era π
You can feed it input through literally any combo of: a positional inline argument, the file options, or standard input. If you don't hand it a positional inline argument and stdin is not a TTY, bestie, it just reads from stdin. And multiple sources accumulate β ip2nets files first, then route files, then inline/stdin content. order matters, queen π
π OPTIONS π
-i,--ip2netsFILE β a file holding one or more ip2nets rules, separated by semicolons (;) or newlines. you can pass this multiple times, go off β¨-r,--routesFILE β a file holding one or more routes entries, separated by semicolons (;) or newlines. also stackable multiple times π-n,--networksFILE β a file holding one or more networks entries, separated by commas (,) or newlines. yep, multiple times, we love a repeatable flag π-m,--modprobeFILE β a modprobe configuration file (e.g./etc/modprobe.d/lnet.conf) that it parses forlnetmodule parameters. the tool fishes out theip2nets=,routes=, andnetworks=values from lines matching:
options lnet ip2nets="..." routes="..." networks="..."
may be specified multiple times. line continuations (backslash-newline) are supported, so you can go feral with formatting π«Ά
-o,--outputFILE β write the YAML to FILE instead of stdout. shy girl behavior, love that for you--default-hop[HOP] β assign a default hopcount to routes that didn't bring their own explicit hop token. if HOP is omitted,1is used. range: 1-255. and listen β explicit hopcounts in the input are never overridden. we respect boundaries here π-h,--helpβ display usage summary. the classic.
π EXIT STATUS π
0β Success. ate and left no crumbs π1β Usage error or no data provided. awkward.2β Parsing error or file I/O error (message on stderr). it's not you, it's the input π
π NOTES π
π Legacy networks Syntax
It's a comma-separated list of network specifications:
nettype [id] [(iface-list)]
Examples:
tcp
tcp0(eth0)
tcp0(eth0),o2ib(ib0)
π§ Legacy ip2nets Syntax
Every rule looks like: net-spec ip-pattern { ip-pattern }
Net spec: nettype id, optionally followed by an interface list in parentheses, e.g.:
tcp0(eth0,eth1) 192.168.0.*
IP patterns support wildcards (*) and bracket expressions for sets/ranges, e.g.:
132.6.[1-3].[2-8/2]
Rules are separated by semicolons or newlines. The first matching rule for a given network wins. first come first served, periodt π
π Legacy routes Syntax
Two route formats are supported, and yes you can have both.
Legacy format:
netspec [hopcount] gateway { gateway ... }
Gateway NIDs may end with an optional priority suffix: gateway:PRIORITY (e.g. 10.0.0.1@o2ib0:5). The first numeric token (1-255) after the network spec is treated as hopcount. If it's omitted and --default-hop is not used, hop is left unspecified in the YAML. mysterious. elusive. π
Alternative format (lustre_routes_config syntax):
network : { gateway: gateway@exitnet [ , hop: hopcount] [ ,
priority: priority ] }
This one explicitly names its parameters and lets them show up in any order, icon behavior. Parameters are separated by commas. gateway is mandatory; hop and priority are optional.
Examples:
tcp1: { gateway: 10.1.1.2@tcp0, priority: 3 }
tcp4: { gateway: 10.3.3.4@tcp }
tcp6: { gateway: 10.3.3.6@tcp, hop: 2, priority: 5 }
tcp7: { gateway: 10.3.3.[6-12]@tcp, priority: 20, hop: 8 }
Both formats may be mixed freely in the same input file or stream β the tool automatically detects which format each line is using. it just knows π
β¨ YAML Output Format β¨
The tool emits up to three top-level sequences:
net:
ip2nets:
route:
Example:
net:
- net type: tcp0
local NI(s):
- interfaces:
0: eth0
ip2nets:
- net-spec: tcp0
interfaces:
0: eth0
ip-range:
0: 192.168.0.[2,4]
- net-spec: o2ib0
ip-range:
0: 192.168.0.*
route:
- net: tcp0
gateway: 10.0.0.[1-2]@o2ib0
hop: 2
priority: 5
- net: tcp0
gateway: 10.0.0.[3-4]@o2ib0
hop: 2
priority: 10
Any IP pattern beginning with an asterisk (e.g. *.*.*.*) is automatically wrapped in double quotes to dodge YAML alias semantics. safety first, babe π«Ά
π Behavior Notes
- Rule / entry separators: semicolon (
;) or newline. - Comments initiated by
#are stripped (not valid inside bracket expressions). - IP patterns are preserved verbatim (no expansion of bracket/range expressions).
- Interfaces are listed in the order provided.
- Multiple ip2nets/routes/networks files are concatenated in given order.
- Gateway priority parsed only when final colon + digits suffix present (naive IPv6 avoidance). This limitation does not apply to the alternative route format where priority is explicitly named.
- Both legacy and alternative route formats may be freely mixed in the same file. Each line is automatically detected and parsed according to its format.
- Modprobe files are processed first, followed by explicit ip2nets files, routes files, networks files, then inline/stdin content.
- Line continuations in modprobe files (backslash-newline) are handled automatically.
β οΈ CAVEATS β οΈ
bestie. listen. read these. they matter.
- Does not expand bracket/range expressions to concrete addresses.
- Simple validation only; malformed nested bracket constructs may not produce intuitive errors. so like, it might be a little cryptic. sorry π
- Priority parsing does not support IPv6 literal addresses with trailing numeric segments separated by colons.
π₯ EXAMPLES π₯
Convert a networks parameter:
$ lnet_legacy2yaml 'options lnet networks="tcp0(eth0),o2ib(ib0)"'
net:
- net type: tcp0
local NI(s):
- interfaces:
0: eth0
- net type: o2ib
local NI(s):
- interfaces:
0: ib0
Convert a simple ip2nets string:
$ lnet_legacy2yaml \
'tcp0(eth0,eth1) 10.0.0.*; o2ib0 192.168.[1-2].*'
Extract both parameters from an options line:
$ lnet_legacy2yaml \
'options lnet ip2nets="tcp0 10.0.0.*" \
routes="tcp0 1 10.0.0.1@o2ib0"'
Parse a modprobe configuration file:
$ lnet_legacy2yaml -m /etc/modprobe.d/lnet.conf \
-o lnet.yaml
Convert routes using the alternative format:
$ cat routes.conf
tcp1: { gateway: 10.1.1.2@tcp0, priority: 3 }
tcp4: { gateway: 10.3.3.4@tcp }
tcp6: { gateway: 10.3.3.6@tcp, hop: 2, priority: 5 }
tcp7: { gateway: 10.3.3.[6-12]@tcp, priority: 20, hop: 8 }
$ lnet_legacy2yaml -r routes.conf
route:
- net: tcp1
gateway: 10.1.1.2@tcp0
priority: 3
- net: tcp4
gateway: 10.3.3.4@tcp
- net: tcp6
gateway: 10.3.3.6@tcp
hop: 2
priority: 5
- net: tcp7
gateway: 10.3.3.[6-12]@tcp
hop: 8
priority: 20
Files plus default hop:
$ lnet_legacy2yaml -i ip.rules -r routes.rules \
--default-hop 2 -o lnet.yaml
Import into LNet:
$ lnetctl import < lnet.yaml
π AUTHORS π
Generated with assistance from automated tooling; further maintained by Lustre contributors. (yes automated tooling helped write the docs, and now a very online teenager is rewriting them. the pipeline is thriving π)
π AVAILABILITY π
lnet_legacy2yaml is part of the lustre(7) filesystem package since release 2.17.0. iconic since day one π
π«Ά SEE ALSO π«Ά
and that's the whole vibe check, bestie β this page came straight out of the Lustre manual, dated 2025-10-20. go forth, convert your legacy configs, and lnetctl import < output.yaml your way into the future. mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π the page's license: GPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms