2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 12:37:54 +00:00
Commit Graph

27634 Commits

Author SHA1 Message Date
Daniel Hilst fff73aae5f fix(xcat-core): configure Ubuntu networking with netplan in configeth
Write /etc/netplan/90-xcat-<nic>.yaml and `netplan apply` on Debian/Ubuntu nodes whose
network is rendered by netplan, instead of /etc/network/interfaces.d/* which ifupdown
is no longer present to read. The legacy branch is kept for nodes that still run
ifupdown, selected on whether netplan is actually installed. Fixes #7454.

The drop-in is regenerated in full on every change rather than edited in place. Its
inputs are recorded in "# xcat-state:" comment lines in the same file, which netplan
ignores, so the file stays the single source of truth and re-rendering is idempotent.
That is what makes the three properties below hold; an in-place sed editor cannot.

A NIC named <parent>.<vid> is emitted under vlans: with id and link, so netplan
recreates the VLAN after a reboot -- the ifupdown branch has always written
vlan-raw-device for these, and declaring them as plain ethernets would lose that. A
dotted name whose suffix is not numeric stays an ethernet.

Addresses keep the order they were added, and a route is deduplicated on the whole
(to, via) pair so a second route sharing a gateway is still written.

nicextraparams are carried across into the interface stanza, matching what the
ifupdown branch does with them.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-29 10:48:04 -03:00
Daniel Hilst f0944d3c7f test(xcat-core): capture configeth configuring nothing on netplan nodes
Ubuntu 18.04 and later render the network with netplan. ifupdown is not installed and
/etc/network/interfaces.d/* is ignored entirely, so configeth's Debian branch -- which
writes exactly there -- configures nothing at all on a modern Ubuntu node. It must
write /etc/netplan/*.yaml and apply it instead. Issue #7454.

Three properties a netplan writer has to hold, all of which an in-place YAML editor
gets wrong. A VLAN interface (<parent>.<vid>) belongs under vlans: with id and link,
or netplan never recreates it after a reboot. Multiple addresses on one NIC must keep
the order they were added. And routes must be idempotent on the whole (to, via) pair,
not on either field alone, or a second route sharing a gateway is swallowed.

nicextraparams must survive as well: the ifupdown branch writes them into the
interface stanza, so a netplan branch that drops them silently discards configuration
the user asked for.

Drive the real writers -- extracted from configeth and run against a temp NETPLAN_DIR
-- and hand the result to `netplan generate` where netplan is installed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-29 10:48:04 -03:00
Daniel Hilst 50257ff136 Merge pull request #7748 from VersatusHPC/fix/mellanox-mlx5-netdriver
fix(genimage): resolve Mellanox drivers from the target kernel
2026-08-28 18:11:29 -03:00
Daniel Hilst 4625505b8e Merge pull request #7771 from VersatusHPC/refactor/string-utils
refactor(utils): centralize policy string trimming
2026-08-28 17:42:03 -03:00
Daniel Hilst 3c209888df Merge pull request #7770 from VersatusHPC/refactor/test-file-writing
test: reuse File::Slurper for fixture files
2026-08-28 17:40:34 -03:00
Daniel Hilst 1ba53dc7f8 Merge pull request #7754 from VersatusHPC/fix/centos8-minor-version-detection
fix(anaconda): read the CentOS Linux minor version from the release package
2026-08-28 17:38:16 -03:00
Vinícius Ferrão 999f18eacd Merge pull request #7737 from VersatusHPC/fix/cmdlog-response-classifier
fix(xcatd): classify secret responses by the shared secret set
2026-08-28 17:34:56 -03:00
Daniel Hilst a9a2c1f74e Merge pull request #7732 from VersatusHPC/fix/noderange-preauth
fix(xcatd): refuse the noderange ^file operator on unauthenticated requests
2026-08-28 17:32:33 -03:00
Daniel Hilst ff06b9f9ae Merge pull request #7731 from VersatusHPC/fix/xcatver-mismatch
fix(xcatd): only call a same-release build difference a build difference
2026-08-28 17:28:30 -03:00
Daniel Hilst acc5b9de29 Merge pull request #7772 from VersatusHPC/refactor/package-postscript-utils
feat(postscripts): establish package utility loading
2026-08-28 17:00:21 -03:00
Vinícius Ferrão dffaa1e0c6 test(postscripts): require package utility loading 2026-08-28 16:22:54 -03:00
Vinícius Ferrão c00ed7c181 feat(postscripts): require package utility loading 2026-08-28 15:51:59 -03:00
Vinícius Ferrão 01766a6c66 docs(genimage): document InfiniBand driver defaults 2026-08-28 14:32:49 -03:00
Vinícius Ferrão ee18db925a test(genimage): cover Mellanox InfiniBand defaults 2026-08-28 14:32:48 -03:00
Vinícius Ferrão 801677d447 genimage: include available Mellanox InfiniBand drivers 2026-08-28 14:30:43 -03:00
Vinícius Ferrão 48faeeac5f docs(genimage): show the Mellanox drivers that genimage adds 2026-08-28 12:48:17 -03:00
Vinícius Ferrão ac293c66cb test(genimage): cover target-kernel Mellanox resolution 2026-08-28 12:48:17 -03:00
Vinícius Ferrão c6c7df99bd genimage: resolve Mellanox defaults from target kernel
Resolve optional Mellanox network drivers against the target image's selected kernel. Keep real mlx_en modules, fall back to mlx4_en, include available mlx5_core, and omit missing defaults without changing explicitly requested netdrivers.
2026-08-28 12:48:17 -03:00
Vinícius Ferrão be8e033cbe test: reuse File::Slurper for fixture files 2026-08-26 15:17:52 -03:00
Vinícius Ferrão 5fb762f2b6 test(xcatd): cover the secret set response classification
Extract secret_in_request, secret_in_response and the secret sets from
xcatd.pm, because the classifier and the finalizer consult them. Cover
the authentication key, the privacy key and the snmpc site value reads
as sensitive, the token, prodkey and site table dumps as sensitive, the
nodels expansion of a secret table as sensitive, the lsvm directory
listing as sensitive, and the implicit lsdef attribute listing as
redacted. Keep a plain site value, a benign table,
a benign object listing and a group named like a table as not
sensitive. Assert that the daemon redacts each request segment alone.
2026-08-26 14:53:34 -03:00
Vinícius Ferrão bd55c0bf1e test(anaconda): pin the CentOS Linux minor version from the media
Build a medium for each CentOS Linux 8 release from the package names that
the release gives, and make sure that copycds finds the minor version.

Pin the behaviour when the medium gives no release package, and make sure
that a package with the same centos-release prefix, or a package for a
different major version, does not give a version. Pin that a medium that
names two minor versions keeps the unversioned name. Pin that CentOS Stream,
Rocky Linux, AlmaLinux, Red Hat Enterprise Linux and Oracle Linux keep
their own branches.
2026-08-26 14:23:19 -03:00
Vinícius Ferrão ae06a1edcb fix(anaconda): read the CentOS Linux minor version from the release package
Every CentOS Linux 8 medium gives the same description, "CentOS Linux 8".
The description gives no minor version. The .treeinfo file on the medium
gives no minor version. Thus copycds gave the name centos8 to all of these
media. Two CentOS Linux 8 media then wrote into the same /install/centos8
directory and made osimage definitions with the same names.

The discinfo identifier table gives the minor version, but it contains
only 8.1 and 8.5. The identifiers of an expanded tree are also different
from the identifiers of the DVD. The release package in BaseOS/Packages is
the only other record of the minor version on the medium.

Read the version from the name of that package. CentOS changed the name of
the package to centos-linux-release in 8.3, thus accept the two names.
Accept only a major.minor version, because other packages start with the
same centos-release prefix. Accept only the major version that the
description gives, because a package for a different major version does not
describe this medium. Accept the minor version only when the medium names
one, because a medium that names more than one does not pin a minor version.

Keep the version from the description in the other conditions. A medium that
names no minor version keeps the name centos8, which is the behaviour before
this change and the correct name for media that do not pin a minor version.

CentOS Stream, Rocky Linux, AlmaLinux and Red Hat Enterprise Linux keep
their own branches. CentOS Linux 7 gives a different description and has
no BaseOS directory, thus it does not use this path.

Recovered from the lenovobuild branch. Reimplemented against master: the
original reads only centos-release, which CentOS renamed in 8.3, and its
expression is not anchored.
2026-08-26 12:15:59 -03:00
Vinícius Ferrão 031ad68a41 fix(xcatd): classify secret responses by the shared secret set
The commands.log response classifier used a "passw" text match on the
request arguments. A secret whose name has no such text passed the
check, so a read of an authentication key, a privacy key or the snmpc
site value logged its bare value in the response. A command that
expands an argument also passed the check: nodels with a table name
returns every column of the table, and lsdef returns attributes that
the request never names. The daemon also ran redact_password over the
whole connection log on each request, so the redactor split at the
first request of the connection and the change signal swept the text of
earlier requests and responses.

Add secret_in_request. The routine reports a request that names a
secret attribute, selects a secret site key, or dumps a table that owns
a secret column through tabdump or nodels, from the same secret set
that the argument redaction uses. The response classifier calls it, so
the response of such a request logs as redacted.

Add secret_in_response. The routine reports response text that holds
"passw" or a secret attribute name in assignment or column form. The
response finalizer calls it in place of the bare text match, so an
expanded listing that carries an authentication key or a product key
logs as redacted even when the request never names it. The lsvm
response is the directory entry, whose passwords are positional, so
the classifier marks the command itself.

Build each request segment alone, redact the segment, and then append
it to the connection log. The redactor now always sees the current
command, and the change signal covers only the current request.
2026-08-26 12:14:21 -03:00
Vinícius Ferrão b2ad18137b Merge pull request #7766 from VersatusHPC/refactor/routeop-helper-reuse
refactor(routeop): reuse route classification helpers
2026-08-26 11:11:44 -03:00
Daniel Hilst b4c7936cc6 Merge pull request #7764 from VersatusHPC/refactor/dhcp-shared-os-version-parsing
refactor(dhcp): reuse shared OS version parsing
2026-08-26 11:09:02 -03:00
Daniel Hilst e8b0620345 Merge pull request #7757 from VersatusHPC/refactor/template-shared-ubuntu-version-comparison
refactor(template): use shared Ubuntu version comparison
2026-08-26 11:06:31 -03:00
Vinícius Ferrão 2dc4afd903 Merge pull request #7741 from stanford-rc/genpdu
feat: add `genpdu` pdutype for generic SNMP PDUs (PDU2-MIB)
2026-08-26 00:14:25 -03:00
Kilian Cavalotti 0b4695eef2 Accept MIB labels for genpdu enumerated values
With PDU2-MIB loaded, SNMP.pm returns an enumerated INTEGER as its label
rather than its number: a PX4 answers inletSensorUnits with "amp" rather
than "2". That failed the numeric test, fell back to none(-1) and
dropped the unit suffix from every rvitals reading.

Add pdu2_enum, which accepts the number, the label, or the label(value)
form Net-SNMP produces with quick printing off, and use it for the
sensor units and for outletSwitchingState.

Also stop requiring the switching probe to read on or off. An outlet can
be in any SensorStateEnumeration state, and pdu2_get has already ruled
out an absent instance, so any answer proves the outlet is switchable.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-25 17:44:23 -07:00
Daniel Hilst ab7813e3e6 Merge pull request #7746 from VersatusHPC/fix/blade-findme-chassis-filter
fix(blade): let a discovery request reach the findme handler
2026-08-25 20:26:47 -03:00
Daniel Hilst 9a851988b8 Merge pull request #7745 from VersatusHPC/fix/rspconfig-per-bmc-args
fix(rspconfig): accept one network value per BMC
2026-08-25 20:21:31 -03:00
Vinícius Ferrão 763c90c116 test(discovery): cover shared findme decisions 2026-08-25 19:46:04 -03:00
Vinícius Ferrão b1ef0620de refactor(discovery): share blade findme decisions 2026-08-25 19:46:04 -03:00
Vinícius Ferrão 875f7d764d test(discovery): prepare shared findme helper loading 2026-08-25 19:33:08 -03:00
Vinícius Ferrão 6752cc9ce2 test(rspconfig): call the per-BMC helper directly 2026-08-25 18:47:11 -03:00
Vinícius Ferrão 0a8281880d test(blade): call the findme helpers directly 2026-08-25 18:47:10 -03:00
Vinícius Ferrão e4a912db10 refactor(rspconfig): isolate per-BMC setting selection 2026-08-25 18:47:10 -03:00
Vinícius Ferrão d6eca6f052 refactor(blade): isolate findme decisions 2026-08-25 18:40:56 -03:00
Vinícius Ferrão e10620c02f test(rspconfig): prepare direct helper loading 2026-08-25 18:40:56 -03:00
Vinícius Ferrão 07e591424f test(blade): prepare direct helper loading 2026-08-25 18:40:56 -03:00
Vinícius Ferrão d4c3191b07 docs(rspconfig): describe one network value per BMC
Record that a node with more than one BMC is configured one BMC at a
time and that a comma separated value gives one setting per BMC, in
both the man page source and the checked-in text.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão 777fcfe561 test(blade): pin that a discovery request reaches the handler
Add a unit test for the entry decision of the blade preprocessor. The test
lifts the entry out of the plugin source and drives it, because the plugin
needs a management node to load in full.

The test gives the entry the request that a booting node sends, which names
no node, and shows that the entry hands it on and answers no error. It also
shows that a request for another command without a noderange is still
refused.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão 8a64b224a3 test(rspconfig): cover one network value per BMC
Extract per_bmc_argument and the set of settings that take a list from
ipmi.pm, and drive the real routine, because the plugin needs daemon
dependencies that the test host does not have.

Cover a single value serving every BMC, a list read in session order, a
list too short for the BMC being configured, empty entries, and the
defensive inputs. Assert that only ip, netmask and gateway read a list,
that the caller reports a short list rather than sending it, that the
session keeps the value of its own BMC for the follow-up, and that the
thermal profile keeps its own argument.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão 2d1f64f0fb fix(blade): let a discovery request reach the findme handler
A node that boots sends a findme request to say that it is there. That
request names no node, because the node is what the request asks xCAT to
find. The preprocessor of the blade plugin asks for a noderange for every
command, so it answers "Missing Noderange" with an error code and gives back
no request. The daemon then has nothing to give to the handler, and the
findme handler of the plugin does not run.

The plugin therefore answers each discovery request with an error, and blade
discovery does not happen. The check that asks for a noderange is older than
the findme handler.

Hand a findme request to the handler, as the switch plugin does for the
commands that it does not preprocess. Every other command keeps the check.

The preprocessor also held a test that removed a node from a findme request
when the hardware type was not blade. A findme request now returns above that
test, and it named a noderange that a findme request never carries, so the
test could not run. Remove it.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão cbf5cb3dae test(blade): pin which rows of the mp table are blades
Add a unit test for the routine that selects the blades. The test lifts the
routine out of the plugin source, because the plugin needs a management node
to load.

The test gives the routine the row shapes that the writers of the mp table
make: a management module and its blades from xCAT::PPCdb::add_systemX and
the shipped mp template, a chassis that gives its hardware type, and one row
for each hardware type that lsslp writes. It also shows that the handler
reads the chassis attribute and that it stops before the arp table when the
mp table holds no blades.
2026-08-25 18:40:56 -03:00
Vinícius Ferrão f9ed90ec0b fix(rspconfig): accept one network value per BMC
A node can carry more than one BMC, and rspconfig already opens a
session per BMC for rinv, reventlog, rvitals and rspconfig. A setting
such as ip= carried a single value, so every BMC of the node received
the same one. Two BMCs cannot share an address, so a node like that
could not be configured through rspconfig at all.

Read a comma separated value as one setting per BMC, in the order the
sessions are numbered. Only the ip, netmask and gateway settings read a
list, because a comma belongs to the value itself in a free form SNMP
community string. A value without a comma still reaches every BMC, so
the existing single BMC use is unchanged.

An entry that is missing or empty reports the mismatch instead of
reaching the address encoders, which reject an empty string. The
session then holds the value of its own BMC, because the follow-up
callbacks read the subcommand again to decide whether the address came
from DHCP.

Recovered from the lenovobuild branch.
2026-08-25 18:40:55 -03:00
Vinícius Ferrão 097554ba34 fix(blade): ask only the blades of a chassis for a discovery inventory
The findme handler of the blade plugin makes an inventory request for each
node in the mp table. That table holds more than the blades of a chassis.
lsslp writes a row for a Power BMC, for an FSP, for a BPA, for an HMC and for
other hardware, and xCAT::PPCdb::add_systemX writes a row for a management
module. None of that hardware answers a blade inventory.

Keep a row that gives blade as its hardware type. Keep also a row that gives
no hardware type but names a different node as its mpa, when that other node
is a management module. The mp template in xCAT/templates/e1350 leaves the
hardware type of a blade empty, so a test of the hardware type alone loses
the blades of a chassis.

Return when the table holds no blades. The work below the filter reads the
arp table of the management node, and a site that has no chassis must not pay
for that on each discovery request.

Recovered from the lenovobuild branch, which tested the hardware type only.
2026-08-25 18:40:55 -03:00
Vinícius Ferrão e8902990e2 test: cover shared string trimming 2026-08-25 13:14:20 -03:00
Vinícius Ferrão 751d237c13 refactor: centralize policy string trimming 2026-08-25 13:00:46 -03:00
Vinícius Ferrão 593e349557 Merge pull request #7769 from VersatusHPC/feat/genesis-common-repository
feat(genesis): consume packaged OpenEmbedded images
2026-08-25 12:42:16 -03:00
Vinícius Ferrão 8fadd0664e test(genesis): cover reviewed edge cases
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 11:27:13 -03:00