2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00
Commit Graph

6256 Commits

Author SHA1 Message Date
Vinícius Ferrão 033b16d522 feat(mknb): write grub2 discovery configs for riscv64
mknb only knew how to publish a discovery boot configuration for x86
(PXELINUX and xNBA) and POWER (petitboot). Any other architecture got a
Genesis kernel and initramfs under /tftpboot/xcat and nothing that would
make a firmware boot them, so riscv64 discovery could not start.

riscv64 nodes boot through UEFI and grub2. Write one grub2 configuration
per network, /tftpboot/boot/grub2/grub.cfg-<network hex prefix>, using
the same network keys as the PXELINUX files. A net-booted grub2.riscv64
searches grub.cfg-01-<mac>, grub.cfg-<8 hex ip> and then shorter prefixes
of the ip, so the per-node files that nodeset writes keep priority and
the network file is only reached by clients without a node configuration.
The file is regenerated from the published Genesis artifacts (lzma
preferred over gzip), guarded by $grub_cpu so other grub2 architectures
can share it later, carries the xcatd endpoint, the serial console and
BOOTIF=$net_default_mac, and is dropped for networks served by a
:noboot interface. It is written by name rather than into an existing
file, because on a /32 network nodeset's hard link for the node carries
the same name.

Publishing a Genesis image now also drops the other compression variant
of that architecture, so a leftover genesis.fs.<arch>.lzma can no longer
be paired with a freshly published kernel by this configuration or by
--configfileonly. And since these configurations are only reachable
through grub2.<arch>, which xCAT does not build, a missing boot loader is
reported instead of leaving the nodes to time out in firmware.

xcatconfig now also runs mknb riscv64 when xCAT-genesis-base-riscv64 is
installed, and the usage text lists the architecture.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão bd87aa9ed9 feat(nodediscover): default discovered riscv64 nodes to grub2
Discovery left noderes.netboot untouched for any architecture outside
x86, ppc and armv7l, so a discovered riscv64 node had no boot method and
nodeset failed to find a plugin for it.

Move the default-netboot ladder into _default_netboot(), which returns
the method to set or undef, and teach it that riscv64 nodes boot through
UEFI and grub2. The existing x86, PowerNV, ppc and onie rules are
unchanged; aarch64 is deliberately left as it was. The platform of the
discovery request is only read when the request carries it, so a node
that reports none does not gain the key, which would end up stored as
discovery data.
2026-09-01 10:50:19 -03:00
Vinícius Ferrão 9549e660f9 feat(dhcp): boot RISC-V 64-bit UEFI clients with grub2
RISC-V 64-bit UEFI firmware identifies itself with DHCP option 93
client-system-architecture 27 (0x001b, IANA processor architecture
types). Neither DHCP backend knew the value: Kea handed such clients no
boot file and ISC dhcpd fell through to the /yaboot catch-all.

Add an xcat-riscv64 Kea client class and an ISC subnet branch that send
them boot/grub2/grub2.riscv64, the same shape as the aarch64 entries.
The UEFI HTTP boot id (0x001c) is left alone: it needs a URL boot file
and the HTTPClient vendor class, which is a separate change.
2026-09-01 10:50:19 -03:00
Daniel Hilst 4a0d9e0bb0 Merge pull request #7801 from VersatusHPC/refactor/dhcp-omapi-key-rendering
refactor(dhcp): share OMAPI key configuration
2026-08-31 20:39:06 -03:00
Daniel Hilst aa447fe247 Merge pull request #7780 from VersatusHPC/feat/confluent-switch-topology
feat(confluent): export the switch topology of each node
2026-08-31 17:43:52 -03:00
Vinícius Ferrão 75715971b7 refactor(dhcp): share OMAPI key configuration 2026-08-31 16:10:14 -03:00
Daniel Hilst 0a93aba2b0 Merge pull request #7786 from VersatusHPC/feat/policy-user-groups
feat(policy): allow Unix group rules
2026-08-31 15:55:34 -03:00
Daniel Hilst e872fd20cf Merge pull request #7775 from VersatusHPC/fix/anaconda-driver-disk-kernel-arg
fix(anaconda): load the driver disk that is added to the initrd
2026-08-31 12:12:09 -03:00
Daniel Hilst bee09454f7 Merge pull request #7777 from VersatusHPC/fix/dhcp-infiniband-twin-entry
fix(dhcp): register the InfiniBand identity of a node that boots over IPoIB
2026-08-31 11:46:30 -03:00
Daniel Hilst 2abe22e203 Merge pull request #7791 from VersatusHPC/refactor/nfs-export-workflow
refactor(svrutils): centralize NFS export setup
2026-08-31 11:27:41 -03:00
Daniel Hilst 3563bda58d Merge pull request #7796 from VersatusHPC/fix/rinv-pending-uefi-build-id
fix(rinv): report pending UEFI build ID separately
2026-08-31 11:20:11 -03:00
Vinícius Ferrão c4b7301fe6 refactor(dhcp): centralize dynamic-range rejection 2026-08-30 23:08:58 -03:00
Vinícius Ferrão 4824e836ce fix(rinv): report pending UEFI build separately
The IMM pending_build_id property is not guaranteed to identify the primary UEFI bank. Keep it out of the active version value and expose it as a separate firmware inventory record.

Recovered from original commit b79c005061 by Jarrod Johnson.

Co-authored-by: Jarrod Johnson <jarrod.b.johnson@gmail.com>
2026-08-30 22:22:39 -03:00
Vinícius Ferrão e8d361ed0a refactor(debian): remove dead NFS export helpers
Remove the unreferenced Debian-local copies of setupNFSTree and setupStatemnt. Debian, Anaconda, and SLES callers already use xCAT::SvrUtils, and xCAT plugin dispatch does not expose these private symbols.

Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-30 20:24:45 -03:00
Vinícius Ferrão 2f798c20ea feat(policy): allow Unix group rules
Co-authored-by: Samveen <samveen@samveen.in>
2026-08-30 17:22:51 -03:00
Vinícius Ferrão 8fd34c04ff fix(anaconda): load the driver disk that is added to the initrd
xCAT appends dracut driver disks to the installer initrd as /dd.img. EL6 auto-loads that embedded image, while Anaconda 7 and newer require inst.dd=/dd.img on the kernel command line.

Record successful injection beside the generated initrd so nodeset --noupdateinitrd reuses the same decision as a normal nodeset. Clear the marker when rebuilding, validate the temporary archive paths, and do not create it when the disk cannot be copied, archived, or appended.
2026-08-29 18:28:00 -03:00
Vinícius Ferrão 7836a2577a fix(confluent): retract the switch topology that xCAT no longer holds
A confluent attribute update keeps every attribute that the request does not
name. The export only named the attributes that the switch table holds, so a
switch row that is deleted stayed in confluent, and an interface that is
renamed left the attributes of the old name beside the attributes of the new
one. Confluent then holds two ports for one node, which defeats the discovery
that this export exists for.

Name the topology attributes that the switch table no longer holds, with no
value, so that confluent removes them. Confluent removes the attributes that
the request names with no value before it sets the rest of the request, and it
accepts a wildcard for the attributes of every interface. The wildcard does
not match the attributes that carry no interface, so those are named on their
own.

A node that confluent does not hold yet has nothing to remove, so the request
that creates a node is unchanged.

A confluent that accepts a wildcard in the name of an attribute arrived in
3.4.0. An older confluent reads the name as the name of one attribute, finds
no attribute of that name and reports nothing. The topology of an interface
that is gone then stays, as it does today.
2026-08-27 17:57:56 -03:00
Vinícius Ferrão 31daf134e2 fix(confluent): read the enclosure of a node from the mp table
makeconfluentcfg exports enclosure.manager and enclosure.bay from the mpa
and id columns. Those columns belong to the mp table. When the command runs
with a node range it reads them from the mp table, but when it runs with no
argument it reads them from the nodepos table, which has only node, rack, u,
chassis, slot, room and height. The two attributes were therefore always
empty for a whole cluster export.

Read them from the mp table in both branches.
2026-08-27 12:41:28 -03:00
Vinícius Ferrão 16c88d8966 feat(confluent): export the switch and port of each node
makeconfluentcfg gives confluent the console settings, the credentials of the
hardware manager, the location and the enclosure of each node. It does not
give the switch and the port that the node is cabled to, which confluent uses
to find a node by the port it answers on.

Read the switch table and give confluent net.switch and net.switchport.

A node has one row in that table for each of its interfaces, thus keep every
row and not the first one. A row that names an interface gives
net.<interface>.switch and net.<interface>.switchport, so a node with more
than one interface keeps the port of each. A row that names no interface
gives the names without an interface.

Read the table with the node list when the command receives a node range and
read the whole table when it does not, as the command already does for the
other tables.

A cluster whose switch table is empty receives the configuration that it
receives today.

Recovered from the lenovobuild branch, where this arrived as one commit and
two repairs of it: the first keeps one row for each node, which loses every
interface but one, and reads the switch columns from the nodepos table in the
branch that takes no node range, where that table has no such columns and the
feature does nothing.
2026-08-27 12:41:28 -03:00
Vinícius Ferrão f7afab4bc2 fix(dhcp): recognise an InfiniBand interface in any position
The mgtifname of a network can name more than one interface, separated by !.
The test for an InfiniBand interface ends at the end of the value, thus it
recognises eth0!ib0 but not ib0!eth0, and a node on such a network receives no
second host entry and no address over IPoIB.

Accept the name in any position.
2026-08-27 01:53:42 -03:00
Vinícius Ferrão 39db381d50 fix(dhcp): defer static host replacement 2026-08-26 22:23:02 -03:00
Vinícius Ferrão e392621593 fix(dhcp): align fabric identity handling 2026-08-26 22:23:01 -03:00
Vinícius Ferrão 498240ea26 fix(dhcp): keep static host markers standalone
Keep the end marker on its own line so deleting one generated host cannot consume the declaration that follows it.
2026-08-26 22:23:01 -03:00
Vinícius Ferrão 1e5de1e476 fix(dhcp): register the InfiniBand identity of a node that boots over IPoIB
A node that discovery finds over ethernet is known by its ethernet mac. When
that node boots over IPoIB, the request carries the InfiniBand identity of the
adapter and not the ethernet mac. dhcpd finds no host entry for that identity
and answers nothing, thus the node does not boot and the log gives no reason.

dhcp.pm already gives hardware type 32 to a node whose mac attribute holds an
8 or 9 byte fabric address, but that needs the fabric address before the node
boots, and discovery records the ethernet mac.

A Mellanox adapter makes its port GUID from the ethernet mac, by the insertion
of 03:00 in the middle. Thus the InfiniBand identity of the node is already
known. Write it as a second host entry with the -xcat-ib suffix and hardware type
32, so a request over either fabric finds the node and
receives the same address. Remove that entry with the node.

Write the second entry only for a node whose network an IPoIB interface
serves. A cluster with no InfiniBand keeps the host entries that it has today.

This is for the ISC backend. makedhcp returns into the Kea code before this
routine when Kea is the backend, and a Kea server does not answer an IPoIB
client, thus there is nothing there for a second entry to answer.

Recovered from the lenovobuild branch. Reimplemented against master: the
original writes the second entry for every ethernet node, which makes two
host entries for each node of a cluster that has no InfiniBand.
2026-08-26 22:22:31 -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
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
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
Vinícius Ferrão b1ef0620de refactor(discovery): share blade findme decisions 2026-08-25 19:46:04 -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 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 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 8e94cd157a fix(genesis): complete artifact cleanup
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 11:26:47 -03:00
Vinícius Ferrão a983faf736 fix(genesis): retire stale legacy initramfs
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-08-25 11:26:47 -03:00
Vinícius Ferrão 33124a1483 fix(genesis): preserve canonical ppc64 images 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ca1b0cbd67 fix(genesis): protect Power architecture fallback 2026-08-25 11:26:46 -03:00
Vinícius Ferrão 719e5aecab fix(genesis): close consumer review gaps 2026-08-25 11:26:46 -03:00
Vinícius Ferrão ba2c1e75bc fix(genesis): finish consumer integration 2026-08-25 11:26:45 -03:00
Vinícius Ferrão f5d1bd8e73 fix(genesis): complete boot consumer wiring 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 4457efbd1b feat(genesis): activate installed OpenEmbedded images 2026-08-25 11:26:44 -03:00
Kilian Cavalotti daef2d7bae Distinguish SNMP failures from absent objects in genpdu
A missing object is exception text under v2c/v3 and an error under v1,
and genpdu treated both the same. Add pdu2_get, returning a value and an
ok, absent or failed status. A failed signed minimum read now skips the
sensor, and rinv no longer prints "No Such Instance currently exists at
this OID" for a nameplate field the model does not populate.

Read the signed minimum per entity: the MIB indexes it that way, and it
decides which value column is read.

In the session probe, fall back to the PDU2 nameplate rather than
sysDescr, so a credential that cannot read PDU2 is rejected, return
early when the pduCount read fails at the transport level, and warn once
per PDU.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-24 16:32:41 -07:00
Kilian Cavalotti 30dc723b6d Fix genpdu sensor value column and connection detection
genpdu read negative-capable sensors from the unsigned value column,
which the MIB leaves undefined for them: a PX4 answers it with 0 for
inlet reactive power and carries the reading in the signed column. Use
SensorSignedMinimum to pick the column, as the MIB specifies. The
unsigned column is still needed for active energy, whose range exceeds
Integer32 and reads 0 in the signed one.

An unreachable PDU or a wrong credential looked like a PDU without
switched outlets, since the switching probe was the first exchange with
the device. Probe pduCount first (implemented by every PDU2 agent,
verified on PX2, PX3 and PX4) and return no session when it fails, so
callers print "Couldn't connect to <pdu>". Warn when pduCount is not 1
rather than refusing: a linked primary still answers for its own
outlets.

Add unit tests for the genpdu sensor, session and inventory paths.

Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
2026-08-24 16:32:41 -07:00
Vinícius Ferrão 94531ecf79 refactor(dhcp): reuse shared OS version parsing 2026-08-24 16:21:19 -03:00
Daniel Hilst 5ca148889c Merge pull request #7749 from VersatusHPC/fix/nodestat-usefping-option
fix(nodestat): accept the fping option that the usage message gives
2026-08-24 12:42:21 -03:00
Daniel Hilst 14feebce2f Merge pull request #7753 from VersatusHPC/fix/genesis-lzma-via-xz
fix(mknb): compress the genesis image with xz when lzma is absent
2026-08-24 12:36:26 -03:00
Vinícius Ferrão d5f882291d fix(nodestat): accept the fping option that the usage message gives
The manual page and the usage message of nodestat give the option
-f|--usefping. The preprocessor of the request knows no option f, and the
handler of the request spells the long name useping, so --usefping does
nothing. An administrator who follows the manual page gets the nmap path, and
gets no message that says why.

The two places also read different specifications, so an option that one
place accepts can reach the other place and take a different meaning. Put the
specification in one routine, and let both places read that routine.

Give the name usefping to the option, and keep useping as a second name. That
spelling has worked since 2.14.2, so a site can have it in a script.

The long name of the fping option starts with the same letters as usemon, so
--use and --us become names that Getopt::Long cannot decide. Those two
abbreviations select usemon today. Keep them with usemon, or an administrator
who monitors with them loses the monitoring and gets no message.

The change has two other effects. The abbreviations --use and --us no longer
select fping as well, which they did only because the two places read
different specifications. The bundles -mf and -fm now select both options,
which they did not do before.

Recovered from the lenovobuild branch.
2026-08-23 22:38:41 -03:00
Vinícius Ferrão c390570e95 fix(mknb): compress the genesis image with xz when lzma is absent
The genesis image goes into a file whose name ends with .lzma. The plugin
writes that file only when /usr/bin/lzma is there, and it falls back to gzip
when it is not.

Red Hat ships no lzma binary. On AlmaLinux 9 and on AlmaLinux 10 that test
fails, the plugin falls back to gzip, and it gives no message that says why.
The image is larger on each run of mknb. Debian and Ubuntu ship lzma as a
second name for xz, so those systems still get the smaller image.

Ask xz for the same container when lzma is absent. The command
"xz --format=lzma" writes the same bytes as "lzma", so the file keeps its
name, its container and its size. Keep the gzip fallback for a system that
has neither program.

Recovered from the lenovobuild branch, which asked xz for the xz container.
That container is not the lzma container, and the name of the file says lzma.
2026-08-23 22:38:41 -03:00