2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00
Commit Graph

6921 Commits

Author SHA1 Message Date
Daniel Hilst f28ad8587e Merge pull request #7694 from VersatusHPC/harvest/grub2-protocol-regex
fix(grub2): anchor the netboot protocol validation regex
2026-07-27 11:24:20 -03:00
Daniel Hilst e5bc261811 Merge pull request #7667 from VersatusHPC/harvest/ipmi-fpc-neverwait
fix(ipmi): never rate-limit packets to an FPC during reseat
2026-07-27 11:11:52 -03:00
Daniel Hilst caffd43e2d Merge pull request #7660 from VersatusHPC/harvest/ipmi-lenovo-recognition
fix(ipmi): recognize additional Lenovo IMM firmware prefixes and energy code
2026-07-27 10:55:02 -03:00
Daniel Hilst 34fd97ae63 Merge pull request #7666 from VersatusHPC/harvest/esx-esxboot-fallback
fix(esx): stage esxboot-x64.efi from the install media if missing
2026-07-27 10:39:05 -03:00
Daniel Hilst 2533c4ac62 Merge pull request #7635 from VersatusHPC/harvest/rinv-deterministic-sort
fix(rinv): sort FRU output deterministically
2026-07-27 08:26:08 -03:00
Daniel Hilst defa2e3196 Merge pull request #7636 from VersatusHPC/harvest/nodestat-fping-missing-msg
fix(nodestat): report a clear error when fping is missing
2026-07-27 08:24:27 -03:00
Daniel Hilst 4729139cb1 Merge pull request #7637 from VersatusHPC/harvest/rspconfig-empty-option-msg
fix(rspconfig): clearer error when no option is given
2026-07-27 08:22:07 -03:00
Vinícius Ferrão 854babe0c5 fix(rspconfig): clearer error when no option is given
Running rspconfig against an mgt=ipmi node with no option fell through to the
generic "Unsupported command: rspconfig " message (with an empty option),
which does not tell the user what is wrong. Detect the empty option in
preprocess_request and report that options are required.

Recovered from the unmerged lenovobuild branch (original 08ae94bd).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:11 -03:00
Vinícius Ferrão 10945e7fee fix(nodestat): report a clear error when fping is missing
nodestat -f runs fping to reach the nodes; if the fping package is not
installed the pipe yielded no output and nodestat silently returned an empty
result. Check that an fping binary exists before running it and emit an
explicit "must install fping" error otherwise.

Recovered from the unmerged lenovobuild branch (original f0c88182), reworked
to test for the binary directly: the original inferred fping's presence from
whether the pipe produced output, which false-positived (reporting fping
missing) when fping was present but every node was unresolvable -- caught in
lab validation.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:07 -03:00
Vinícius Ferrão d08a264e9d fix(rinv): sort FRU output deterministically
The FRU key sort used only `$a <=> $b`, a numeric comparison that returns 0
for the non-numeric FRU field names, leaving them in hash-iteration order.
That order is randomized per process, so `rinv <node> all` printed its fields
in a different order on each run. Add `$a cmp $b` as a tiebreaker so the
output is stable.

Recovered from the unmerged lenovobuild branch (original 9cd3fac6).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:03 -03:00
Vinícius Ferrão cb6a139286 fix(grub2): anchor the netboot protocol validation regex
noderes.netboot is parsed as grub2-<protocol> and validated with
/^http|tftp$/, which reads as (^http)|(tftp$) and so also accepts values
such as https, httpx and xtftp.

A value that passes but is not exactly "http" then falls through to
set root=$grub2protocol,$serverip, which drops site.httpport, so the mistake
surfaces as a confusing grub2 failure at boot instead of the "Invalid netboot
method" error this check exists to give. grub2-https cannot work in any case,
since only "insmod http" is emitted.

Supported values are unchanged: grub2, grub2-http and grub2-tftp.
2026-07-25 17:28:27 -03:00
Vinícius Ferrão 543eab3bdc fix(dhcp): reuse Kea control socket paths 2026-07-25 01:26:45 -03:00
Daniel Hilst 3191b874a3 Merge pull request #7629 from VersatusHPC/harvest/template-xcatroot-fallback
fix(template): fall back to $::XCATROOT when XCATROOT is not in %ENV
2026-07-24 18:45:55 -03:00
Daniel Hilst 929aa3292e Merge pull request #7630 from VersatusHPC/harvest/networks-exclude-all-linklocal
fix(networks): make IPv6 route filtering in donets() robust
2026-07-24 18:44:17 -03:00
Daniel Hilst 137508bc06 Merge pull request #7632 from VersatusHPC/harvest/nodech-comma-groups
fix(nodech): support comma-delimited values in the ,= and ^= operators
2026-07-24 18:41:53 -03:00
Vinícius Ferrão a64b6c647e fix(template): preserve explicit XCATROOT values 2026-07-24 13:07:51 -03:00
Vinícius Ferrão f8548ceeb9 fix(networks): validate IPv6 route filtering 2026-07-24 13:07:37 -03:00
Daniel Hilst 1424188693 Merge pull request #7617 from VersatusHPC/harvest/dhcp-ipv6-infinite-loop
fix(dhcp): avoid infinite loop building IPv6 reverse zones
2026-07-24 12:08:24 -03:00
Daniel Hilst 69a54aadd4 Merge pull request #7619 from VersatusHPC/harvest/mknb-atomic-genesis-image
fix(mknb): build the genesis image atomically to survive concurrent runs
2026-07-24 12:05:34 -03:00
Daniel Hilst e469aff826 Merge pull request #7604 from VersatusHPC/refactor/dhcp-shared-mac-normalization
refactor(dhcp): reuse Kea MAC normalization
2026-07-24 11:24:08 -03:00
Vinícius Ferrão 7ff2830bf6 fix(ipmi): never rate-limit packets to an FPC during reseat
reseat_node opens an IPMI session to the FPC/CMM to reseat a node. The FPC
needs packets sent without maxpending flow-control, but that state is only held
transiently. Add a persistent per-session 'neverwait' flag, set it on the FPC
reseat session, and honor it in sendpayload.

The flag defaults off, so it is a no-op for every other IPMI session; only the
FPC reseat path opts in. (The lenovobuild original also reworked the shared
login/admin_level_set nowait handling; that part is left out to avoid changing
flow-control for all BMCs.)

Not lab-validated (no NeXtScale FPC/CMM available).

Recovered from the unmerged lenovobuild branch (eda85df3, neverwait hunks only).
2026-07-23 19:32:58 -03:00
Vinícius Ferrão dc1472ff3c fix(esx): stage esxboot-x64.efi from the install media if missing
UEFI ESXi netboot needs esxboot-x64.efi under /xcat. When it was not
already staged, mkcommonboot left it missing; copy it from the install media's
efi/boot/bootx64.efi if that exists and the target does not.

Additive and ESXi-only (esx.pm mkcommonboot): it only copies when the target is
absent and the source is present. The original commit also dropped a
"bootmode ne install" guard whose own comment warns the installer croaks; that
hunk is intentionally left out.

Not lab-validated (no ESXi provisioning environment available).

Recovered from the unmerged lenovobuild branch (6931200d, esxboot hunk only).
2026-07-23 19:31:52 -03:00
Vinícius Ferrão f86a0c377c fix(rvitals): treat energy code 0xc1 as 'not supported'
The energy-manager (IEM) command handler treated response code 0xcb as the
'not present / not supported' signal. Some BMCs return 0xc1 for the same
condition, which was left unhandled. Accept 0xc1 as well.

Recovered from the unmerged lenovobuild branch (06d7097).
2026-07-23 17:55:16 -03:00
Vinícius Ferrão 259b63da8c fix(rinv): recognize TEI, CDI and PSI IMM firmware prefixes
The rinv firmware-inventory path detects a Lenovo IMM by matching the firmware
build-ID prefix (yuoo, 1aoo, tcoo). Some IMM firmware families report a tei, cdi
or psi prefix and were therefore not recognized as an IMM. Add them.

Recovered from the unmerged lenovobuild branch (e50cf37, 201b2de).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 17:54:59 -03:00
Vinícius Ferrão 5bfbc8edf6 Merge pull request #7627 from VersatusHPC/fix/ddns-net-dns-version-comparison
refactor(ddns): centralize Net::DNS version policy
2026-07-23 17:44:30 -03:00
Vinícius Ferrão f4965f5aac Merge pull request #7645 from VersatusHPC/harvest/dhcp-uefi-arch-0007
fix(dhcp): serve the UEFI boot loader for client architecture 00:07
2026-07-23 17:15:34 -03:00
Vinícius Ferrão 34241f680f Merge pull request #7633 from VersatusHPC/harvest/ddns-routed-local-address
fix(ddns): recognize a routed local nameserver address
2026-07-23 17:10:16 -03:00
Daniel Hilst 9dd025bf05 fix(ddns): retry transient DNS-update rejections and fail on persistent ones
ddns.pm's DNS-update send has a 3-try retry loop, but it only retried on
NOTAUTH and -- on the final attempt -- the `next` fell out of the loop without
reporting failure. makedns then printed "Completed updating DNS records." and
"DNS setup is completed" even when the update was never accepted.

Two problems this causes:
- SERVFAIL was never retried. named routinely replies SERVFAIL transiently
  right after a zone (re)load, before the zone is ready to accept dynamic
  updates; the update succeeds a second or two later. This reliably breaks real
  flat-cluster provisioning on el9/el10, where the test case's makedns -n runs
  right after named reloads the zone with the new compute node.
- A persistent NOTAUTH/SERVFAIL (retries exhausted) was silently swallowed and
  reported as success, so a genuinely failed DNS update looked like it worked.

Extract the batch send into send_ddns_update(), which retries NOTAUTH and
SERVFAIL (pausing on SERVFAIL), returns 0 only on NOERROR, and otherwise emits
the error and returns 1. Both batch-send sites now `return 1 if
send_ddns_update(...)`, so a real failure aborts add_or_delete_records instead
of falsely reporting success.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:34:50 -03:00
Vinícius Ferrão 60bd6e7cd9 fix(dhcp): serve the UEFI boot loader for client architecture 00:07
Modern x86-64 UEFI firmware (including OVMF and recent iPXE) reports DHCP
client architecture 00:07, but the xNBA network-boot conditionals only matched
00:09. A UEFI node would load xnba.efi, re-request with user-class xNBA and
arch 00:07, fail to match, and be handed xnba.efi again -- an endless boot
loop. Accept 00:07 alongside 00:09 in the xNBA UEFI branches of both the
network-level (addnet) and node-level (addnode) dhcpd statements.

Validated on an OVMF UEFI client: it progresses from xnba.efi to the .uefi
genesis config and boots, instead of looping on xnba.efi.

Recovered from the unmerged lenovobuild branch (5d697b5c, 86b0e12e).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-23 00:26:10 -03:00
Vinícius Ferrão a0dfc3343a fix(ddns): recognize a routed local nameserver address
The DNS-managed-networks check used my_ip_facing($net->{net}), which only
returns local addresses on the interface directly facing that network. A
nameserver that is a local address reachable via a different (routed)
interface was therefore treated as external, and the network was wrongly
dropped from ddns management.

Use thishostisnot(), which recognizes any local address regardless of the
interface, and keep the existing <xcatmaster> and site-nameserver special
cases.

Recovered from the unmerged lenovobuild branch (original 3c343f83), adapted
to preserve those special cases: lab validation showed the original replaced
them wholesale, which would exclude any network whose nameserver is the
literal <xcatmaster> token (thishostisnot('<xcatmaster>') is true).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:41:28 -03:00
Vinícius Ferrão f71ddef6ba fix(nodech): support multiple groups in the ^= operator
nodech's ^= operator removed only a single literal value, so
"nodech n1 groups^=a,b" tried to strip the combined string "a,b" and left the
individual groups in place. Split the value on commas and remove each piece.

Recovered from the unmerged lenovobuild branch (original 95c78b33).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:21:08 -03:00
Vinícius Ferrão 6e33661fc0 fix(nodech): handle comma-delimited values in the ,= operator
nodech's ,= operator appended the whole right-hand side as one value, so
"nodech n1 groups,=a,b" added the literal "a,b" and its duplicate check only
compared against that combined string. Split the value on commas and add each
piece individually, skipping any already present.

Recovered from the unmerged lenovobuild branch (original 086b0c0d).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:20:49 -03:00
Vinícius Ferrão c97e973f36 fix(networks): skip nexthop and default lines when parsing IPv6 routes
`ip -6 route` output for ECMP/multipath routes carries `nexthop` continuation
lines, and a `default` route has no network prefix. donets() treated both as
networks and added bogus entries to the networks table. Skip them alongside
the existing link-local/unreachable/via/lo filtering.

Recovered from the unmerged lenovobuild branch (original 7094ba0c).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:18:48 -03:00
Vinícius Ferrão d2be0c3865 fix(networks): exclude every link-local address from the networks table
donets() only skips the exact address 'fe80::/64' when scanning routes, so a
link-local route with any other prefix (e.g. a longer fe80:: subnet) is added
to the networks table as a bogus network. Match any fe80:: prefix instead of
the single literal value.

Recovered from the unmerged lenovobuild branch (original 8b79cf85).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:17:17 -03:00
Vinícius Ferrão 34866ebc23 fix(template): fall back to $::XCATROOT when XCATROOT is not in %ENV
envvar() resolves a template variable purely from %ENV, so a template that
references $XCATROOT expands to an empty string whenever XCATROOT is not
present in the environment of the process doing the substitution. $::XCATROOT
is set as a package global at module load and is reliably available, so use it
for that one variable before falling back to %ENV.

Recovered from the unmerged lenovobuild branch (original da72c6b8).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:11:47 -03:00
Vinícius Ferrão f0a879491d fix(dhcp): avoid infinite loop building IPv6 reverse zones
getzonesfornet() derives the number of reverse-zone nibbles as
$nibbs = $maskbits / 4, then decrements it once per hex nibble of the network
prefix. For a sub-nibble (not 4-bit-aligned) IPv6 mask $nibbs can go negative
before the padding loop, and `while ($nibbs)` then never terminates: it keeps
decrementing past zero while appending "0." to $rev, spinning forever and
growing the string until the process is killed.

Make the padding loop `while ($nibbs > 0)` so it can never run away, and
return early only when $nibbs is genuinely negative. $nibbs == 0 is the normal
nibble-aligned case (e.g. a /64) and must still emit its reverse zone.

Recovered from the unmerged lenovobuild branch (original 0e070cd2). The
original guarded with `$nibbs < 1`, which also dropped the valid $nibbs == 0
case and left standard /64 subnets with no reverse zone; corrected to
`$nibbs < 0` after lab validation on a real provisioning cluster.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 02:13:06 -03:00
Vinícius Ferrão ad9ac6db8a refactor(ddns): centralize Net::DNS version policy 2026-07-22 01:55:59 -03:00
Vinícius Ferrão 6da5efd29a fix(mknb): build the genesis image atomically to survive concurrent runs
mknb writes the compressed genesis filesystem by streaming cpio output
straight onto the final path in $tftpdir/xcat (genesis.fs.$arch.lzma or .gz).
When two mknb/nodeset runs target a shared $tftpdir at once, one run reads or
overwrites the other's half-written image, producing a corrupt genesis.fs and
failed netboots.

Write each image to a uniquely-suffixed temporary file
(xCAT::Utils::genpassword(24)) and File::Copy::move() it into place. move()
within the same directory is a rename, so the final path only ever appears
complete. Both modules are already imported by mknb.pm.

Recovered from the unmerged lenovobuild branch (originals c651e7b8 and its
fix da0723f2, which switched the suffix to genpassword after the first
attempt only produced a single character). master lacks the branch's xz
path, so only the lzma and gzip paths are adjusted here.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-21 16:24:08 -03:00
Vinícius Ferrão 3fc9f038b6 refactor(dhcp): reuse Kea MAC normalization 2026-07-18 12:05:10 -03:00
Daniel Hilst ec2bbb9a6a Merge pull request #7588 from VersatusHPC/fix/issue-6495-nfs-root-options
feat: add configurable NFS root options for statelite images
2026-07-17 23:46:14 -03:00
Daniel Hilst 419d6c262c Merge pull request #7596 from VersatusHPC/fix/issue-7593-systemd-packaging
fix: avoid sysvinit paths on systemd enabled systems
2026-07-17 21:35:45 -03:00
Vinícius Ferrão 68a4855c7f fix(statelite): reject invalid NFS root options early 2026-07-17 20:36:51 -03:00
Vinícius Ferrão 5fc111b3b3 Merge pull request #7590 from VersatusHPC/fix/issue-4082-makehosts-index 2026-07-17 20:12:54 -03:00
Vinícius Ferrão 08428ee667 Merge pull request #7589 from VersatusHPC/codex/issue-5843-copycds-sles-media 2026-07-17 19:41:09 -03:00
Daniel Hilst 428c63cdb1 Merge pull request #7598 from VersatusHPC/fix/issue-6498-mknb-xcatd-address
fix(mknb): avoid transient discovery addresses
2026-07-17 19:02:50 -03:00
Daniel Hilst 4a1cf4b0e8 Merge pull request #7586 from VersatusHPC/fix/issue-7512-ipmi-rakp2
fix(xcat-server): retry suite 3 on zero RAKP2 HMAC
2026-07-17 13:26:00 -03:00
Vinícius Ferrão d829be9e94 fix(packaging): make xcatd callers init-agnostic 2026-07-16 01:41:38 -03:00
Vinícius Ferrão 3cd74bbab0 fix(mknb): avoid transient discovery addresses 2026-07-15 21:20:26 -03:00
Vinícius Ferrão 009150823f fix(makehosts): index host lookups 2026-07-15 00:29:26 -03:00
Vinícius Ferrão 4918dfa9b7 fix(copycds): keep SLE 15 source media separate 2026-07-14 23:28:14 -03:00