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

6893 Commits

Author SHA1 Message Date
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 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 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
Vinícius Ferrão 24e2c98957 style(statelite): align image cache assignments 2026-07-14 19:11:28 -03:00
Vinícius Ferrão aa086a1bc9 feat(statelite): support NFS root mount options 2026-07-14 19:04:09 -03:00
Vinícius Ferrão 695dd485cf fix(xcat-server): retry suite 3 on zero RAKP2 HMAC 2026-07-13 17:57:36 -03:00
Daniel Hilst 37666b92cd fix(kvm): emit a pseries domain for ppc64le KVM hypervisors
build_xmldesc only recognised cpumodel "ppc64" (big-endian) when deciding to set
<os type arch='ppc64' machine='pseries'>, but ppc64le hosts report cpumodel
"ppc64le" (virNodeGetInfo model). A guest on a ppc64le hypervisor was therefore
emitted as an x86-style domain -- no machine type and with pae/acpi/apic -- and
libvirt rejected it: "machine type 'pseries-*' does not support ACPI".

Recognise "ppc64le" alongside "ppc64" for the arch/machine block, and omit the
x86-only pae/acpi/apic features on both. Little- and big-endian pseries guests
both use libvirt <os> arch "ppc64".

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-01 06:00:02 -03:00
Daniel Hilst 03e1559989 fix(xcat-server): default the Ubuntu apt mirror for netboot and Subiquity
The Ubuntu live-server ISO copycds imports is not a complete apt pool, so
both Ubuntu install paths fail without an external mirror: the netboot
genimage's debootstrap from the ISO-only pkgdir cannot resolve packages,
and the Subiquity diskful install (Template.pm) fell back to the airgapped
file:///cdrom config. Default site.ubuntu_apt_mirror to
http://archive.ubuntu.com/ubuntu when unset (overridable for local/geo/
ports mirrors). In the Ubuntu genimage, when pkgdir has no http mirror,
build the debootstrap source and chroot sources.list from that mirror with
the codename derived from osvers and the release/-updates/-security pockets
(main + universe) -- the compute pkglist needs universe (busybox-static,
dracut*) and the security-updated openssh. Ubuntu-only; EL netboot
(netboot/rh) and copycds/packimage are untouched.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-24 14:20:27 -03:00
Daniel Hilst 846e611772 fix(xcat-server): allow an online apt mirror for Ubuntu Subiquity installs
The Ubuntu live-server install media is not a complete apt package mirror.
With the generated apt configuration pinned to the media only, an install that
needs a package absent from the media stalls instead of fetching it. Emit an
online-mirror apt configuration when one is configured (site.ubuntu_apt_mirror)
so missing packages are retrieved from the archive; offline behaviour is
unchanged when it is unset.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-24 14:20:26 -03:00
Daniel Hilst 638f0d75c4 Fix xCAT 2.18 EL10 x86_64 package build issues
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-20 18:48:14 -03:00
Vinícius Ferrão c8b21c1cca fix: strip R:: prefix from netboot config when all options are persistent
When all addkcmdline options have R:: prefix (persistent options for
the installed OS), the volatile check in xnba.pm and pxe.pm would fail
because volatile was undefined. This left the original R::-prefixed
string in the netboot config instead of stripping it.

The fix ensures we always use the volatile portion after calling
splitkcmdline, even if it's empty. Persistent (R::) options are
handled separately by Template.pm via PERSKCMDLINE for the installed
OS bootloader.

Fixes #7442
2026-05-08 02:18:40 -03:00
Markus Hilger 4aa3205bca Merge pull request #7567 from VersatusHPC/fix/makedhcp-remote-networks
fix: non-local networks being skipped in makedhcp
2026-05-08 01:57:19 +02:00
Vinícius Ferrão afbb9114cf fix: remove dead check that skips all remote networks in makedhcp
The activenics{"!remote!"} hash key is checked at line 1940 but never
set by any code path — neither the dhcpinterfaces parsing nor the
querynics discovery populates it. This causes the guard to always
evaluate true, hitting next and silently skipping every !remote!
network when dhcpinterfaces is defined in the site table or on a
service node.

Remove the dead check so remote networks are processed correctly.
The inner activenics{$netif} check (which uses the actual interface
name after stripping the !remote! prefix) is the correct guard and
is preserved.

Original analysis by lebonez in xcat2/xcat-core#7242.

Co-authored-by: Lebonez <25910791+lebonez@users.noreply.github.com>
2026-05-07 18:05:27 -03:00
Markus Hilger fa17f7072d Merge pull request #7563 from VersatusHPC/fix/isc-omapi-tsig-policy
feat: support configurable ISC OMAPI TSIG policy
2026-05-07 19:51:32 +02:00
Markus Hilger 5463a7c46c Merge pull request #7558 from VersatusHPC/fix/mkdef-partial-object-on-validation-error
fix: prevent mkdef partial writes on validation errors
2026-05-07 11:50:41 +02:00
Vinícius Ferrão ab86139959 Support configurable ISC OMAPI TSIG policy
Add a shared OMAPI policy helper for ISC DHCP and DDNS so administrators can select the key name, signing algorithm, and omshell path from the site table while preserving the existing xcat_key hmac-md5 default.

Keep local ISC updates from hanging indefinitely when omshell does not exit, and use a static host-declaration fallback for local Ubuntu ISC releases where omshell is unstable for xCAT host updates.

Co-authored-by: gskouson <1507929+gskouson@users.noreply.github.com>
2026-05-07 03:57:10 -03:00
Vinícius Ferrão 2ae97c2ac4 fix: prevent mkdef partial writes on validation errors 2026-05-06 20:40:38 -03:00
Markus Hilger cb11564ff1 Merge pull request #7556 from VersatusHPC/fix/openbmc-503-retry
fix: retry on HTTP 503 from OpenBMC REST API instead of failing
2026-05-07 00:34:10 +02:00
Markus Hilger a90ef274aa Merge pull request #7555 from VersatusHPC/fix/ipmi-rmcptag-and-cbcpad
fix: ipmi rmcptag and cbcpad
2026-05-07 00:00:15 +02:00
Vinícius Ferrão 1bca57fa2a fix: retry on HTTP 503 from OpenBMC REST API instead of failing
OpenBMC BMCs intermittently return 503 Service Unavailable when the
REST service is busy or recovering. xCAT reported the error immediately,
requiring the user to manually retry. A second attempt usually succeeds.

Retry the same request up to 3 times with a 3-second wait on 503.
If all retries fail, report the error as before. The existing 504
handling for bmcreboot is preserved.

Ref: #4264
2026-05-06 18:50:53 -03:00
Markus Hilger aa180925e3 Merge pull request #7550 from VersatusHPC/fix/profile-asset-dotted-osvers
fix: handle dotted OS versions in profile asset lookup
2026-05-06 19:18:26 +02:00
Markus Hilger 2b1986d946 Merge pull request #7552 from VersatusHPC/fix/ubuntu-live-media-guardrails
fix: guardrails for Ubuntu genimage
2026-05-06 19:17:08 +02:00
Vinícius Ferrão c0e8b1730e fix: fall back from sha256 to sha1 on RAKP2 auth rejection
Extend the existing sha256-to-sha1 fallback (already present in
got_rmcp_response for Open Session errors) to also cover RAKP2
rejections with "Unauthorized name" (0x0d) or "Invalid role" (0x09).

Ref: #7511
2026-05-06 01:26:29 -03:00
Vinícius Ferrão 86f6a12264 fix: set IPMI name-only lookup bit in RAKP1 to match ipmitool
Set bit 4 (0x10) of the requested privilege byte in RAKP Message 1
for name-only user lookup, matching ipmitool behavior. Use the same
value consistently in all HMAC calculations (RAKP2 verification,
RAKP3 auth code, SIK derivation).

Without this, some BMCs fail user lookup with "Unauthorized name"
even though the credentials are correct.

Ref: #7511
2026-05-06 01:25:55 -03:00
Vinícius Ferrão 2bcdc52f92 fix: accept RMCP message tag 0 from OpenBMC with session ID correlation
OpenBMC-based BMCs return message tag 0 in RAKP2/RAKP4 instead of
echoing the tag from the request. xCAT rejected these as stale
responses and retried indefinitely until timeout.

Accept tag 0 but verify the remote console session ID in the response
matches our current sidm. This prevents stale retries from corrupting
session state while allowing OpenBMC responses through.

Applied to got_rmcp_response, got_rakp2, and got_rakp4.

Ref: #7511
2026-05-06 01:25:09 -03:00
Vinícius Ferrão cb2a6b3f3c fix: reject IPMI packets with invalid CBC padding instead of crashing
cbc_pad in decrypt mode reads the last byte as the pad count, then
calls splice(@block, 0 - $count). If decrypted data is corrupt, the
pad count can exceed the array size, crashing with "Modification of
non-creatable array value attempted, subscript -16".

Return empty string on invalid padding so the caller treats it as a
decryption failure rather than accepting corrupted data as a valid
IPMI response.

Ref: #7511
2026-05-06 01:23:10 -03:00
Vinícius Ferrão 7b20bbd187 Guard Ubuntu live media package sources 2026-05-05 21:40:04 -03:00
Vinícius Ferrão 9f33b19214 fix: restore legacy SLES provisioning paths 2026-05-05 17:09:37 -03:00
Vinícius Ferrão 119b19ce14 fix: handle dotted OS versions in profile asset lookup 2026-05-05 13:50:58 -03:00
Markus Hilger 2618b532c5 Merge pull request #7547 from VersatusHPC/fix/dhcp-dynamic-range-overlap
fix: errors out when node IP overlaps DHCP dynamic range
2026-05-05 09:28:23 +02:00
Markus Hilger 472529e046 Merge pull request #7546 from VersatusHPC/fix/remove-hardcoded-quiet
fix: move kernel quiet flag from hardcoded to osimage default
2026-05-05 09:26:26 +02:00